Hello cmifwdll
Thank you for your tips.
Actually, I am pretty much aware of data sync and how to avoid those lost data and too much bandwitdh use. I was just a little bit lost about some of the send / receive package on TNet.
I am actually having another problem now, I think it is still related to this, if you or Aron could me help, I really appreciate it.
I am sending tno.Send with RFC and sometimes, the message never reaches neither the host or the client.
I have checked other posts and questions.
- I am making channel persistent (but sometimes it fails either with true or false)
- I connect to a channel for a scene load and another channel for players "waiting to play". Then I just change the scenes to play a mission (it is a basic FPS at the moment), but I don't change the channel. Do you know if it is necessary to change the channel each time I change the scene? Or the TNet does it for me?
- I have tested now (it's been 2 days, the game logic is working good) and my main problem is this... sometimes a specific tno.Send does not work (I do believe it is something on my side, because it is only with one of my methods, not all). But I cannot find the damn problem =P
Code:
tno.Send("_Receive_ReadyToStartMatch", Target.AllSaved, _networkProfileActive._nameAlias);
It should receive here:
// ################################################################################################
/// <summary>
/// Receive answer that can start the mission
/// </summary>
[RFC] void _Receive_ReadyToStartMatch (string pName)
{
MySystem.Instance._SaveLog(this.name, "NETWORK: Received ready to match from " + pName);
//How many players ready?
_playersReady++;
//Update
MySystem.Instance._HudForNetwork_UpdatePlayersReady(_playersReady);
//If all good, lets start
if (_playersReady >= _GetPlayersOnline && _IsHost)
_Send_StartMission();
}
But sometimes it never gets to me... I am also wondering if it is something to do with the server I am creating (using TCP and UDP when possible)...
Any clue? Thanks in advance.
EDIT: Looks like when this happens, after some time, the player just disconnects... maybe it is something with the game creation? Or server?
EDIT2: also, sometimes, it shows "No valid socket" after some messages arrives, in this same code calls