Пример #1
0
        public ReplicatedObject CreateReplicatedInstance(
            ObjectType type,
            ObjectRole role,
            ConnectionId connectionId)
        {
            var objectId = RequestObjectId();

            return(_store.AddReplicatedInstance(type, role, objectId, connectionId));
        }
Пример #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();
     });
 }