예제 #1
0
 private static NetMessageDestroyValue CreateDestroyMessage(SyncedValueContainer container)
 {
     return(new NetMessageDestroyValue()
     {
         TypeId = NetSerializer.GetTypeId(container.DataType)
     });
 }
예제 #2
0
 private static NetMessageSyncValue CreateSyncMessage(SyncedValueContainer container)
 {
     return(new NetMessageSyncValue()
     {
         ValueData = container.GetRawData()
     });
 }
예제 #3
0
            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();
            }
예제 #4
0
 internal void OnValueDestroyedByUser(SyncedValueContainer container)
 {
     _sessionInterface.SendNetMessage(CreateDestroyMessage(container), _sessionInterface.Connections);
 }