Help with Impulse's 5165

09/12/2011 03:49 xBlackPlagu3x#1
I've looked at the database, looked through the code, looked at code that wasn't even relevant to the error and I still cannot find the error to the following, I just don't understand it. (Wow, what it be real easy...)

Error Message:

Line 40-51 in Program.cs:

Database(codatabase), Table(Configuration), Column(EntityUID), Data(1000230)

Any information needed other than that? Thanks for those of you who help me out, I need Impulse's source fixed up so I can have a chance to learn as many others have done from this source.
09/12/2011 07:35 -impulse-#2
it means your database connection wasn't successful.
09/12/2011 09:21 BaussHacker#3
EntityUID is null.

It's only assigned, if MySqlReader r is reading.

If your code does not enter through
if (r.Read())
{
}
Then it will not be assigned, so that's where your problem is.

As Impulse said, there is no database connection.
09/14/2011 02:21 xBlackPlagu3x#4
I'm such an idiot. It was because I didn't set my ServerName to the one I put in the database. So THAT is fixed.

But I've encountered another problem and I can obviously tell it has something to do with the EntityUID.

ErrorCode:

Where the null reference was handled is:

And the line of code at line 301 in Program.cs is:

Don't flame this and call me an idiot. I at least know what the problem is, just not how to go about solving it.
09/14/2011 11:31 BaussHacker#5
arg1's length is not equal or above position.
09/16/2011 04:26 Spirited#6
Tada....

Code:
try
                            {
                                Client.Exchange = false;

                                Client.Action = 1;
                                ushort position = 7;
                                uint PacketLen = BitConverter.ToUInt32(arg1, position);
                                int JunkLen = BitConverter.ToInt32(arg1, position += 4); 
                                int Len = BitConverter.ToInt32(arg1, position += (ushort)(JunkLen + 4));
                                byte[] pubKey = new byte[Len];
                                position += 4;
                                string PubKey = System.Text.ASCIIEncoding.ASCII.GetString(arg1, position, Len);

                                Client.Cryptography = Client.DHKeyExchance.HandleClientKeyPacket(PubKey, Client.Cryptography);
                            }
03/09/2013 06:03 N.I.G.H.T.M.A.R.E#7
Man, I could not understand his explanation to fix this bug, can you explain again?
03/09/2013 06:54 EOS 60D#8
Its a copy paste work dude there is no need to understand..
03/09/2013 23:46 Spirited#9
There are two problems being discussed by this thread. One of the problems that was encountered was the null exception with the mysql reader. That happened because the MySql database wasn't set up correctly. The second problem was causing the client to hang due to some offset calculation issues. I fixed those calculations to be correct. That's all.