hi!
is anybody using the current version lobby server?
because i got an unhandled exception.
i tried on linux, and in my own computer, and nothing.
i spent a few hours and found where the error is, but i have no idea why it happens.
in the file TNTcpLobbyServer.cs
at the beggining of the ThreadFunction () function
void ThreadFunction ()
{
for (; ; )
{
mTime = DateTime.Now.Ticks / 10000;
// Accept incoming connections
while (mListener != null && mListener.Pending())
{
TcpProtocol tc
= new TcpProtocol
(); tc.data = (long)(-1); /* this is supposed to initialize field data to -1 and it works ok */
Console.Write(tc.data); /* prints -1 which is ok */
tc.StartReceiving(mListener.AcceptSocket()); /* something happens here *************/
Console.Write(tc.data); /* doesnt print anything, but no exception is thrown */
mTcp.Add(tc);
}
later on, in the same function, when the mTcp[n] data is going to be accessed you get a null reference exception.
if (mTcp.size > instantUpdatesClientLimit) mInstantUpdates = false;
// Send the server list to all connected clients
for (int i = 0; i < mTcp.size; ++i)
{
Console.Write(mTcp[0].data); /* doesnt print anything, but no exception is thrown*/
Console.Write(i); /* prints 0*/
TcpProtocol tc = mTcp[i];
Console.Write(tc.data); /* doesnt print anything, but no exception is thrown*/
long customTimestamp = (long)tc.data; /* ***************** null reference exception .... */
well...
im out of ideas
any help please?
ps. i am using this code in the client:
TNServerInstance.serverName = "My test Server";
TNServerInstance.Start(5127, 0, null, TNServerInstance.Type.Tcp, Tools.ResolveEndPoint("myserver.com:5129"));
yes yes... 2 days and i have only 2 lines of code... and they dont work!