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 04, 2008, 04:59:16 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 > Module Requests > Topic: problem with invite command, need fix
Pages: [1]   Go Down
« previous next »
Print
Author Topic: problem with invite command, need fix  (Read 507 times)
0 Members and 1 Guest are viewing this topic.
kinbaku
Freshman
*
Offline Offline

Posts: 8


problem with invite command, need fix
« on: November 01, 2005, 03:09:30 PM »

If you try to invite the bot to its own channel it results in a crash. ie if your bot is named bob, and u do !invite bob, the bot disconnects with this error in the console window:

Read error: EOF
[CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot is restarting.

Wondering if anybody could write a fix for me, i cant seem to fix it myself. Thanks.

PS - one would assume you could just NOT invite the bot to its own channel, but some friends of mine seem to find it funny to do so just to crash the bot. Thanks.
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
problem with invite command, need fix
« Reply #1 on: November 02, 2005, 06:52:35 PM »

This is a theoretical fix.

Open modules/PrivGroup.php
Find function invite
Replace it with
Code:

    function invite($from, $type, $who)
    {
        if (($this -> bot -> guildbot && $this -> bot -> is_member($from)) ||
                             $this -> bot -> admin -> in_group($from, "raidleader") ||
                                         $this -> bot -> admin -> in_group($from, "admin") ||
                                         $this -> bot -> admin -> in_group($from, "superadmin"))
        {
                if ($this -> bot -> botname == $who)
                {
                  $msg = "You cannot invite the bot to its own chat group";
                }
                else if ($this -> bot -> aoc -> get_uid($who))
                {
                  $this -> bot -> aoc -> privategroup_invite($who);
                  $this -> bot -> send_tell($who, "You have been invited to the privategroup by " . $from . ".");
                  $msg = "<font color=#ffff00>" . $who . "</font> has been invited.";
                }
                else
                {
                  $msg = "Player <font color=#ffff00>" . $who . "</font> does not exist.";
                }
        }
      else
        $msg = "You do not have permission to use this command.";


      if ($type == "tell")
        $this -> bot -> send_tell($from, $msg);
      else
        $this -> bot -> send_pgroup($msg);
    }
  }


Untested, but should work.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



problem with invite command, need fix
« Reply #2 on: November 07, 2005, 11:03:07 AM »

Yep, works like a champ.  Cheesy
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
Solerna
Rookie
**
Offline Offline

Gender: Male
Posts: 21



problem with invite command, need fix
« Reply #3 on: November 10, 2005, 05:23:29 PM »

Works like a charm IF i suply the bot name all in lowercase letters "bot" However if I invite "Bot" or "bOt" or any other version it still crashes =/
Logged
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



problem with invite command, need fix
« Reply #4 on: November 10, 2005, 05:33:17 PM »

Replace
Code:
if ($this -> bot -> botname == $who)

With
Code:
if ($this -> bot -> botname == strtolower($who))
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
Solerna
Rookie
**
Offline Offline

Gender: Male
Posts: 21



problem with invite command, need fix
« Reply #5 on: November 10, 2005, 06:12:46 PM »

Thanx, some days I shouldn't be allowed infront of the comp. Almost poked my eye when I saw that >.<
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Module Requests > Topic: problem with invite command, need fix
« previous next »
 
Jump to:  

Recent
online not working after ...
by Alreadythere
[Today at 03:53:28 PM]

Bot not working after tod...
by Alreadythere
[Today at 01:04:41 PM]

Tokens Calulator
by Temar
[December 03, 2008, 01:09:03 PM]

Bebot does not work with ...
by IKShadow
[December 03, 2008, 08:54:04 AM]

!items database
by Temar
[December 03, 2008, 07:27:59 AM]

massive_pvp_time_table 1
by Sudoka
[December 03, 2008, 06:49:07 AM]

Log playtime from buddys ...
by IKShadow
[December 02, 2008, 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]
Stats
Members
Total Members: 1246
Latest: Vingus
Stats
Total Posts: 11192
Total Topics: 1508
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 12
Total: 16
upstart
daltarak
vikor
Sudoka

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.347 seconds with 28 queries. (Pretty URLs adds 0.026s, 4q)
Loading...