Example #1
0
    //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);
    }
Example #2
0
    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);
    }
Example #3
0
    public void ResetInfo()
    {
        OnClear();
        tagEntityChangeEvent pEvent = new tagEntityChangeEvent();

        MsgEventHandle.HandleMsg(pEvent);
    }
Example #4
0
    public void JoinRoom(byte roomid)
    {
        TableError pError = PlayerRole.Instance.TableManager.IsCanJoinTable(roomid, false);

        if (pError != TableError.TE_Sucess)
        {
            //进入房间失败了 我们进行处理
            tagJoinTableEvent pEvent = new tagJoinTableEvent(roomid, pError);
            MsgEventHandle.HandleMsg(pEvent);//无法进入房间的事件
            return;
        }
        GlobalEffectMgr.Instance.ShowLoadingMessage();

        //发送进入房间的命令到服务端去
        if (SceneMain.IsUserOldServer)
        {
            NetCmdJoinRoom ncr = new NetCmdJoinRoom();
            ncr.SetCmdType(NetCmdType.CMD_JOIN_ROOM);
            ncr.RoomType = roomid;
            NetServices.Instance.Send <NetCmdJoinRoom>(ncr);
        }
        else
        {
            CL_Cmd_JoinTable ncb = new CL_Cmd_JoinTable();
            ncb.SetCmdType(NetCmdType.CMD_CL_JoinTable);
            ncb.bTableType = roomid;
            NetServices.Instance.Send <CL_Cmd_JoinTable>(ncb);
        }
        State = HallState.HALL_JOIN_ROOM;
    }
Example #5
0
    public void ChangeRate(NetCmdPack pack)
    {
        NetCmdChangeRate cmd        = (NetCmdChangeRate)pack.cmd;
        byte             clientSeat = SceneRuntime.ServerToClientSeat(cmd.Seat);

        if (GetPlayer(clientSeat) == null)
        {
            return;
        }
        byte OldRate = GetPlayer(clientSeat).RateIndex;

        GetPlayer(clientSeat).RateIndex = cmd.RateIndex;
        //Debug.Log(cmd.RateIndex);
        GetPlayer(clientSeat).Launcher.ChangeRate(cmd.RateIndex, cmd.IsCanUseRate);

        //如果是自己切换倍率我们就清掉连击状态
        if (clientSeat == m_MyClientSeat)
        {
            if (m_PlayerList[clientSeat].ComboEft != null)
            {
                if (m_PlayerList[clientSeat].ComboEft.LifeTime >= 0.1f)
                {
                    m_PlayerList[clientSeat].ComboEft.LifeTime = 0;
                }
            }
        }
        //因为玩家切换倍率 我们触发一个事件
        tagGameRateChangeEvent pEvent = new tagGameRateChangeEvent(GetPlayer(clientSeat).Player.playerData.ID, OldRate, cmd.RateIndex);

        MsgEventHandle.HandleMsg(pEvent);
    }
Example #6
0
    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);
    }
Example #7
0
    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);
    }
Example #8
0
    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);
        }
    }
Example #9
0
    public void OnRoleCatchByLottery(Byte FishTypeID, CatchedData cd)
    {
        //if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() >= FishConfig.Instance.m_LotteryConfig.MaxLotteryFishSum)
        //    return;
        UInt16 rateIndex = 1;

        if (cd.CatchType == (Byte)CatchedType.CATCHED_BULLET || cd.CatchType == (Byte)CatchedType.CATCHED_LASER)
        {
            rateIndex = BulletSetting.BulletRate[SceneRuntime.PlayerMgr.MySelf.RateIndex];
        }
        else if (cd.CatchType == (Byte)CatchedType.CATCHED_SKILL)
        {
            rateIndex = SkillSetting.SkillDataList[cd.SubType].multiple;
        }
        UInt32 Score = FishConfig.Instance.m_LotteryConfig.GetFishLotteryScore(FishTypeID) * rateIndex;

        if (Score == 0)
        {
            return;
        }
        if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() < Byte.MaxValue)
        {
            PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryFishSum(Convert.ToByte(PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() + 1));
        }
        PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryScore(PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryScore() + Score);

        tagLotteryScoreChangeEvent pEventLottery = new tagLotteryScoreChangeEvent();

        MsgEventHandle.HandleMsg(pEventLottery);
    }
