private void SendMessageToOtherManagers(byte[] message, int type) { GameSystemData data = new GameSystemData(SystemID, message); MultiBaseRequest baseRequest = new MultiBaseRequest(MultiPossibleRequest.MultiGameData, MessagePackSerializer.Serialize(data)); client.SendMessageToServer(MessagePackSerializer.Serialize(baseRequest)); }
//sends a sync message public void SyncObject() { //only sync to this instance of the object if it's locally owned if (localOwned) { //create sync and base requests MultiSyncRequest syncRequest = new MultiSyncRequest(ID, syncedTransforms); MultiBaseRequest baseRequest = new MultiBaseRequest(MultiPossibleRequest.MultiSyncObject, MessagePackSerializer.Serialize(syncRequest)); //send the message away client.SendMessageToServer(MessagePackSerializer.Serialize(baseRequest)); Debug.Log("Object " + ID.ToString() + " sent sync request"); } //sync again after syncInterval seconds Invoke("SyncObject", syncInterval); }
protected void SendSyncMessage(byte[] message) { if (ClientID == client._ClientID) { MultiSyncPlayer syncPlayer = new MultiSyncPlayer(ClientID, message); MultiBaseRequest baseRequest = new MultiBaseRequest(MultiPossibleRequest.MultiSyncPlayer, MessagePackSerializer.Serialize(syncPlayer)); client.SendMessageToServer(MessagePackSerializer.Serialize(baseRequest)); } }