public void Activate(ReplicatedObject replicatedObject) { _buffer.Reset(); replicatedObject.ReplicationConstructor.SerializeInitialState(_buffer); _store.DispatchMessages(ConnectionId.NoConnection, replicatedObject.Id, _buffer, _buffer.LengthBytes); replicatedObject.Activate(); }
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(); }); }