private static NetMessageDestroyValue CreateDestroyMessage(SyncedValueContainer container) { return(new NetMessageDestroyValue() { TypeId = NetSerializer.GetTypeId(container.DataType) }); }
private static NetMessageSyncValue CreateSyncMessage(SyncedValueContainer container) { return(new NetMessageSyncValue() { ValueData = container.GetRawData() }); }
private void OnNetMessageReceived(NetMessageSyncValue syncMessage, INetworkInterfaceConnection arg2) { if (syncMessage.ValueData == null) { return; } // get value type Type type = NetMessageInterpreter.GetMessageType(syncMessage.ValueData); // find synced obj SyncedValueContainer container = SyncedValues.GetOrCreateContainer(type); // set data container.SetRawData(syncMessage.ValueData); container.RaiseChangeEventIfNecessary(); }
internal void OnValueDestroyedByUser(SyncedValueContainer container) { _sessionInterface.SendNetMessage(CreateDestroyMessage(container), _sessionInterface.Connections); }