I have successfully got an online connection from multisync and another pc, but now im faced with the problem of the two programs communitcating , as in updating each others coordinates.
Right now i can see that its sending data but once it starts sending data[the client[ it no longer is playable and get EXTREMELY laggy(to the point of the camera doest update to the objects position and the object itself doesn't seem to move.
only server
void HostGame()
{
connection = NetPlayerJoined();
if (connection != 0)
{
NetPutString(MultiSyncServerName);
NetSend(connection);
connections++;
::MakePlayer(iPlayer2,"Colonel-X.x",553.715,108.501,-734.154);
}
playerleft = NetPlayerLeft();
if (playerleft)
{
dbDeleteObject(iPlayer2);
connections--;
}
//
sprintf(tempstr, "%i connected.", connections);
dbText(150, 32, tempstr);
}
only Client
bool ServerConnect(char *ipaddress)
{
DWORD start;
sprintf(tempstr, "BUFFER CONTENT UNCHANGED.");
if (NetConnect(ipaddress))
{
start = GetTickCount();
while (GetTickCount() - start < 5000);
if (NetGetMessage())
{
NetGetString(tempstr, 256);
::MessageBox(NULL,tempstr,MultiSyncServerName,MB_OK);
::MakePlayer(iPlayer2,"Colonel-X.x",553.715,108.501,-734.154);
__PCE = true;
}else{
sprintf(tempstr, ErrorNoConnectMessage);
MessageBox(NULL, tempstr,
MultiSyncClientName, MB_ICONINFORMATION);
return true;
}
}else{
MessageBox(NULL, ErrorNoConnection,
MultiSyncClientName, MB_ICONEXCLAMATION);
return false;
}
}
both server and client
void DS_SendCoord()
{
float pX = dbObjectPositionX(iPlayer1);
float pY = dbObjectPositionY(iPlayer1);
float pZ = dbObjectPositionZ(iPlayer1);
NetPutFloat(pX);
NetPutFloat(pY);
NetPutFloat(pZ);
NetSend(connection);
}
void DS_GetCoord()
{
float pX2 = NetGetFloat();
float pY2 = NetGetFloat();
float pZ2 = NetGetFloat();
dbPrint(pX2);
dbPrint(pY2);
dbPrint(pZ2);
dbPositionObject(iPlayer2,pX2,pY2,pZ2);
}