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: Server merge!  (Read 17372 times)

0 Members and 1 Guest are viewing this topic.

Offline crocks

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Server merge!
« on: December 02, 2012, 09:40:56 pm »
Hey everyone,
according to planning server merge at the end of 2012 (as it seems). What would be the main thing on Bebot to be able to keep the databases and all around it if the character ID will be wiped and every character will get a new ID. Bebot works mostly with Char ID as you know.

Are there any plans how to transfer the databases and bots itself to the new server with current informations the databases have? (Account informations - points, raids done, raids history, raffle history, auctions history, character alts, character permissions etc etc etc ... )

Thanks

/CR
« Last Edit: December 02, 2012, 09:42:50 pm by crocks »

Offline Shelly

  • BeBot Apprentice
  • ***
  • Posts: 192
  • Karma: +0/-0
Re: Server merge!
« Reply #1 on: December 02, 2012, 11:55:36 pm »
I have been pondering the same thing... The way I came up with is very manual and tedious...

1. export your current DB to a flat file
2. after merge... look up all the names for the new character ID
3. hand edit the export you did in step 1 updating the character IDs for every member/guest in the DB to the new #
4. re-load the database with your edits and restart your bot.

Not a pretty solution... but I am not a coder by nature or occupation. :)

Shelly

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Server merge!
« Reply #2 on: December 04, 2012, 10:26:19 pm »
What we should probably do is add some bridge tables.

BeBot Accounts:
AccountID - Unique account ID number generated by BeBot.
OldCharacterID - Premerge Character ID.
NewCharacterID - Postmerge Character ID.
OldCharacterName - Character Name
NewCharacterName - New/Current Character Name.

I'm making the assumption that some characters will get renamed due to name collisions on RK1 and RK2.

Second Bridge Table: Alt Registration using AccountID. Associate ChacterIDs (or Character Names?) with BeBot AccountIDs. 
AccountID - Foreign Key.
OldCharacterID - Only needed until merge, then it should be blank for new registrations.
NewCharacterID - New/Current Character ID. Populated after merge.
Composite Primary Key: AccountID, CharacterID.

Third Bridge Table: Display Names. 
AccountID - Foreign Key.
DisplayName - Display name for account. This would Default to the main character. Add setting to allow users to provide a custom name that does not match an AO character if they desire.


Then we need some logic for dealing with remapping IDs, looking up Alts/Mains using the new system, etc. 

Offline Zweiblum

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
Re: Server merge!
« Reply #3 on: January 08, 2013, 11:41:59 am »
so... are there any "To-Dos" for PhP newbs like me to keep the bots running after merge?

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Server merge!
« Reply #4 on: February 05, 2013, 10:32:39 pm »
so... are there any "To-Dos" for PhP newbs like me to keep the bots running after merge?

Find a sufficient bribe to get a BeBot coder to fix it?  :P

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Server merge!
« Reply #5 on: February 26, 2013, 05:48:19 pm »
For the first server merge update I'd say we should add it as another option. Then the updated BeBot could be pushed out before the server merge happens and a simple configuration change is all that's needed after the server merge.

Offline Trypha

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Server merge!
« Reply #6 on: February 26, 2013, 05:57:57 pm »
Little too late for that, servers are down for the merge now.

