Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 23:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Trouble after splitting the AuthServer & GameServer

Discussion on Trouble after splitting the AuthServer & GameServer within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Trouble after splitting the AuthServer & GameServer

Hey guys,

I'm back doing some coding for the first time this year and I cannot seem to fix a problem I had a while back after splitting my GameServer & AuthServer.

In my AuthServer I currently have a dictionary called AwaitingPool and it will store a uint(Forward Packet Identifier) and also store a reference to the user's account. Looks abit like
Code:
public static Dictionary<uint, Database.AccountTable> AwaitingPool = new Dictionary<uint, Database.AccountTable>();
My GameServer needs to confirm upon confirmation of login that the Key exists in the dictionary and also to pull out the Account.

What the odd thing is, is that I try to pull out the key and my GameServer claims the Dictionary is absolutely empty, I do a test with both consoles making a command on both, to get the count on the dictionary after I try to login, AuthServer claims my key and account is in there while at the same time my GameServer claims it is empty.
AuthServer is referenced by the GameServer as a project.

Anybody know what's going on?
_DreadNought_ is offline  
Old 02/03/2011, 20:31   #2
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
lol... easy to split it...

make something more simple... make an unique id for accounts... and them check it's acc & pw into acc server...

send the login token using the acc uid and get the account into gameserver using this id... and just continue the login sequence ... should work perfectly...
12tails is offline  
Thanks
1 User
Old 02/03/2011, 21:04   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
Sounds to me like when you validate the login you are not sending information to the game server so that it can add it to its login clients dict.

Setup a simple socket to communicate between the two would be the simplest way.
pro4never is offline  
Old 02/03/2011, 22:35   #4
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
//EDIT: Like pro4ever said.... check if there are connection between the both programs.... other else you'll not get it working... them try this:

"AuthServer is referenced by the GameServer as a project"

let me show how i've done it...

there are two projects ... one auth and one game... btw none of them are referenced to each other... so, how do i get the login token??

like this:

Code:
                AuthState player = arg2.connector as AuthState;
                player.Cryptography.Decrypt(arg1);
                player.Info = new Authentication();
                player.Info.Deserialize(arg1, player.GeneratedKey);
                player.Account = new AccountTable(player.Info.Username);
                Console.WriteLine("[Auth-Socket] Incomming connection to " + player.Account.Username + " and password " + player.Account.Password);
                Forward Fw = new Forward();
                if (player.Account.Password.Equals(player.Info.Password))
                {
                    if (player.Account.State == AccountTable.AccountState.Banned)
                        Fw.Type = Forward.ForwardType.Banned;
                    else
                        Fw.Type = Forward.ForwardType.Ready;
                }
                else
                {
                    Fw.Type = Forward.ForwardType.InvalidInfo;
                }
                if (Fw.Type != Forward.ForwardType.InvalidInfo)
                {
                    Fw.Identifier = player.Account.AccountID;
                }
                Fw.IP = "127.0.0.1";//IP Adress
                Fw.Port = 5816;//GameServer port...
                player.Send(Fw);
and them at game server we do:
Code:
        static void AppendConnect(Connect appendConnect, Client.GameState client)
        {
            Database.AccountTable Account = new AccountTable(appendConnect.Identifier);
            if (Account != null)
            {
                client.Account = Account;
                string Message = "NEW_ROLE";
                if (client.Account.EntityID != 0)
                    Message = "ANSWER_OK";
                if (Account.State == Database.AccountTable.AccountState.Banned)
                    Message = "The account: " + Account.Username + " has been banned.";
                client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.Dialog));
                if (Message == "ANSWER_OK")
                {
                    if (ServerBase.Kernel.GamePool.ContainsKey(client.Account.EntityID))
                    {
                        Client.GameState aClient = null;
                        if (ServerBase.Kernel.GamePool.TryGetValue(client.Account.EntityID, out aClient))
                        {
                            try
                            {
                                if (aClient != null)
                                {
                                    aClient.Disconnect();
                                }
                            }
                            catch { ServerBase.Kernel.GamePool.Remove(client.Account.EntityID); }
                        }
                    }
                    Database.EntityTable.LoadEntity(client);
                    ServerBase.Kernel.GamePool.Add(client.Entity.UID, client);
                    if (!ServerBase.Kernel.WasInGamePool.ContainsKey(client.Account.EntityID))
                        ServerBase.Kernel.WasInGamePool.Add(client.Entity.UID, client);
                    client.Send(new GamePackets.CharacterInfo(client));
                    string IP = client.Socket.RemoteEndPoint.ToString().Split(':')[0].ToString();
                    client.Account.IP = IP;
                    client.Account.Save();
                    Database.EntityTable.UpdateOnlineStatus(client, true);
                    Console.WriteLine("Successful Connection ([" + client.Account.IP + "] [" + client.Account.Username + "])");
                    client.Action = 2;
                }
            }
            else { client.Disconnect(); }
        }
Hope it helped...

Regards... Leo

PLEASE DO NOT COPY AND PASTE THIS... IT SHOULD NOT WORK ONLY DOING THIS... AND YOU WILL NOT LEARN BY DOING THAT!
12tails is offline  
Thanks
1 User
Old 02/04/2011, 16:19   #5
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Yah ^ I was currently doing that. I uhm.. made mine a little more complicated then yours above to support for new accounts made by the register code and the Unique ID is created on AuthServer.

I have it working now anyway, so Thanks
I didn't copy and paste that, even if I tried your source is different from mine.
_DreadNought_ is offline  
Closed Thread


Similar Threads Similar Threads
AuthServer De/En ?
11/20/2010 - CO2 Programming - 4 Replies
First of all i wanna say hello to every1. And after reading lots of information about conquer cryptograpgy cant figure out what exactly encryption/decryption loginserver use? Somethig similar to XOR encryption ? what exactly? If i dont know that exactly it is then i cant write my proxy. I`ve read pro4ever thread but there is only explanation how proxys works and almost zero about how to create it (i dont need that some1 give me full code of proxy).
[HELP] Error when in AuthServer.cs
06/08/2009 - CO2 Private Server - 3 Replies
IM gettin this an error on line 31 of Auth Server http://img41.imageshack.us/img41/7368/erroreuj.pn g This is my AuthServer.cs /* * Created by SharpDevelop. * User: sams * Date: 3/8/2009 * Time: 2:19 PM *
AuthServer password encryption
04/26/2009 - CO2 Private Server - 1 Replies
Well thought it would fit in this section. Most of the sources I seen works this way: the first time an account login, it takes the "encrypted" password received and set it in the database. I've been trying to figure the encryption used, but with no success, my ASM skills just sucks. So, could anyone decent with assembler/debugging help me with this?
about splitting
01/12/2006 - Conquer Online 2 - 2 Replies
hey all i got a little trouble while making split, coz when i check on I WISH TO MOVE, ACC, PASS AND VALIDATIONPASS, then SUBMIT, i got this msg: WAHT ARE YOU DOING?, what is about? in my other acc i was corect to split, plz help :rolleyes:



All times are GMT +2. The time now is 23:01.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.