protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { System.Action <MyPeer, OperationRequest> invokeAction; if (mPeerHandlerDic.TryGetValue(operationRequest.OperationCode, out invokeAction)) { LBLogger.Info(LogTag, "OnOperationRequest " + ((RqId)operationRequest.OperationCode).ToString()); invokeAction.Invoke(this, operationRequest); } else { LBLogger.Error(LogTag, "消息处理没有注册 " + operationRequest.OperationCode); } }
protected override void TearDown() { LBLogger.Info("MyApplication", "游戏服务器关闭"); mHeartbeatFiber.Dispose(); mHeartbeatFiber = null; }
protected override void OnMessage(object message, SendParameters sendParameters) { LBLogger.Info(LogTag, "连接 OnMessage"); base.OnMessage(message, sendParameters); }
protected override void OnDisconnect(DisconnectReason reasonCode, string reasonDetail) { LBLogger.Info(LogTag, "连接 关闭 " + ConnectionId.ToString()); LBPeerManager.Instance.RemovePeer(ConnectionId); }
public MyPeer(InitRequest initRequest) : base(initRequest) { LBLogger.Info(LogTag, "游戏服务器创建连接 " + ConnectionId.ToString()); LBPeerManager.Instance.AddPeer(ConnectionId, this); }