コード例 #1
0
 public NetworkCommandReceiver(SequenceIndex sequenceIndex,
                               INetworkManager networkManager,
                               INetworkMessageHandler networkMessageHandler,
                               INetworkMessageSerializer messageSerializer, ICommandQueue commandQueue)
 {
     _sequenceIndex         = sequenceIndex;
     _networkManager        = networkManager;
     _networkMessageHandler = networkMessageHandler;
     _messageSerializer     = messageSerializer;
     _commandQueue          = commandQueue;
 }
コード例 #2
0
 public HallServerNetwork(RoomEventDispatcher dispatcher)
 {
     _stopwatch               = Stopwatch.StartNew();
     _defaultSerializer       = _rpcMgr.GetRpcMessageSerializer();
     _dispatcher              = dispatcher;
     _dispatcher.Intercept   += InterceptRoomEvent;
     _dispatcher.OnRoomEvent += OnRoomEvent;
     _client = _clientFactory.CreateTcpNetworkClient(SharedConfig.IsLittleEndian, SharedConfig.MutilThread, "Allocation");
     _client.ChannelConnected    += ClientOnChannelConnected;
     _client.ChannelDisconnected += ClientOnChannelDisConnected;
     RegisterCommand();
 }
コード例 #3
0
        public NetworkCommandBroadcaster(SequenceIndex sequenceIndex,
                                         ICommandQueue commandQueue,
                                         INetworkManager networkManager,
                                         INetworkMessageHandler networkMessageHandler,
                                         INetworkMessageSerializer networkMessageSerializer)
        {
            _sequenceIndex            = sequenceIndex;
            _networkManager           = networkManager;
            _networkMessageHandler    = networkMessageHandler;
            _networkMessageSerializer = networkMessageSerializer;

            _disposable = networkManager.ClientConnected.Subscribe(Observer.Create <int>(HandleClientConnected));
            commandQueue.AddListener(this);
        }