I'm trying to get my 3D MMORPG networking going, and the server up dates perfectly, recieving data as fast as it is sent, but the client gets the information being sent to it with around a 5 second delay. For example, when I send out the position of a character walking in a straight line to the client, it gets it 5 seconds after, and when you stop walking, it does not stop recieving values for an additional five seconds. I'm sort of new to C++ so any help would be great!
Here's the code, each is in the main loop of it's corresponding program:
Server
Join = NetPlayerJoined ();
if (Join>0 )
{
Connected++ ;
}
dbText (100,10,"Connected :");
dbText (100,20,dbStr (Connected));
dbText (100,60,dbStr(Recive));
dbText (100,70,dbStr(Recive2));
if (Connected >0)
{
NetGetMessage ();
Recive = NetGetFloat ();
Recive2 = NetGetFloat ();
NetSend (0);
Send = dbObjectPositionX (3);
Send2 = dbObjectPositionZ (3);
NetPutFloat (Send);
NetPutFloat (Send2);
NetSendAll ();
Left = NetPlayerLeft ();
if (Left >0)
{
Connected --;
}
}
Client
dbText (100,10,"Connected :");
NetGetMessage ();
Recive = NetGetFloat ();
Recive2 = NetGetFloat ();
NetSend (0);
Send = dbObjectPositionX (3);
Send2 = dbObjectPositionZ (3);
NetPutFloat (Send);
NetPutFloat (Send2);
NetSendAll ();
dbText (100,60,dbStr(Recive));
dbText (100,70,dbStr(Recive2));
Thanks in advance!
alalala