コード例 #1
0
 public void Activate(ReplicatedObject replicatedObject)
 {
     _buffer.Reset();
     replicatedObject.ReplicationConstructor.SerializeInitialState(_buffer);
     _store.DispatchMessages(ConnectionId.NoConnection, replicatedObject.Id, _buffer, _buffer.LengthBytes);
     replicatedObject.Activate();
 }
コード例 #2
0
 public static Action <ConnectionId, IPEndPoint, BasicMessage.CreateObject, NetBuffer> CreateObject(
     ReplicatedObjectStore objectStore)
 {
     return((connectionId, endpoint, message, reader) => {
         var instance = objectStore.AddReplicatedInstance(message.ObjectType, message.ObjectRole,
                                                          message.ObjectId, connectionId);
         objectStore.DispatchMessages(connectionId,
                                      message.ObjectId,
                                      message.AdditionalData,
                                      message.AdditionalData.WriterPosition());
         instance.Activate();
     });
 }