I have a question (I stupidly deleted the post, but I'll ask again) - Vhab posted the new server info here: http://forums.anarchy-online.com/showthread.php?t=604029

Quote
Please note this information is subject to change.

Chat server: chat.d1.funcom.com:7105
Dimensions ID: 5

We aim to have people of Rubi-Ka and other web related services available when the servers come up, but we can't guarantee they will right away at this point.

Also note, you need to log in characters using the game client before they are available on the chat server.


My question: does the $dimension variable in Bot.conf need to be "5"? If so then this is what ServerList.php would have to look like:
Code: [Select]
$server_list['ao']['Testlive']      = array('server'=>'chat.dt.funcom.com', 'port'=>7109);
$server_list['ao']['Atlantean']     = array('server'=>'chat.d1.funcom.com', 'port'=>7101);
$server_list['ao']['Rimor']         = array('server'=>'chat.d2.funcom.com', 'port'=>7102);
$server_list['ao']['Die neue welt'] = array('server'=>'chat.d3.funcom.com', 'port'=>7103);
$server_list['ao']['null to get array index right'] = array('server'=>'null', 'port'=>7104);
$server_list['ao']['Rubi-Ka'] = array('server'=>'chat.d1.funcom.com', 'port'=>7105);

Or can we just erase all those lines and replace them like this:
Code: [Select]
        $server_list['ao']['Testlive']      = array('server'=>'chat.dt.funcom.com', 'port'=>7109);
        $server_list['ao']['Rubi-Ka']     = array('server'=>'chat.d1.funcom.com', 'port'=>7105);

and then set $dimension to "1"?

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Server merge!
« Reply #7 on: February 26, 2013, 10:07:46 pm »
Either should work, but may as well go with the simple way and remove the old servers and replace with the new.

Offline Ezzii

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Server merge!
« Reply #8 on: February 26, 2013, 10:18:00 pm »
Here is what I have done to make it work for me.

Part I   Part II   Part III
-----------------------------

Part I
-------
In bebot/conf/Bot.conf about line 9
Code: [Select]
  $dimension = "5";                 // The name of the server you play on, or (1, 2 or 3 for AO)   was dim 1 for RK1

Part II
--------
as Trypha suggested my relavent section of bebot/conf/ServerList.conf file reads:

Code: [Select]
$server_list['ao']['Testlive'] = array(
    'server' => 'chat.dt.funcom.com',
    'port' => 7109
);
$server_list['ao']['Atlantean'] = array(
    'server' => 'chat.d1.funcom.com',
    'port' => 7101
);
$server_list['ao']['Rimor'] = array(
    'server' => 'chat.d2.funcom.com',
    'port' => 7102
);
$server_list['ao']['Die neue welt'] = array(
    'server' => 'chat.d3.funcom.com',
    'port' => 7103
);
$server_list['ao']['null to get array index right'] = array(
    'server' => 'null',
    'port' => 7104
);
$server_list['ao']['Rubi-Ka'] = array(
    'server' => 'chat.d1.funcom.com',
    'port' => 7105
);

Part III
--------
In bebot/Sources/Bot.php added case "5" as you see here around line 225

Code: [Select]
        // Get dimension server
        switch ($this->dimension) {
        case "0":
            $dimension = "Testlive";
            break;
        case "1";
            $dimension = "Atlantean";
            break;
        case "2":
            $dimension = "Rimor";
            break;
        case "3":
            $dimension = "Die neue welt";
            break;
        case "5";
            $dimension = "Rubi-Ka";
            break;
        Default:
            $dimension = ucfirst(strtolower($this->dimension));
        }

        Require("conf/ServerList.php");

// that gets you past the Unknown problem -- we'll see about the rest of the bumps.  :)

 -- Ez 

Offline Mawerick

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Server merge!
« Reply #9 on: February 27, 2013, 05:53:51 pm »
Is it really necessary to keep the null entry in the server list? or keep any of the old servers at all?
Is the server list ever accessed by index?

Offline Ezzii

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Server merge!
« Reply #10 on: February 27, 2013, 08:01:04 pm »
Yes Mawerick, probably you are right but I went forward with the extra spacing of the array to try to eliminate all possible pitfalls of not being intimately familiar with this code.

 -- Ezzii

Offline Ezzii

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Server merge!
« Reply #11 on: February 27, 2013, 08:07:37 pm »
Part IV   Part V

* If the real developers want to step in at any moment and make the clean changes then please do.  I won't be offended at all.  -- until then here is my hacking.

Although the bot can now log into the chat server side, at this point the Roster update had been failing.

Someone posted that the PoRK look up dimension is not really 5 but still 1 now.  For us in Shadow Company -- I'm not sure of old RK2 orgs having been merged but I'm guessing they are same as us and do PoRK lookups using '1'.

Part IV
--------
With your bot not running, change the table named scbot_users to scbot_users_orig
this will allow your bot to make a new clean empty user table in its rosterupdate,
plus you get to have a back up of the original.  :)

You need your mysql username for your BeBot and respective password.

mysql session below:
[scbot is the prefix/name of my bot so yours will be different in that respect. :p
 do show tables; to figure out your exact *_users table name ;)  ]

** AGAIN! DO NOT use the instructions below with scbot verbage you need your own bot name
** see above.

Code: [Select]
Ez@omni-sc ~/scbot/main $ mysql -h localhost -u scbot -p

         <you'll be prompted for your password, type'y type'y>
mysql>
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| scbase             |
| test               |
+--------------------+
3 rows in set (0.13 sec)

mysql>
mysql> use scbase;
mysql> SHOW TABLES;

| scbot_users                |

mysql> rename table scbot_users to scbot_users_orig;

mysql> SHOW TABLES;

| scbot_users_orig           |

mysql> exit;

Ez@omni-sc ~/scbot/main $


Part V
-------
For this Part you need your new Org ID.  Ours is 4670 but yours better be differnt.  :)

So look it up.

