public bool GetSystemMailItem(UInt32 MailID) { tagSystemMail pSystemMail = GetSystemMailContext(MailID); if (pSystemMail == null) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Mail_GetSystemMailItem_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (pSystemMail.RewardID == 0 || pSystemMail.RewardSum == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Mail_GetSystemMailItem_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (!pSystemMail.bIsExistsReward) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Mail_GetSystemMailItem_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } SendGetMailItem(MailID); return(true); }
public bool OnGetPhoneVerificationNum(UInt64 PhoneNum)//获取手机验证码 { //if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.MIN_PHONE_LENGTH, FishDataInfo.MAX_PHONE_LENGTH, PhoneNum, StringCheckType.SCT_Normal)) //{ // tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_GetPhoneVerificationNum_Failed_1); // MsgEventHandle.HandleMsg(pUOM); // return false; //} if (PlayerRole.Instance.EntityManager.GetRoleEntityInfo().Phone != 0 && PlayerRole.Instance.EntityManager.GetRoleEntityInfo().Phone != PhoneNum) { return(false); } if (!FishDataInfo.IsCanUsePhone(PhoneNum)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_GetPhoneVerificationNum_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_GetPhoneVerificationNum ncb = new CL_Cmd_GetPhoneVerificationNum(); ncb.SetCmdType(NetCmdType.CMD_CL_GetPhoneVerificationNum); ncb.PhoneNumber = PhoneNum; NetServices.Instance.Send <CL_Cmd_GetPhoneVerificationNum>(ncb); GlobalLogon.Instance.AccountData.SaveAccountData(); GlobalLogon.Instance.AccountData.TempPhoneInfo.PhoneNumber = PhoneNum; return(true); }
//bool HandleGetRoleActionInfoFinish(NetCmdBase obj) //{ // LC_Cmd_GetRoleActionInfoFinish ncb = (LC_Cmd_GetRoleActionInfoFinish)obj; // //CheckIsExistsFinishItem(); // return true; //} //bool HandleActionAllEventFinish(NetCmdBase obj) //{ // LC_Cmd_ActionAllEventFinish ncb = (LC_Cmd_ActionAllEventFinish)obj; // RoleActionBase pAction = GetAction(ncb.ActionID); // if (pAction == null) // { // SendGetActionInfoByServer(ncb.ActionID); // return true; // } // pAction.SetActionIsFinish(); // return true; //} bool HandleGetActionReward(NetCmdBase obj) { LC_Cmd_GetActionReward ncb = (LC_Cmd_GetActionReward)obj; RoleActionBase pBase = GetAction(ncb.ActionID); tagActionOnceRewardEvent pReward = null; if (pBase != null) { foreach (tagActionEventConfig var in pBase.pConfig.EventMap.Values) { if ((var.ID & pBase.pActionInfo.ActionStates) == 0) { //为完成的条件 pReward = new tagActionOnceRewardEvent(ncb.ActionID, var.ID, var.RewardID); break; } } } m_ActionMap.Remove(ncb.ActionID);//将任务移除掉 // CheckIsExistsFinishItem(); tagOnceActionChangeEvent pEvent = new tagOnceActionChangeEvent(ncb.ActionID); MsgEventHandle.HandleMsg(pEvent); if (pReward != null) { MsgEventHandle.HandleMsg(pReward); tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Action_GetReward_Sucess); MsgEventHandle.HandleMsg(pUOM); } return(true); }
bool HandleBindEmail(NetCmdBase obj) { LC_Cmd_BindEmail ncb = (LC_Cmd_BindEmail)obj; switch (ncb.ErrorID) { case (Byte)RoleOperateError.ROE_BindMail_Sucess: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_BindEmail_Sucess); MsgEventHandle.HandleMsg(pUOM); } break; case (Byte)RoleOperateError.ROE_BindMail_IsBeUse: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_BindEmail_Failed_2); MsgEventHandle.HandleMsg(pUOM); } break; case (Byte)RoleOperateError.ROE_BindPhone_MailError: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_BindEmail_Failed_3); MsgEventHandle.HandleMsg(pUOM); } break; } return(true); }
bool HandlePhonePay(NetCmdBase obj) { LC_Cmd_PhonePay ncb = (LC_Cmd_PhonePay)obj; //玩家充值话费的结果 switch (ncb.ErrorID) { case (Byte)RoleOperateError.ROE_PhonePay_Sucess: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_PhonePay_Sucess); MsgEventHandle.HandleMsg(pUOM); } break; case (Byte)RoleOperateError.ROE_PhonePay_System: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_PhonePay_Failed_1); MsgEventHandle.HandleMsg(pUOM); } break; case (Byte)RoleOperateError.ROE_PhonePay_HttpError: { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Operate_PhonePay_Failed_2); MsgEventHandle.HandleMsg(pUOM); } break; } return(true); }
bool HandleChestEnd(NetCmdBase obj) { LC_Cmd_ChestEnd ncb = (LC_Cmd_ChestEnd)obj; if (ActionChestInfo == null) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (ActionChestInfo.ChestOnlyID != ncb.ChestOnlyID) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } ActionChestInfo = null; tagChestEndEvent pEvent = new tagChestEndEvent(); MsgEventHandle.HandleMsg(pEvent); tagUserOperationEvent pUOM2 = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Sucess); MsgEventHandle.HandleMsg(pUOM2); return(true); }
public bool SendMessaggChar(UInt32 DestUserID, string MessageInfo) { //发送聊天数据到指定玩家去 if (!PlayerRole.Instance.RelationManager.IsExitesRelation(DestUserID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_RoleChar_SendChar_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(1, FishDataInfo.MAX_ROLECHAR_LENGTH, MessageInfo, StringCheckType.SCT_Normal)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_RoleChar_SendChar_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_SendCharInfo ncb = new CL_Cmd_SendCharInfo(); ncb.SetCmdType(NetCmdType.CMD_CL_SendCharInfo); ncb.MessageInfo = new tagRoleCharInfo(); ncb.MessageInfo.SrcUserID = PlayerRole.Instance.RoleInfo.RoleMe.GetUserID(); ncb.MessageInfo.DestUserID = DestUserID; ncb.MessageInfo.MessageInfo = MessageInfo; NetServices.Instance.Send <CL_Cmd_SendCharInfo>(ncb); return(true); }
private bool SendCloseActionChest()//发送关闭当前宝箱的操作 { if (ActionChestInfo == null) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } tagChestInfo pActionChest = ActionChestInfo; if (pActionChest.ActionTime == 0 || pActionChest.ChestTypeID == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (!FishConfig.Instance.m_ChestInfo.ChestMap.ContainsKey(pActionChest.ChestTypeID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Chest_CloseChest_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } //关闭当前激活的宝箱 CL_Cmd_CloseChest ncb = new CL_Cmd_CloseChest(); ncb.SetCmdType(NetCmdType.CMD_CL_CloseChest); ncb.ChestOnlyID = pActionChest.ChestOnlyID; NetServices.Instance.Send <CL_Cmd_CloseChest>(ncb); return(true); }
private bool SendGetTaskReward(Byte TaskID) { //判断任务是否完成了 RoleTaskBase pTask = GetTask(TaskID); if (pTask == null) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Task_GetReward_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (!pTask.m_TaskEventIsFinish) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Task_GetReward_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_GetTaskReward ncb = new CL_Cmd_GetTaskReward(); ncb.SetCmdType(NetCmdType.CMD_CL_GetTaskReward); ncb.TaskID = TaskID; NetServices.Instance.Send <CL_Cmd_GetTaskReward>(ncb); return(true); }
public bool GetRoleMonthCardReward() //获取玩家月卡的奖励 { //1.判断玩家是否为月卡用户 if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthCardID() == 0 || SystemTime.Instance.GetSystemDateTime > PlayerRole.Instance.RoleInfo.RoleMe.GetMonthCardEndTime()) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_MonthCardReward_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } UInt32 WriteSec = FishConfig.Instance.GetWriteSec(); DateTime LogTime = PlayerRole.Instance.RoleInfo.RoleMe.GetMonthCardRewardTime().AddSeconds(WriteSec * -1); //领取奖励的时间 DateTime time = SystemTime.Instance.GetSystemDateTime.AddSeconds(WriteSec * -1); //系统时间 if (time.Year == LogTime.Year && time.Month == LogTime.Month && time.Day == LogTime.Day) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_MonthCardReward_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false);//今天已经领取过了 } CL_Cmd_GetMonthCardReward ncb = new CL_Cmd_GetMonthCardReward(); ncb.SetCmdType(NetCmdType.CMD_CL_GetMonthCardReward); NetServices.Instance.Send <CL_Cmd_GetMonthCardReward>(ncb); return(true); }
private bool HandleGetUserSystemMail(NetCmdBase obj) { LC_Cmd_GetSystemMail ncb = (LC_Cmd_GetSystemMail)obj; if (SystemMailMap.ContainsKey(ncb.MailInfo.MailID)) { SystemMailMap.Remove(ncb.MailInfo.MailID); } SystemMailMap.Add(ncb.MailInfo.MailID, ncb.MailInfo); for (byte i = 0; i < SystemMailTitleList.Count; ++i) { if (SystemMailTitleList[i].MailID == ncb.MailInfo.MailID) { SystemMailTitleList[i].bIsRead = true; //FriendSysManager.Instance.UpdateEmailReadState(ncb.MailInfo.MailID); } } //CheckMailStates(); tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent(); MsgEventHandle.HandleMsg(pEvent); tagMailContextAddEvent pContextEvent = new tagMailContextAddEvent(ncb.MailInfo.MailID); MsgEventHandle.HandleMsg(pContextEvent); //FriendSysManager.Instance.ReciveReadEmailMsg((byte)EmailType.Sys_Email, ncb.MailInfo.MailID, true); tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Mail_GetSystemContext_Sucess); MsgEventHandle.HandleMsg(pUOM); return(true); }
public bool GetLotteryReward(Byte LotteryID) { //获取抽奖的奖励 获取指定抽奖的奖励 if (!FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey(LotteryID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() < FishConfig.Instance.m_LotteryConfig.MaxLotteryFishSum) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } UInt32 LotteryScore = PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryScore(); if (LotteryScore < FishConfig.Instance.m_LotteryConfig.LotteryMap[LotteryID].NeedUseScore) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } //发送命令 CL_Cmd_GetLotteryReward ncb = new CL_Cmd_GetLotteryReward(); ncb.SetCmdType(NetCmdType.CMD_CL_GetLotteryReward); ncb.LotteryID = LotteryID; NetServices.Instance.Send <CL_Cmd_GetLotteryReward>(ncb); return(true); }
public bool IsCanGetReward(Byte ID)//判断奖励是否可以领取 { if (ID < 1 || ID > 32) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_OnlineReward_GetReward_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } tagOnceOnlienReward pReward = null; if (!FishConfig.Instance.m_OnlineRewardConfig.m_OnlineRewardMap.TryGetValue(ID, out pReward)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_OnlineReward_GetReward_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (PlayerRole.Instance.RoleInfo.RoleMe.GetOnlineMin() < pReward.OnlineMin) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_OnlineReward_GetReward_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } if (((PlayerRole.Instance.RoleInfo.RoleMe.GetOnlineRewardStates() & (1 << (ID - 1))) == 1 ? true : false)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_OnlineReward_GetReward_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } return(true); }
public bool OnHandleRoleLeaveVipSeat(NetCmdBase obj) { LC_Cmd_CarRoleLeaveVipSeat ncb = (LC_Cmd_CarRoleLeaveVipSeat)obj; for (Byte i = 0; i < FishDataInfo.MAX_Car_VipSeat; ++i) { if (TableVipSeatInfo.List[i] != null && TableVipSeatInfo.List[i].dwUserID == ncb.dwDestUserID) { TableVipSeatInfo.List[i].dwUserID = 0; TableVipSeatInfo.List[i].GlobelSum = 0; TableVipSeatInfo.List[i].NickName = ""; TableVipSeatInfo.List[i].dwFaceID = 0; if (ncb.dwDestUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID()) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_LeaveVip_Sucess); MsgEventHandle.HandleMsg(pUOM); } tagCarVipSeatChangeEvent pEvent = new tagCarVipSeatChangeEvent(true, TableVipSeatInfo); MsgEventHandle.HandleMsg(pEvent); return(true); } } return(true); }
private bool SendAddUserRelation(UInt32 dwDestRoleID, Byte RelationType) { if (PlayerRole.Instance.RoleInfo.RoleMe.GetUserID() == dwDestRoleID) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Relation_AddRelation_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if ((FriendMap.ContainsKey(dwDestRoleID) && FriendMap[dwDestRoleID].GetRelationType() == RelationType) || BlackListMap.ContainsKey(dwDestRoleID) && BlackListMap[dwDestRoleID].GetRelationType() == RelationType) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Relation_AddRelation_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (FriendMap.Count + BlackListMap.Count >= FishConfig.Instance.m_RelationInfo.MaxRelationSum && !FriendMap.ContainsKey(dwDestRoleID) && !BlackListMap.ContainsKey(dwDestRoleID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Relation_AddRelation_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_AddUserRelation ncb = new CL_Cmd_AddUserRelation(); ncb.SetCmdType(NetCmdType.CMD_CL_AddUserRelation); ncb.dwDestRoleID = dwDestRoleID; ncb.bRelationType = RelationType; NetServices.Instance.Send <CL_Cmd_AddUserRelation>(ncb); return(true); }
public bool OnRoleLeaveVipSeat() { bool IsInVipSeat = false; //玩家从VIP席位移动到 普通席位 for (Byte i = 0; i < FishDataInfo.MAX_Car_VipSeat; ++i) { if (TableVipSeatInfo.List[i] != null && TableVipSeatInfo.List[i].dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID()) { IsInVipSeat = true; break; } } if (!IsInVipSeat) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_LeaveVip_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_CarRoleLeaveVipSeat ncb = new CL_Cmd_CarRoleLeaveVipSeat(); ncb.SetCmdType(NetCmdType.CMD_LC_CarRoleLeaveVipSeat); NetServices.Instance.Send <CL_Cmd_CarRoleLeaveVipSeat>(ncb); return(true); }
public bool OnHandleAddGlobel(NetCmdBase obj) { LC_Cmd_CarRoleBetGlobel ncb = (LC_Cmd_CarRoleBetGlobel)obj; if (ncb.Result) { TableUpdateInfo.GlobelNum[ncb.Index] += ncb.AddGlobel; TableGlobelSum[ncb.Index] += ncb.AddGlobel; tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_AddGlobel_Sucess); MsgEventHandle.HandleMsg(pUOM); } else { if (TableBankerUserInfo.UserInfo.dwUserID == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_AddGlobel_Failed_3); MsgEventHandle.HandleMsg(pUOM); } else { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_AddGlobel_Failed_4); MsgEventHandle.HandleMsg(pUOM); } } tagCarAddGlobel pEvent = new tagCarAddGlobel(TableStates, TableUpdateInfo, ncb.Result); MsgEventHandle.HandleMsg(pEvent); return(true); }
public bool SendGetRankReward(Byte RankID) { //获取指定的排行榜的奖励 //判断指定排行榜是否存在 if (!FishConfig.Instance.m_RankInfo.m_RankMap.ContainsKey(RankID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Rank_GetWeekReward_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } //玩家是否上榜 if (!WeekRandIndex.ContainsKey(RankID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Rank_GetWeekReward_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (WeekRandIndex[RankID].IsReward) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Rank_GetWeekReward_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_GetRankReward ncb = new CL_Cmd_GetRankReward(); ncb.SetCmdType(NetCmdType.CMD_CL_GetRankReward); ncb.RankID = RankID; NetServices.Instance.Send <CL_Cmd_GetRankReward>(ncb); return(true); }
//玩家抢庄 public bool OnRoleGetWriteBankerFirstSeat() { //玩家抢庄 if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_MiNiGameConfig.carConfig.GetNextBankerNeedGlobel) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_NextBankerSeat_Failed_2, FishConfig.Instance.m_MiNiGameConfig.carConfig.GetNextBankerNeedGlobel.ToString()); MsgEventHandle.HandleMsg(pUOM); return(false); } if (TableWriteBankerList.MySeatIndex == 0xffffffff) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_NextBankerSeat_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (TableWriteBankerList.List[0].dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID()) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Car_NextBankerSeat_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_CarRoleGetBankerFirstSeat ncb = new CL_Cmd_CarRoleGetBankerFirstSeat(); ncb.SetCmdType(NetCmdType.CMD_CL_CarRoleGetBankerFirstSeat); NetServices.Instance.Send <CL_Cmd_CarRoleGetBankerFirstSeat>(ncb); return(true); }
//public bool ChangeUserFaceID(UInt16 PicSize) //{ // return SendRequestUserFaceID(PicSize); //} //public bool UpperLoadPicChunk(UInt16 StarIndex,UInt16 Size,Byte[] pArray) //{ // return SendUserFacePicChunk(StarIndex, Size, pArray); //} //玩家属性改变 private bool SendChangeRoleGender(bool bGender) { //玩家修改性别 if (m_RoleInfo.GetGender() == bGender) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_Gender_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } //判断物品是否足够 UInt32 ItemID = FishConfig.Instance.m_SystemConfig.ChangeGenderNeedItemID; UInt32 ItemSum = FishConfig.Instance.m_SystemConfig.ChangeGenderNeedItemSum; if (ItemID != 0 && ItemSum > 0 && PlayerRole.Instance.ItemManager.GetItemSum(ItemID) < ItemSum) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_Gender_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_ChangeRoleGender ncb = new CL_Cmd_ChangeRoleGender(); ncb.SetCmdType(NetCmdType.CMD_CL_ChangeRoleGender); ncb.bGender = bGender; NetServices.Instance.Send <CL_Cmd_ChangeRoleGender>(ncb); return(true); }
//private void SendGetMonthSigupRoleSum() //{ // CL_Cmd_GetMonthRoleSum ncb = new CL_Cmd_GetMonthRoleSum(); // ncb.SetCmdType(NetCmdType.CMD_CL_GetMonthRoleSum); // NetServices.Instance.Send<CL_Cmd_GetMonthRoleSum>(ncb); //} private bool SendRoleAddMonthGlobel() { if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Month_AddMonthGlobel_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } //玩家进行比赛的续币操作 if (!FishConfig.Instance.m_MatchInfo.m_MonthMap[PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()].m_ConvertMap.ContainsKey((Byte)(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthAddGlobelNum() + 1))) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Month_AddMonthGlobel_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } //判断玩家金币是否足够 if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_MatchInfo.m_MonthMap[PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()].m_ConvertMap[(Byte)(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthAddGlobelNum() + 1)].LostGlobel) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Month_AddMonthGlobel_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_ChangeUserAddMonthGlobelNum ncb = new CL_Cmd_ChangeUserAddMonthGlobelNum(); ncb.SetCmdType(NetCmdType.CMD_CL_ChangeUserAddMonthGlobelNum); NetServices.Instance.Send <CL_Cmd_ChangeUserAddMonthGlobelNum>(ncb); return(true); }
private bool SendAddTargetUserCharm(UInt32 dwDestUserID, Byte CharmIndex, UInt32 ItemSum) { //给目标添加魅力 使用指定物品 if (dwDestUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID()) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Charm_SendCharm_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (!FishConfig.Instance.m_CharmInfo.CharmIndexMap.ContainsKey(CharmIndex)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Charm_SendCharm_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if ((PlayerRole.Instance.ItemManager.GetItemSum(FishConfig.Instance.m_CharmInfo.CharmIndexMap[CharmIndex].ItemID, false) < FishConfig.Instance.m_CharmInfo.CharmIndexMap[CharmIndex].ItemSum * ItemSum) && (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[CharmIndex].UserGlobel * ItemSum || PlayerRole.Instance.RoleInfo.RoleMe.GetMedal() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[CharmIndex].UserMedal * ItemSum || PlayerRole.Instance.RoleInfo.RoleMe.GetCurrency() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[CharmIndex].UserCurrcey * ItemSum)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Charm_SendCharm_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_ChangeOtherUserCharm ncb = new CL_Cmd_ChangeOtherUserCharm(); ncb.SetCmdType(NetCmdType.CMD_CL_ChangeOtherUserCharm); ncb.CharmIndex = CharmIndex; ncb.dwDestUserID = dwDestUserID; ncb.ItemSum = ItemSum; NetServices.Instance.Send <CL_Cmd_ChangeOtherUserCharm>(ncb); return(true); }
bool HandleChangeRoleSecondPassword(NetCmdBase obj) { //玩家修改二级密码的结果 LC_Cmd_ChangeSecondPassword ncb = (LC_Cmd_ChangeSecondPassword)obj; bool Result = ncb.Result; if (Result) { GlobalLogon.Instance.AccountData.SaveAccountData(); } else { GlobalLogon.Instance.AccountData.LoadAccountData(); } //修改密码的结果 进行消息提示 // tagUserOperationEvent pUOM = new tagUserOperationEvent(Result ? UserOperateMessage.UOM_ChangeSecPass_Success : UserOperateMessage.UOM_ChangeSecPass_Faile_6); MsgEventHandle.HandleMsg(pUOM); //触发事件 tagRoleChangeSecPwdEvent pEvent = new tagRoleChangeSecPwdEvent(ncb.Result); MsgEventHandle.HandleMsg(pEvent); return(true); }
public bool IsCanStarLottery(Byte LotteryID) //是否可以开始抽奖 { //开始抽奖 if (!FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey(LotteryID)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() < FishConfig.Instance.m_LotteryConfig.MaxLotteryFishSum) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } UInt32 LotteryScore = PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryScore(); if (LotteryScore < FishConfig.Instance.m_LotteryConfig.LotteryMap[LotteryID].NeedUseScore) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } return(true); }
bool HandleGetLotteryReward(NetCmdBase obj) { LC_Cmd_GetLotteryReward ncb = (LC_Cmd_GetLotteryReward)obj; if (ncb.Result) { //玩家领取奖励成功了 if (!FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey(ncb.LotteryID)) { return(false); } //扣除玩家积分 PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryScore(0); PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryFishSum(0); tagLotteryScoreChangeEvent pEventLottery = new tagLotteryScoreChangeEvent(); MsgEventHandle.HandleMsg(pEventLottery); //提示 tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Sucess);//系统错误 MsgEventHandle.HandleMsg(pUOM); //告诉玩家 事件 tagLotteryResultEvent pEvent = new tagLotteryResultEvent(ncb.LotteryID, ncb.Result, ncb.RewardID); MsgEventHandle.HandleMsg(pEvent); return(true); } else { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Lottery_Failed_3);//系统错误 MsgEventHandle.HandleMsg(pUOM); tagLotteryResultEvent pEvent = new tagLotteryResultEvent(ncb.LotteryID, ncb.Result, ncb.RewardID); MsgEventHandle.HandleMsg(pEvent); return(true); } }
//bool HandleLoadRoleGiffFinish(NetCmdBase obj) //{ // LC_Cmd_GetRoleGiffFinish ncb = (LC_Cmd_GetRoleGiffFinish)obj; // //FriendSysManager.Instance.UpdatePresentList(); // return true; //} bool HandleAddRoleGiffResult(NetCmdBase obj) { LC_Cmd_AddRoleGiffResult ncb = (LC_Cmd_AddRoleGiffResult)obj; if (ncb.Result) { //赠送成功显示提示消息 if (GissNowDaySendMap.ContainsKey(ncb.dwDestUserID)) { GissNowDaySendMap[ncb.dwDestUserID] += 1; } else { GissNowDaySendMap.Add(ncb.dwDestUserID, 1); } PlayerRole.Instance.HandleEvent(EventTargetType.ET_SendGiff, 0, 1); tagGiffSendInfoOnceChangeEvent pEvent = new tagGiffSendInfoOnceChangeEvent(ncb.dwDestUserID); MsgEventHandle.HandleMsg(pEvent); } tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Giff_SendGiff_Sucess : UserOperateMessage.UOM_Giff_SendGiff_Failed_4)); MsgEventHandle.HandleMsg(pUOM); return(true); }
bool HandleDelRelation(NetCmdBase obj) { LC_Cmd_DelUserRelation ncb = (LC_Cmd_DelUserRelation)obj; tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Relation_DelRelation_Sucess : UserOperateMessage.UOM_Relation_DelRelation_Failed_2)); MsgEventHandle.HandleMsg(pUOM); if (ncb.Result) { if (FriendMap.ContainsKey(ncb.dwDestRoleID) == true) { FriendMap.Remove(ncb.dwDestRoleID); // FriendSysManager.Instance.OnDeleteListMsg(ncb.dwDestRoleID, WndType.Friend_Wnd); //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent(); //MsgEventHandle.HandleMsg(pFirendEvent); tagFriendDelEvent pFirendEvent = new tagFriendDelEvent(ncb.dwDestRoleID); MsgEventHandle.HandleMsg(pFirendEvent); } else if (BlackListMap.ContainsKey(ncb.dwDestRoleID) == true) { BlackListMap.Remove(ncb.dwDestRoleID); //tagBlackChangeEvent pBlackEvent = new tagBlackChangeEvent(); //MsgEventHandle.HandleMsg(pBlackEvent); tagBlackDelEvent pBlackEvent = new tagBlackDelEvent(ncb.dwDestRoleID); MsgEventHandle.HandleMsg(pBlackEvent); } } return(true); }
private bool SendChangeRoleNickName(string NickName) { if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.NickNameMinLength, FishDataInfo.NickNameLength, NickName, StringCheckType.SCT_Normal)) { //提示当前用户名称 无法使用 tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_NickName_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (NickName.CompareTo(m_RoleInfo.GetNickName()) == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_NickName_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (m_RoleInfo.GetNickName().IndexOf("游客") != 0 && m_RoleInfo.GetNickName().IndexOf("用户") != 0)//系统生成的名称 第一次是可以修改的 { UInt32 ItemID = FishConfig.Instance.m_SystemConfig.ChangeNickNameNeedItemID; UInt32 ItemSum = FishConfig.Instance.m_SystemConfig.ChangeNickNameNeedItemSum; if (ItemID != 0 && ItemSum > 0 && PlayerRole.Instance.ItemManager.GetItemSum(ItemID) < ItemSum) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_NickName_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } } CL_Cmd_ChangeRoleNickName ncb = new CL_Cmd_ChangeRoleNickName(); ncb.SetCmdType(NetCmdType.CMD_CL_ChangeRoleNickName); ncb.NickName = NickName; NetServices.Instance.Send <CL_Cmd_ChangeRoleNickName>(ncb); return(true); }
private bool SendGiffToOtherUser(UInt32 dwUserID) { //1.判断发送次数 if (PlayerRole.Instance.RoleInfo.RoleMe.GetSendGiffSum() >= FishConfig.Instance.m_GiffInfo.SendSumLimitByDay) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Giff_SendGiff_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } if (GissNowDaySendMap.ContainsKey(dwUserID) && GissNowDaySendMap[dwUserID] >= FishConfig.Instance.m_GiffInfo.SendOnceUserLimitByDay) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Giff_SendGiff_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID()) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Giff_SendGiff_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_AddRoleGiff ncb = new CL_Cmd_AddRoleGiff(); ncb.SetCmdType(NetCmdType.CMD_CL_AddRoleGiff); ncb.dwDestUserID = dwUserID; NetServices.Instance.Send <CL_Cmd_AddRoleGiff>(ncb); return(true); }
public bool OnUseItem(UInt32 ItemOnlyID, UInt32 ItemSum) { //使用指定物品 if (ItemSum == 0) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_1); MsgEventHandle.HandleMsg(pUOM); return(false); } tagItemInfo pInfo; if (!ItemMap.TryGetValue(ItemOnlyID, out pInfo)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (pInfo.ItemOnlyID != ItemOnlyID || pInfo.ItemSum < ItemSum) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_3); MsgEventHandle.HandleMsg(pUOM); return(false); } tagItemConfig pConfig; if (!FishConfig.Instance.m_ItemInfo.m_ItemMap.TryGetValue(pInfo.ItemID, out pConfig)) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_2); MsgEventHandle.HandleMsg(pUOM); return(false); } if (pConfig.ItemTypeID != EItemType.IT_Package && pConfig.ItemTypeID != EItemType.IT_MonthCard && pConfig.ItemTypeID != EItemType.IT_GlobelBag) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_4); MsgEventHandle.HandleMsg(pUOM); return(false); } if (pConfig.ItemTypeID == EItemType.IT_MonthCard && ItemSum > 1) { tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_6); MsgEventHandle.HandleMsg(pUOM); return(false); } if (pConfig.ItemTypeID == EItemType.IT_MonthCard && PlayerRole.Instance.RoleMonthCard.IsInMonthCard()) { //在月卡中 不可以在使用月卡了 tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_UseItem_Failed_7); MsgEventHandle.HandleMsg(pUOM); return(false); } CL_Cmd_OnUseItem ncb = new CL_Cmd_OnUseItem(); ncb.SetCmdType(NetCmdType.CMD_CL_OnUseItem); ncb.ItemOnlyID = ItemOnlyID; ncb.ItemID = pInfo.ItemID; ncb.ItemSum = ItemSum; NetServices.Instance.Send <CL_Cmd_OnUseItem>(ncb); return(true); }