public void Dispose() { if (_networkChannel != null) { _networkChannel.Disconnect(); ; } _networkClient.Dispose(); }
private void DisposeChannel(INetworkChannel channel) { if (channel != null) { channel.Dispose(); } if (channel != null) { channel.Disconnect(); channel.Dispose(); } }
private void NetworkChannelOnMessageReceived(INetworkChannel channel, int messageType, object messageBody) { if (messageType == (int)EClient2ServerMessage.Login) { LoginMessage message = (LoginMessage)messageBody; if (message == null) { _logger.InfoFormat("Illegal login message"); channel.Disconnect(); } else { _logger.InfoFormat("Received Log in Message ... token:{0} {1}", message.Token, message.LoginStage); var e = RoomEvent.AllocEvent <LoginServerEvent>(); e.Channel = channel; e.Message = message; _dispatcher.AddEvent(e); } } _networkMonitor.CheckStateOnReceivePlayerMessage(); }
public override void DoHandle(INetworkChannel channel, PlayerEntity entity, EClient2ServerMessage eClient2ServerMessage, GameOverMesssage messageBody) { _logger.InfoFormat("Server Recevie GameOver Message From Player {0}", entity.entityKey.Value); channel.Disconnect(); }