They changed org ID's last nite on PoRK.  Ours was longer.  One good way to look it up is
goto http://people.anarchy-online.com/character/bio/d/1/name/YourToonNameAllLowerCase
(* you really have to change this URL ... the last part to your toons name in lower case)
then click your org name, then scroll to the bottom and click " XML version of this membership roster,"
then scroll back up to top and find your org ID in the XML tags.  :p  <id>4670</id>

On with the file modding:
Change the BeBot/main/10_Roster.php file here around line 316 to be like this:

Code: [Select]
        // Get the guild roster
        if ($this->bot->game == "ao") {
            $dimension = $this->bot->dimension;
            switch (strtolower($dimension)) {
            case "testlive":
                $dimension = "0";
                break;
            case "atlantean";
                $dimension = "1";
                break;
            case "rimor":
                $dimension = "2";
                break;
            case "die neue welt":
                $dimension = "3";
                break;
            case "rubi-ka";           // Addded by Ezzii
                $dimension = "5";    //
                break;              //
            }
            $members = $this->parse_org($dimension, $this->bot->guildid);


also, Change the BeBot/main/10_Roster.php file here around line 837 like this:
Make sure you use YOUR org's ID and NOT 4670!  In the line that has 4670 replace with your org's ID.
Code: [Select]
            // Get the guild roster
            $i = 0;
            $xml_roster = $this->bot->core("tools")
                // ->get_site("http://people.anarchy-online.com/org/stats/d/$dim/name/$id/basicstats.xml");  // original line
                ->get_site("http://people.anarchy-online.com/org/stats/d/1/name/4670/basicstats.xml");    //  hard coded testing line       Ezzii
            $faction = $this->bot->core("tools")


Ok having done that start the bot up and it will take a while to update the roster then add members to its friend list.

If at anytime PoRK starts using 5 instead of 1  then we'll get to do some more of this ;p .

What is still to be done I think is the !whois module looking up individual toons in the same way but I'm going to take a break for a while feel free to jump in.

 -- Ezzii
« Last Edit: February 27, 2013, 08:41:41 pm by Ezzii »

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
Re: Server merge!
« Reply #12 on: February 27, 2013, 09:27:24 pm »
also, Change the BeBot/main/10_Roster.php file here around line 837 like this:
Make sure you use YOUR org's ID and NOT 4670!  In the line that has 4670 replace with your org's ID.
Code: [Select]
            // Get the guild roster
            $i = 0;
            $xml_roster = $this->bot->core("tools")
                // ->get_site("http://people.anarchy-online.com/org/stats/d/$dim/name/$id/basicstats.xml");  // original line
                ->get_site("http://people.anarchy-online.com/org/stats/d/1/name/4670/basicstats.xml");    //  hard coded testing line       Ezzii
            $faction = $this->bot->core("tools")
the $xml_roster part should be like this instead:
Code: [Select]
$xml_roster = $this -> bot -> core("tools") -> get_site("http://people.anarchy-online.com/org/stats/d/1/name/$id/basicstats.xml");and set org-id in the bot's config file, especialy if running more than 1 bot from same folder (like I do). :-)
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Ezzii

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Server merge!
« Reply #13 on: February 27, 2013, 09:40:06 pm »
Yeh you're right Hefalomp,

All we need to hard code was $dim to 1 and nothing else.

Thanks for pointing out the right way.

 -- Ezzii

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
Re: Server merge!
« Reply #14 on: February 27, 2013, 10:51:31 pm »
To fix !whois

in core/ao/Whois.php change the function get_playerxml($name) (should start around line 410) so it looks like this before the $xml= part
Code: [Select]
        function get_playerxml($name)
        { // Start function get_playerxml()
                $name = strtolower($name);

                if ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "funcom_auno")
                {
                        $site1NAME = "Anarchy-Online";
                        // $site1URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site1URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";

                        $site2NAME = "Auno";
                        // $site2URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site2URL = "http://auno.org/ao/char.php?output=xml&dimension=1&name=" . strtolower($name);
                }
                elseif ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "funcom_only")
                {
                        $site1NAME = "Anarchy-Online";
                        // $site1URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site1URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";
                        $site2NAME = FALSE;
                }
                elseif ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "auno_only")
                {
                        $site1NAME = "Auno";
                        // $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=1&name=" . strtolower($name);
                        $site2NAME = FALSE;
                }
                else
                {
                        $site1NAME = "Auno";
                        $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site2NAME = "Anarchy-Online";
                        // $site2URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site2URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";
                }
note: auno lookup will fail for all chars from rk2 until auno syncs the new rk1 exports, funcom lookup will work just fine for characters activated in game, inavtive ones will not be avaliable for lookup.
« Last Edit: February 28, 2013, 12:58:26 am by Heffalomp »
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

 

* 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: 461
  • 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