I'm working on client-server-client game. Client is sending their status (position) 30 times a second. I'm using Lidgren.Network namespace for networking (server, client).
I've got two questions:
1. is: Is there a way to get whole NetIncomingMessage without manually using message.ReadString(), message.ReadInt32(), etc?
Second is a problem. On my local computer, everything works all right, position is updating fine and there are no Error Messages appearing. However, when on Linux (Using MONO on Linux side to run my server application (console appliaction)) on the remote box, I'm getting strange errors about once a second.
Received wrong pong number; got 56 expected 59 (ErrorMessage)
Received wrong pong number; got 57 expected 59 (ErrorMessage)
Received wrong pong number; got 58 expected 59 (ErrorMessage)
Googling this gave me only link to source code
Actual code taken right from source code of the Lidgren library which is giving me an error
// verify it´s the correct ping number
if (pingNumber != m_lastSentPingNumber)
{
m_owner.LogDebug("Received wrong pong number; got " + pingNumber + " expected " + m_lastSentPingNumber);
return;
}
possible problems:
- Mono
- Packet loss (which I think is more probably, but on the other side, I think this shouldn't happen as I use NetDeliveryMethod.ReliableOrdered)
For everyone interested, there's how I actually send the user's position
message.Write((byte)commandType.MOVE);
message.Write(Base.game.player.x);
message.Write(Base.game.player.y);
Client.SendMessage(message, NetDeliveryMethod.ReliableOrdered); // yes, ReliableOrdered, so I think it should loss any packets, should it?