private void RoomKFBZ(MsgGlobal msg) { Debug.Log("房卡不足"); //MemoryStream ms = new MemoryStream(msg.ReadBytes()); //MsgRoomInfo msg_data_head = Game.Serial.Deserialize(ms, null, typeof(MsgRoomInfo)) as MsgRoomInfo; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_FKBZ); }
public void Execute(MsgGlobal msg) { var callBackCode = msg.session.callbackCode; RefreshSession(msg.session); if (m_CallBacks.ContainsKey(callBackCode)) { Debug.Log("========================Execute:" + callBackCode); try { m_CallBacks[callBackCode](msg); } catch (Exception what) { //这边应该添加 向服务器发送数据 Debug.LogError(what.StackTrace); Debug.LogError(what.Message); Debug.LogError("!!!!!!!!RecvMsg Execute:" + callBackCode); } } else { Debug.LogError("Msg Not Found Callback: " + callBackCode); } }
void RoomCardMode() { if (RoomInfo.Instance.IsZhuandanGameType || RoomInfo.Instance.IsGuandan2GameType) { //转蛋 Debug.Log(string.Format("打完第{0}局,总共,{1}局", PlayingGameInfo.Instance.mGameInfo.game_index, RoomInfo.Instance.mRoom.game_num)); if (!isTotalOver) { PlayingGameInfo.Instance.EnterNextBureauGame(); } else { MsgGlobal mG = new MsgGlobal(); Debug.Log("Send Total roomId:" + RoomInfo.Instance.mRoomId); mG.room_id = RoomInfo.Instance.mRoomId; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_TOTAL_GOAL, mG); } } else { Debug.Log("掼蛋非打二进入下一局"); //如果结束就不会有这个界面 if (isOver) { GameManager.Instance.BackToHomeModule(); } else { PlayingGameInfo.Instance.EnterNextBureauGame(); } } }
//void RecevEnterGoldNotEnough(MsgGlobal msg) //{ // Debug.Log("金币不够使用道具"); // UIManagers.Instance.EnqueueTip("金币不足"); // NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGoldNotEnough); //} void RecevGoldEnterSuc(MsgGlobal msg) { Debug.Log("RecevEnterSuc"); //思想:Module层控制数据,View层纯显示 GameManager.Instance.ClearCurGame(); MsgGuandanRoom data = msg.guandan_room; if (data.gold_ready_player != null) { var playerReadyList = data.gold_ready_player.pid; if (playerReadyList != null) { GoldFiledManager.Instance.UpdateReadyPlayer(playerReadyList); } } if (data.gold_playground.type == (uint)EJoinRoomType.EEnter) { UIManagers.Instance.EnqueueTip("加入房间成功"); } else { UIManagers.Instance.EnqueueTip("加入房间成功"); } GoldFiledManager.Instance.UpdateGoldPlayerGroundData(msg.guandan_room.gold_playground); RoomInfo.Instance.GetRoomInfo(data.room_info); PlayerInfo.Instance.mPlayerData.roomCode = data.room_info.roomCode; RoomInfo.Instance.UpdatePlayersDic(data.player_info); NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ERoomJoin_Suc); }
void RoomJoinFAIL(MsgGlobal msg) { ArgsJoinRoomReason args = new ArgsJoinRoomReason(); args.reason = EJoinRoomFailReason.ERSYM; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args); }
void RecevTonghuanshun(MsgGlobal msg) { MsgCardTip data = msg.card_tip; SelfCardsManager.Instance.mTonghuashunTipList = data.cardGroup; Debug.Log("同花顺数量:" + SelfCardsManager.Instance.mTonghuashunTipList.Count); SelfCardsManager.Instance.PostTonghuashunToCards(); }
void RecevCardTypeChoose(MsgGlobal msg) { MsgAction data = msg.action; ArgsCanputOutCard args = new ArgsCanputOutCard(); args.msgCardGroup = data.cardGroup; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EChooseCardType, args); }
void RoomJoinFull(MsgGlobal msg) { Debug.Log("房间不存在"); ArgsJoinRoomReason args = new ArgsJoinRoomReason(); args.reason = EJoinRoomFailReason.EROOM_NULL; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args); }
public void SendMsgToServer(string key) { MsgGlobal msg = new MsgGlobal(); msg.session = new MsgSession(); SetSession(msg.session, key); SendByteToServer(Serial(msg)); Debug.Log("SendMsgTo Server :" + key); }
public void SendServerCardTip() { SelfCardsManager.Instance.mIsRecevCardTip = false; MsgGlobal mGl = new MsgGlobal(); mGl.guandan_room = new MsgGuandanRoom(); mGl.guandan_room.action = mMsgAction; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_CARD_TIP, mGl); }
void RecevSQDHZWSuc(MsgGlobal msg) { MsgChangeSeatInfo data = msg.change_seat_info; ArgsChangeSeatInfo args = new ArgsChangeSeatInfo(); args.applyId = data.apply_player_id; args.toId = data.to_player_id; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EApplyChangeSeat, args); }
void RoomCreaterOut(MsgGlobal msg) { if (!RoomInfo.Instance.IsCreater()) { UIManagers.Instance.EnqueueTip("房主解散房间"); } DismissRoom(); }
void RecevIpConfirm(MsgGlobal msg) { MsgIpConfirm data = msg.ip_confirm; ArgsIpConfirmPlayer args = new ArgsIpConfirmPlayer(); Debug.Log("IpConFirm" + args.playerId); args.playerId = (uint)data.player_id; args.mPlayerIds = data.pids; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EIpConfirmNotify, args); }
/// <summary> /// 解散房间请求 (战斗中) /// </summary> public void SendDissRoomApplyMsg() { MsgGlobal mGl = new MsgGlobal(); mGl.dis_room_info = new MsgDisRoomInfo(); MsgDisRoomInfo msg = mGl.dis_room_info; msg.voteTime = TimeUtils.ConvertDateTimeInt(System.DateTime.Now).ToString(); TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_DISS_ROOM, mGl); }
public void SendTalkServer(string voiceName, uint time) { MsgGlobal mGl = new MsgGlobal(); MsgGuandanRoom msg = mGl.guandan_room; msg.voiceName = voiceName; msg.msg_talk = new MsgTalk(); msg.msg_talk.time = time; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_TALK, mGl); }
public void SendMsgToServer(string key, MsgGlobal msgGlobal) { msgGlobal.session = new MsgSession(); SetSession(msgGlobal.session, key); Debug.Log("SendMsgToServer.session:" + msgGlobal.session); Debug.Log("msgGlobal:" + msgGlobal); SendByteToServer(Serial(msgGlobal)); Debug.Log("SendMsgTo Server :" + key); }
public void SendJoinRoomServer(int roomCode) { MsgGlobal mGl = new MsgGlobal(); mGl.room_info = new MsgRoomInfo(); MsgRoomInfo msg = mGl.room_info; msg.roomCode = (uint)roomCode; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_ENTER_ROOM, mGl); }
/// <summary> /// 发起回贡 /// </summary> public void SendBackTribute(uint cardId) { MsgGlobal mGl = new MsgGlobal(); mGl.tribute_info = new MsgTributeInfo(); MsgTributeInfo msg = mGl.tribute_info; msg.hgpz_card = cardId; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_BACK_TRIBUTE, mGl); }
void RecevRoomRefuse(MsgGlobal msg) { uint pid = (uint)msg.actionId; Debug.Log("RecevRoomApply :" + ">>>pid:" + pid); ArgsDismissRoomApplyResult args = new ArgsDismissRoomApplyResult(); args.playerId = pid; args.isAgree = false; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESingleDissRoomApplyResult, args); }
private void RoomCreateSuccess(MsgGlobal msg) { RoomInfo.Instance.mRoomId = msg.room_id; SDKManager.Instance.shareRoomCode = PlayerInfo.Instance.mPlayerData.roomCode; Debug.Log("开房成功"); MsgRoomInfo data = msg.room_info; Debug.Log("RoomCode: " + RoomInfo.Instance.mRoomCode.ToString()); RoomInfo.Instance.GetRoomInfo(data); NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_KF_SUC); }
/// <summary> /// 回答是否换座位 /// </summary> /// <param name="toPlayerId"></param> public void SendAgreeChangeSeat(ulong applyId, uint result) { MsgGlobal mGl = new MsgGlobal(); mGl.change_seat_info = new MsgChangeSeatInfo(); MsgChangeSeatInfo msg = mGl.change_seat_info; msg.apply_player_id = applyId; msg.to_player_id = PlayerInfo.Instance.mPlayerPid; msg.apply_result = result; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_AGREE_CHANGE_SEAT, mGl); }
void RecevRoomApply(MsgGlobal msg) { MsgDisRoomInfo data = msg.dis_room_info; ulong pid = data.voteFirst; //(uint)msg.ReadUInt64(); //发起投票人 Debug.Log("RecevRoomApply :" + ">>>pid:" + pid); ArgsDissmissRoomApplyer args = new ArgsDissmissRoomApplyer(); args.playerId = (uint)pid; args.voteTime = data.voteTime; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EDissmisRoomApply, args); }
public void SendExchangeRoomServer() { MsgGlobal mGl = new MsgGlobal(); mGl.gold_playground = new MsgGoldPlayground(); MsgGoldPlayground msg = mGl.gold_playground; msg.gold_playground_type = curGroundType; msg.cost = curGroundCost; msg.min = curGroundMinScore; msg.type = (uint)EJoinRoomType.EExchange; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_GOLD_EXCHANGE_ROOM, mGl); }
/// <summary> /// 要不起 /// </summary> public void SendRefusePutOutCard() { ClearAllSelectCards(); //清空所有被选中的打出的牌 MsgGlobal mGl = new MsgGlobal(); mGl.guandan_room = new MsgGuandanRoom(); mGl.guandan_room.action = new MsgAction(); MsgAction msg = mGl.guandan_room.action; msg.action_id = (ulong)PlayerInfo.Instance.mPlayerPid; msg.action_ct = TGuanDanCT.CT_BUCHU; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_SHOW_CARD, mGl); }
//消息的发送等 void RequestEmticonInfo(MsgEmoticon em = 0, string message = "") { MsgGlobal gl = new MsgGlobal(); gl.emotion_info = new MsgEmotionInfo(); var msg = gl.emotion_info; msg.action_id = PlayerInfo.Instance.mPlayerPid; msg.emoticonId = em; msg.message = message; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_USE_EMOTICON, gl); OnCloseClick(null); }
void RecevDHZWFail(MsgGlobal msg) { MsgChangeSeatInfo data = msg.change_seat_info; string str = string.Format("applyId:{0},toId:{1}", data.apply_player_id, data.to_player_id); Debug.Log(str); ArgsChangeSeatInfo args = new ArgsChangeSeatInfo(); args.applyId = data.apply_player_id; args.toId = data.to_player_id; args.result = 1; NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EAgreeChangeSeat, args); }
public void ReSendEnterGoldFiledServer() { MsgGlobal mGl = new MsgGlobal(); mGl.gold_playground = new MsgGoldPlayground(); MsgGoldPlayground msg = mGl.gold_playground; msg.gold_playground_type = (TGoldPlaygroundType)curGroundType; msg.cost = curGroundCost; msg.min = curGroundMinScore; msg.type = (uint)EJoinRoomType.EEnter; TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_ENTER_GOLD_FILED, mGl); }
public void SendServerSortCard() { MsgGlobal mGl = new MsgGlobal(); mGl.action = new MsgAction(); MsgAction msg = mGl.action; for (int i = 0; i < mCurSelectCardIds.Count; i++) { msg.action_card.Add(mCurSelectCardIds[i]); } TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_SORT_CARD, mGl); }
/// <summary> /// 进贡成功回调 /// </summary> /// <param name="msg"></param> void RecevTributeSuc(MsgGlobal msg) { //进贡id为自己的情况,自己牌,清空,并出发出动画到被进贡玩家,被进贡玩家牌+1 MsgTributeInfo data = msg.tribute_info; ArgsTribute args = new ArgsTribute(); args.addId = data.bjg_player_id[0]; args.removeId = data.jg_player_id[0]; args.card = data.jgpz_card[0]; args.isJingong = true; args.isStart = false; Debug.Log("进贡回调:" + "进贡id" + args.addId + "回贡id" + args.removeId + "牌值:" + args.card + "isjingong" + args.isJingong); NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETributeSuc, args); }
/// <summary> /// 回贡成功回调 /// </summary> /// <param name="msg"></param> void RecevBackTributeSuc(MsgGlobal msg) { //回贡成功后,正式开始游戏 MsgTributeInfo data = msg.tribute_info; ArgsTribute args = new ArgsTribute(); args.addId = data.jg_player_id[0]; args.removeId = data.bjg_player_id[0]; args.card = data.hgpz_card; args.isJingong = false; args.isStart = data.start_tag == 1; Debug.Log("回贡回调:" + "回贡id" + args.removeId + "被回贡id" + args.addId + "牌值:" + args.card + "isjingong" + args.isJingong); Debug.Log("start_tag:" + data.start_tag); NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETributeSuc, args); }