示例#1
0
 /// <summary>
 /// 移除监听事件
 /// </summary>
 public override void RemoveListener()
 {
     HandlerMediat.RemoveAllListener(OperationCode.Login);
     HandlerMediat.RemoveAllListener(OperationCode.Register);
 }
示例#2
0
 /// <summary>
 /// 注册监听事件
 /// </summary>
 public override void AddListener()
 {
     HandlerMediat.AddListener(OperationCode.Login, OnLoginReceived);
     HandlerMediat.AddListener(OperationCode.Register, OnRegisterReceived);
 }
示例#3
0
        //当我们在客户端向服务器端发起请求后,服务器端接受处理这个请求给客户端一个响应就会在这个方法里进行处理
        public void OnOperationResponse(OperationResponse operationResponse)
        {
            MessageCode code = (MessageCode)operationResponse.OperationCode;//得到响应的OperationCode

            HandlerMediat.Dispatch(code, operationResponse);
        }
示例#4
0
 public override void RemoveListener()
 {
     HandlerMediat.RemoveListener(OperationCode.SyncPlayer, OnSyncPlayerReceived);
 }
示例#5
0
 public override void RemoveListener()
 {
     HandlerMediat.RemoveListener(MessageCode.AddPlayer, OnSyncAddPlayerReceived);
 }
示例#6
0
 /// <summary>
 /// 移除监听事件
 /// </summary>
 public override void RemoveListener()
 {
     HandlerMediat.RemoveAllListener(MessageCode.Login);
     HandlerMediat.RemoveAllListener(MessageCode.Register);
 }