BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: MajorOutage on March 29, 2007, 11:12:22 am

Title: Redundant code in roster.php
Post by: MajorOutage on March 29, 2007, 11:12:22 am
Whenever you add a member or guest without using the 'add' command, you get both a success msg and an error msg. Also, if you put a command but not a name, you get 2 error messages.

This is caused by lines 102-105 (for member) and 151-154 (for guest) in Modules/Roster.php
Code: [Select]
if (empty($vars[2]))
{
$this -> bot -> send_output($source, "You have to provide a character name", $type);
}

This is redundant code, as there are already error handlers in place for each command, and should be removed.
Title: Re: Redundant code in roster.php
Post by: Alreadythere on March 30, 2007, 12:17:35 am
Not sure if it's redundant or a true bug.

That part of the code is supposed to handle !guest|member [add] name commands, which means the username could be in vars[1] or vars[2].
Title: Re: Redundant code in roster.php
Post by: Khalem on April 07, 2007, 03:28:16 am
This is a bug.

Upon the first error you should bail.
SimplePortal 2.3.7 © 2008-2025, SimplePortal