collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Online db  (Read 1725 times)

0 Members and 1 Guest are viewing this topic.

Offline kuznechik

  • Contributor
  • *******
  • Posts: 60
  • Karma: +0/-0
Online db
« 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.
Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.

Offline kuznechik

  • Contributor
  • *******
  • Posts: 60
  • Karma: +0/-0
Re: Online db
« Reply #1 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
 ?>
Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 638
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal