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?
November 20, 2008, 07:18:42 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 499 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
Log playtime from buddys ...
by Temar
[Today at 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]

Delete member from Bot al...
by Alreadythere
[November 14, 2008, 12:17:54 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11034
Total Topics: 1495
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 15
Total: 18
Temar
Zeephonz
DarkGord

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