Example #10
0
    //private bool HandleMonthPlayerSumFinish(NetCmdBase obj)
    //{
    //    LC_Cmd_GetMonthRoleSumFinish ncb = (LC_Cmd_GetMonthRoleSumFinish)obj;

    //    //IsLoadMonthPlayerSum = true;

    //    tagMonthSignUpSumChangeEvent pEvent = new tagMonthSignUpSumChangeEvent();
    //    MsgEventHandle.HandleMsg(pEvent);

    //    return true;
    //}
    private bool HandleSetRoleMonthInfo(NetCmdBase obj)
    {
        LC_Cmd_SetRoleMonthInfo ncb = (LC_Cmd_SetRoleMonthInfo)obj;

        if (ncb.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthGlobel(Convert.ToUInt32(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthGlobel() + ncb.MonthGlobel));
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthScore(Convert.ToUInt32(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthScore() + ncb.MonthSocre));

            tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
            MsgEventHandle.HandleMsg(pEvent);
        }
        else
        {
            TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(ncb.dwUserID);
            if (pRole != null)
            {
                pRole.SetMonthGlobel(Convert.ToUInt32(pRole.GetMonthGlobel() + ncb.MonthGlobel));
                pRole.SetMonthScore(Convert.ToUInt32(pRole.GetMonthScore() + ncb.MonthSocre));

                tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }
        return(true);
    }
Example #11
0
    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);
    }
Example #12
0
    private bool HandleMonthPlayerSum(NetCmdBase obj)
    {
        LC_Cmd_GetMonthRoleSum ncb = (LC_Cmd_GetMonthRoleSum)obj;

        if ((ncb.States & FishDataInfo.MsgBegin) != 0)
        {
            MonthPlayerSum.Clear();
        }
        for (UInt16 i = 0; i < ncb.Sum; ++i)
        {
            //将数据存储起来
            if (MonthPlayerSum.ContainsKey(ncb.Array[i].MonthID))
            {
                MonthPlayerSum[ncb.Array[i].MonthID] = ncb.Array[i].MonthUserSum;
            }
            else
            {
                MonthPlayerSum.Add(ncb.Array[i].MonthID, ncb.Array[i].MonthUserSum);
            }
        }
        if ((ncb.States & FishDataInfo.MsgEnd) != 0)
        {
            tagMonthSignUpSumChangeEvent pEvent = new tagMonthSignUpSumChangeEvent();
            MsgEventHandle.HandleMsg(pEvent);
        }
        return(true);
    }
Example #13
0
    private bool HandleMonthEnd(NetCmdBase obj)
    {
        //玩家报名的一场比赛结束了 我们将报名信息关闭掉
        LC_Cmd_UserMonthEnd ncb = (LC_Cmd_UserMonthEnd)obj;

        if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == ncb.MonthID)
        {
            if (SceneRuntime.Instance != null)
            {
                SceneRuntime.SceneLogic.BackToHall();
            }
            PlayerRole.Instance.OnUserLeaveTable();//玩家离开桌子的触发函数
        }

        //因为一场比赛结束了 我们想要移除自己的报名信息
        if (SignUpList.ContainsKey(ncb.MonthID))//移除比赛数据
        {
            SignUpList.Remove(ncb.MonthID);
            tagMonthSignUpChangeEvent pEvnet = new tagMonthSignUpChangeEvent();
            MsgEventHandle.HandleMsg(pEvnet);
        }

        PlayerRole.Instance.RoleGameData.OnHandleRoleMonthReward(Convert.ToUInt32(ncb.MonthIndex));

        tagMonthEndEvent pEvent = new tagMonthEndEvent(ncb.MonthID, ncb.MonthIndex, ncb.MonthScores, ncb.VipScores);

        MsgEventHandle.HandleMsg(pEvent);

        return(true);
    }
Example #14
0
    private bool HandleRoleMonthIndexChange(NetCmdBase obj)
    {
        //玩家排名变化了
        LC_Cmd_UserChangeIndex ncb = (LC_Cmd_UserChangeIndex)obj;

        if (ncb.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthUpperSocre(ncb.dwUpperSocre);
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthIndex(ncb.dwIndex);

            tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
            MsgEventHandle.HandleMsg(pEvent);
        }
        else
        {
            TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(ncb.dwUserID);
            if (pRole != null)
            {
                pRole.SetMonthUpperSocre(ncb.dwUpperSocre);
                pRole.SetMonthIndex(ncb.dwIndex);

                tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }
        return(true);
    }
Example #15
0
    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);
    }
Example #16
0
    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);
    }
Example #17
0
    //玩家抢庄
    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);
    }
Example #18
0
    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);
    }
Example #19
0
    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);
    }
