L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 12:44:37 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Redundant code in roster.php
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Redundant code in roster.php  (Read 308 times)
0 Members and 1 Guest are viewing this topic.
MajorOutage
Freshman
*
Offline Offline

Posts: 3


Redundant code in roster.php
« on: March 29, 2007, 04: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:
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.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Redundant code in roster.php
« Reply #1 on: March 29, 2007, 05:17:35 PM »

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].
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Redundant code in roster.php
« Reply #2 on: April 06, 2007, 08:28:16 PM »

This is a bug.

Upon the first error you should bail.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Redundant code in roster.php
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 15
Total: 18
egrath
Temar

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.184 seconds with 28 queries. (Pretty URLs adds 0.023s, 4q)
Loading...