public void UpdateApplyChangeSeat(LocalNotification e) { ArgsChangeSeatInfo args = e.param as ArgsChangeSeatInfo; //刷新倒计时 重置 if (RoomInfo.Instance.GetRealPlayerCount() == 3) { ResetStopGameTime(); } if (args != null) { string strInfo = ""; if (args.toId == PlayerInfo.Instance.mPlayerPid) //被要求换座位 { string applyName = RoomInfo.Instance.GetPlayerInfoById(args.applyId).name; strInfo = string.Format("{0}申请和你换座位", applyName); UIManagers.Instance.ShowConfirmBox( strInfo, "同意", "拒绝", () => RoomInfo.Instance.SendAgreeChangeSeat(args.applyId, 0) , () => RoomInfo.Instance.SendAgreeChangeSeat(args.applyId, 1)); } else { string applyName = RoomInfo.Instance.GetPlayerInfoById(args.applyId).name; string toName = RoomInfo.Instance.GetPlayerInfoById(args.toId).name; strInfo = string.Format("{0}申请和{1}换座位", applyName, toName); } UIManagers.Instance.EnqueueTip(strInfo); } }
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 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 UpdateAgreeChangeSeat(LocalNotification e) { var roomInfo = RoomInfo.Instance; ArgsChangeSeatInfo args = e.param as ArgsChangeSeatInfo; if (RoomInfo.Instance.GetRealPlayerCount() == 3) { ResetStartGameTime(); } if (args != null) { string strInfo = ""; if (args.result == 0) //同意 { string applyName = RoomInfo.Instance.GetPlayerInfoById(args.applyId).name; string toName = RoomInfo.Instance.GetPlayerInfoById(args.toId).name; strInfo = string.Format("{0}同意和{1}换座位", toName, applyName); var applyPos = roomInfo.GetPlayerPosById(args.applyId); var toPos = roomInfo.GetPlayerPosById(args.toId); CheckShowChangeSeatTween(applyPos, toPos); //换座位动画 RoomInfo.Instance.ChangeTwoPlayerInfo(applyPos, toPos); RefreshRoomPlayer(); } else { if (args.applyId == PlayerInfo.Instance.mPlayerPid) { string toName = RoomInfo.Instance.GetPlayerInfoById(args.toId).name; strInfo = string.Format("{0}拒绝和你换座位", toName); } else { string applyName = RoomInfo.Instance.GetPlayerInfoById(args.applyId).name; string toName = RoomInfo.Instance.GetPlayerInfoById(args.toId).name; strInfo = string.Format("{0}拒绝和{1}换座位", toName, applyName); } } UIManagers.Instance.EnqueueTip(strInfo); } }