예제 #1
0
 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);
     }
 }
예제 #2
0
 protected override void TearDown()
 {
     LBLogger.Info("MyApplication", "游戏服务器关闭");
     mHeartbeatFiber.Dispose();
     mHeartbeatFiber = null;
 }
예제 #3
0
 protected override void OnMessage(object message, SendParameters sendParameters)
 {
     LBLogger.Info(LogTag, "连接  OnMessage");
     base.OnMessage(message, sendParameters);
 }
예제 #4
0
 protected override void OnDisconnect(DisconnectReason reasonCode, string reasonDetail)
 {
     LBLogger.Info(LogTag, "连接  关闭 " + ConnectionId.ToString());
     LBPeerManager.Instance.RemovePeer(ConnectionId);
 }
예제 #5
0
 public MyPeer(InitRequest initRequest) : base(initRequest)
 {
     LBLogger.Info(LogTag, "游戏服务器创建连接  " + ConnectionId.ToString());
     LBPeerManager.Instance.AddPeer(ConnectionId, this);
 }