示例#1
0
 public static void InstallBasicClientHandlers(MessageRouter messageRouter, NetworkSystems networkSystems)
 {
     messageRouter
     .RegisterHandler(DefaultMessageHandlers.CreateObject(networkSystems.ObjectStore))
     .RegisterHandler(DefaultMessageHandlers.DeleteObject(networkSystems.ObjectStore))
     .RegisterHandler(DefaultMessageHandlers.ToObject(networkSystems.ObjectStore));
 }
示例#2
0
 public static void InstallBasicClientHandlers(MessageRouter messageRouter, NetworkSystems networkSystems, IDictionary <Guid, GameObject> preExistingObjects)
 {
     messageRouter
     .RegisterHandler(DefaultMessageHandlers.ReplicatePreExistingObject(networkSystems.ObjectStore, preExistingObjects))
     .RegisterHandler(DefaultMessageHandlers.CreateObject(networkSystems.ObjectMessageParser, networkSystems.ObjectStore))
     .RegisterHandler(DefaultMessageHandlers.DeleteObject(networkSystems.ObjectStore))
     .RegisterHandler(DefaultMessageHandlers.ToObject(networkSystems.ObjectMessageParser, networkSystems.ObjectStore));
 }
示例#3
0
        public static void InstallBasicServerHandlers(MessageRouter messageRouter,
                                                      IClock clock, IClock fixedClock, NetworkSystems networkSystems)
        {
            var messagePools  = networkSystems.MessagePool;
            var messageSender = networkSystems.MessageSender;

            messageRouter
            .RegisterHandler(DefaultMessageHandlers.Ping(clock, fixedClock, messagePools.GetPool <BasicMessage.Pong>(), messageSender))
            .RegisterHandler(DefaultMessageHandlers.ToObject(networkSystems.ObjectMessageParser, networkSystems.ObjectStore));
        }