Weird null reference exception.

07/18/2011 01:46 BaussHacker#1
#Edit I know why it happens and it's fixed.
07/18/2011 04:28 { Angelius }#2
use a break point .
07/18/2011 05:05 BaussHacker#3
Quote:
Originally Posted by { Angelius } View Post
use a break point .
It's not that. The client is null, when I receive it at the game server, but it's assigned at the auth server.
07/18/2011 07:36 Spirited#4
Quote:
Originally Posted by BaussHacker View Post
It's not that. The client is null, when I receive it at the game server, but it's assigned at the auth server.
Use a concurrent dictionary to pass the information. Assign a new client at the game server.
07/18/2011 09:42 marlyandedsel#5
Quote:
Originally Posted by BaussHacker View Post
#Edit I know why it happens and it's fixed.
How did you fixed it?
07/18/2011 16:07 BaussHacker#6
Quote:
Originally Posted by marlyandedsel View Post
How did you fixed it?
Authserver is one socket and Gameserver is another. I were thinking of them to be the same, so I just used a dictionary to get the client, which was what I forgot to do.
Code:
        public static void ProcessConnection(SocketClient Client)
        {
            try
            {
                ConquerClient client = Kernel.ClientFromIP(Client.IP);
                if (client != null)
                {
                    Client.Owner = client;
                    client.SocketClient = Client;
                    client.CreateDHKey();
                }
                else
                {
                    Client.Disconnect(false);
                }
            }
            catch (Exception e)
            {
                Server.ErrorHandler.Handle(e);
            }
        }