Beispiel #1
0
 /// <summary>
 /// 本地消息发送回调处理
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="channel"></param>
 /// <param name="type"></param>
 /// <param name="tbuff"></param>
 public void SendBuff <T>(int channel, int type, T tbuff)
 {
     if (channel.GetHashCode() == MsgNoC2S.REQUEST_JOINROOM_C2S.GetHashCode())
     {
         StartCoroutine(ClientAIMgr.Instance.ClientJoinRoom());
     }
     else if (channel.GetHashCode() == MsgNoC2S.DISLOVEAPPLY_C2S.GetHashCode())
     {
         var loadInfo = new LoadSceneInfo(ESceneID.SCENE_HALL, LoadSceneType.ASYNC, LoadSceneMode.Additive);
         ApplicationFacade.Instance.SendNotification(NotificationConstant.MEDI_GAMEMGR_LOADSCENE, loadInfo);
     }
     else if (channel.GetHashCode() == MsgNoC2S.READY_C2S.GetHashCode())
     {
         curSit   = 1;
         cardPool = new List <int>(GlobalData.CardWare);
         GameMgr.Instance.StartCoroutine(ClientReady());
     }
     else if (channel.GetHashCode() == MsgNoC2S.PLAYAMAHJONG_C2S.GetHashCode())
     {
         var putCard = tbuff as PlayAMahjongC2S;
         GameMgr.Instance.StartCoroutine(ClientPlayAct(putCard.mahjongCode, playerInfoProxy.UserInfo.UserID,
                                                       PlayerActType.PUT_CARD));
     }
     else if (channel.GetHashCode() == MsgNoC2S.EXIT_C2S.GetHashCode())
     {
         var exitS2C = new ExitRoomS2C();
         exitS2C.clientCode = ErrorCode.SUCCESS;
         exitS2C.userId     = 9527;
         NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.EXIT_S2C.GetHashCode(), 0, exitS2C);
     }
     else if (channel.GetHashCode() == MsgNoC2S.DISSOLUTION_C2S.GetHashCode())
     {
         var disloveS2C = new DissolveRoomS2C();
         disloveS2C.clientCode = ErrorCode.SUCCESS;
         NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.DISSOLUTION_S2C.GetHashCode(), 0, disloveS2C);
     }
     else if (channel.GetHashCode() == MsgNoC2S.ZIMOHU_C2S.GetHashCode())
     {
         StartCoroutine(HuHandler());
     }
     else if (channel.GetHashCode() == MsgNoC2S.PENG_C2S.GetHashCode())
     {
         StartCoroutine(PengHandler());
     }
     else if (channel.GetHashCode() == MsgNoC2S.SEND_CHAT_C2S.GetHashCode())
     {
         SendChatHandler(tbuff as SendChatC2S);
     }
     else if (channel.GetHashCode() == MsgNoC2S.SEND_VOICE_C2S.GetHashCode())
     {
         SendVoiceHandler(tbuff as SendVoiceC2S);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 本地消息发送回调处理
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="channel"></param>
 /// <param name="type"></param>
 /// <param name="tbuff"></param>
 public void SendBuff <T>(int channel, int type, T tbuff)
 {
     if (channel.GetHashCode() == MsgNoC2S.C2S_Hall_JOIN_IN_ROOM.GetHashCode())
     {
         StartCoroutine(ClientAIMgr.Instance.ClientJoinRoom());
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_APPLY_DISSOLVE.GetHashCode())
     {
         var loadInfo = new LoadSceneInfo(ESceneID.SCENE_HALL, LoadSceneType.ASYNC, LoadSceneMode.Additive);
         ApplicationFacade.Instance.SendNotification(NotificationConstant.MEDI_GAMEMGR_LOADSCENE, loadInfo);
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_READY.GetHashCode())
     {
         curSit   = 1;
         cardPool = new List <int>(GlobalData.CardWare);
         GameMgr.Instance.StartCoroutine(ClientReady());
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_PLAY_A_MAHJONG.GetHashCode())
     {
         var putCard = tbuff as PlayAMahjongC2S;
         GameMgr.Instance.StartCoroutine(ClientPlayAct(putCard.mahjongCode, playerInfoProxy.userID,
                                                       PlayerActType.PUT_CARD));
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_EXIT.GetHashCode())
     {
         var exitS2C = new ExitRoomS2C();
         exitS2C.clientCode = ErrorCode.SUCCESS;
         exitS2C.userId     = 9527;
         NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.S2C_ROOM_EXIT_BROADCAST.GetHashCode(), 0, exitS2C);
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_DISSOLVE.GetHashCode())
     {
         var disloveS2C = new DissolveRoomS2C();
         disloveS2C.clientCode = ErrorCode.SUCCESS;
         NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.S2C_ROOM_DISSOLVE_BROADCAST.GetHashCode(), 0, disloveS2C);
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_ZI_MO_HU.GetHashCode())
     {
         StartCoroutine(HuHandler());
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_TEXT_CHAT.GetHashCode())
     {
         SendChatHandler(tbuff as SendChatC2S);
     }
     else if (channel.GetHashCode() == MsgNoC2S.C2S_ROOM_VOICE_CHAT.GetHashCode())
     {
         SendVoiceHandler(tbuff as SendVoiceC2S);
     }
 }