Example #20
0
    bool HandleOpenShareUI(NetCmdBase obj)
    {
        tagRoleOpenShareUIEvent pEvent = new tagRoleOpenShareUIEvent();

        MsgEventHandle.HandleMsg(pEvent);
        return(true);
    }
Example #21
0
    private bool HandleLoadAllAnnouncement(NetCmdBase obj)
    {
        LC_Cmd_GetAllAnnouncement ncb = (LC_Cmd_GetAllAnnouncement)obj;

        if ((ncb.States & FishDataInfo.MsgBegin) != 0)
        {
            pList.Clear();
        }
        for (UInt16 i = 0; i < ncb.Sum; ++i)
        {
            pList.Add(ncb.Array[i]);
        }
        if ((ncb.States & FishDataInfo.MsgEnd) != 0)
        {
            m_IsLoadByServer = true;
            //触发命令
            while (pList.Count > FishConfig.Instance.m_SystemConfig.AnnouncementSum)
            {
                pList.RemoveAt(pList.Count - 1);//移除最后一个
            }
            tagAnnouncementChangeEvent pEvent = new tagAnnouncementChangeEvent();
            MsgEventHandle.HandleMsg(pEvent);
        }
        return(true);
    }
Example #22
0
    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);
    }
Example #23
0
    //bool HandleJoinTableResult(NetCmdBase obj)
    //{
    //    LC_Cmd_JoinTableResult ncb = (LC_Cmd_JoinTableResult)obj;
    //    if (ncb.Result)
    //    {
    //        //进入桌子成功
    //        m_IsIntable = true;

    //        tagTableAddEvent pEvent = new tagTableAddEvent(PlayerRole.Instance.RoleInfo.RoleMe.GetUserID());
    //        MsgEventHandle.HandleMsg(pEvent);

    //        ClientLogonControl.Instance.HandleJoinRoomSucess();

    //    }
    //    else
    //    {
    //        //进入桌子失败
    //        m_IsIntable = false;
    //        ClientLogonControl.Instance.HandleJoinRoomFailed();
    //    }

    //    return true;
    //}
    bool HandleOtherUserInfo(NetCmdBase obj)
    {
        LC_Cmd_OtherUserInfo ncb   = (LC_Cmd_OtherUserInfo)obj;
        TableRole            pRole = new TableRole(ncb.UserInfo);

        if (m_TableRole.ContainsKey(ncb.UserInfo.dwUserID))
        {
            m_TableRole.Remove(ncb.UserInfo.dwUserID);
        }
        m_TableRole.Add(pRole.GetUserID(), pRole);
        if (m_TableRoleSeat.ContainsKey(pRole.GetSeat()))
        {
            m_TableRoleSeat.Remove(pRole.GetSeat());
        }
        m_TableRoleSeat.Add(pRole.GetSeat(), pRole);

        tagTableAddEvent pEvent = new tagTableAddEvent(pRole.GetUserID());

        MsgEventHandle.HandleMsg(pEvent);

        //tagTableChangeEvent pEvent = new tagTableChangeEvent(pRole.GetUserID());
        //MsgEventHandle.HandleMsg(pEvent);

        return(true);
    }
Example #24
0
    //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);
    }
Example #25
0
    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);
    }
Example #26
0
    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);
    }
Example #27
0
    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);
    }
Example #28
0
    public void DownLoadReadRankXml(bool IsError = false)
    {
        LoadRoleRankXml(IsError);
        tagRankXmlChangeEvent pEvent = new tagRankXmlChangeEvent();

        MsgEventHandle.HandleMsg(pEvent);//添加排行榜XML文件读取成功的函数
    }
Example #29
0
    public void LogOff()
    {
        if (m_Params != null)
        {
            return;
        }
        m_Params = true;
        try
        {
            WndManager.Instance.Clear();
        }
        catch {
        }
        try
        {
            NetServices.Instance.ClearCmdAndHandler();
            NetServices.Instance.Disconnect();
        }
        catch {
        }

        LogicRuntimeData ld = LogicFlowManager.GetLogic(LogicType.LOGIC_LOGON);

        ActiveLogic(ld);
        try
        {
            tagReturnLogonEvent pEvent = new tagReturnLogonEvent();
            MsgEventHandle.HandleMsg(pEvent);
            SDKMgr.Instance.Logout();
        }
        catch {
        }
    }
Example #30
0
    public void ResetInfo()
    {
        OnClear();
        tagItemChangeEvent Event = new tagItemChangeEvent();

        MsgEventHandle.HandleMsg(Event);
    }