BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: kuznechik on April 05, 2007, 12:24:42 pm

Title: Online db
Post by: kuznechik on April 05, 2007, 12:24:42 pm
I'm trying to use onlinedb version of online, man, it's buggy :)
Hoping to nail some of it this week...
Usual online was working fine for me tho.
Title: Re: Online db
Post by: kuznechik on April 09, 2007, 09:01:06 pm
Well, it mostly works now.
Changes made were:

1. Error in Core/Roster.php, need more ()
Code: [Select]
--- Roster.php.orig     Wed Feb 21 21:36:18 2007
+++ Roster.php  Sun Apr  8 13:13:54 2007
@@ -211,7 +211,7 @@
                                        $this -> add ("Roster-XML", $member["id"], $member["nickname"], "from XML");
                                }

-                               else if ($db_member[0][2] == 1 || ($db_member[0][2] == 0 && (($db_member[0][3] + 172800) <= time())))
+                               else if ($db_member[0][2] == 1 || (($db_member[0][2] == 0) && (($db_member[0][3] + 172800) <= time())))
                                {
                                        $this -> add ("Roster-XML", $member["id"], $member["nickname"], "from XML");
                                }


2. /Modules/Is.php, need to remove buddy if he was in org and recently left.
Code: [Select]
--- Is.php.orig Wed Feb 21 21:46:27 2007
+++ Is.php      Sun Apr  8 14:10:10 2007
@@ -158,6 +158,8 @@

                                unset($this -> query[$name]);
                        }
+                        $this -> bot -> aoc -> buddy_remove($name);
                }
        }
 }

3. Fix in Core/OnlineDB.php to add online handler and fix default mysql state for online status for newly joined ppl (added a lot of ghosts otherwise)
Code: [Select]
--- OnlineDB.php.orig   Mon Apr  2 16:17:54 2007
+++ OnlineDB.php        Sun Apr  8 15:40:33 2007
@@ -19,13 +19,13 @@
              profession VARCHAR(25) NOT NULL DEFAULT '?',
              level INT NOT NULL DEFAULT 0,
              ailevel INT NOT NULL DEFAULT 0,
-             status_gc INT(1) DEFAULT '1',
+             status_gc INT(1) DEFAULT '0',
              org_rank VARCHAR(25) NOT NULL DEFAULT '?',
              org_name VARCHAR(25) NOT NULL DEFAULT '?',
              status_gc_changetime INT(11) DEFAULT '0',
-             status_pg INT(1) DEFAULT '1',
+             status_pg INT(1) DEFAULT '0',
              status_pg_changetime INT(11) DEFAULT '0',
-             status_irc INT(1) DEFAULT '1',
+             status_irc INT(1) DEFAULT '0',
              status_irc_changetime INT(11) DEFAULT '0',
              PRIMARY KEY (nickname, botname))");

@@ -37,6 +37,7 @@
 $commands["disconnect"][] = &$OnlineDB;

 $cron["24hour"][] = &$OnlineDB;
+/* uncomment if you wanna use it as online module, disable Online.php then
+$bot -> online = &$OnlineDB;
+*/
 /*
 The Class itself...
@@ -198,5 +199,10 @@
                }
        } // End function cleanup_table()

+       function logoff($name)
+       {
+       $this -> status_change($name, "gc", 0);
+       }
+
 } // End of Class
 ?>
SimplePortal 2.3.7 © 2008-2025, SimplePortal