Exemple #1
0
    private bool HandleResetRoleMonthInfo(NetCmdBase obj)
    {
        LC_Cmd_ResetRoleMonthInfo ncb = (LC_Cmd_ResetRoleMonthInfo)obj;

        if (ncb.MonthInfo.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthInfo(ncb.MonthInfo);

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

                tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.MonthInfo.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }
        return(true);
    }
Exemple #2
0
    private bool HandleJoinMonthSucess(NetCmdBase obj)
    {
        LC_Cmd_JoinMonthSucess ncb = (LC_Cmd_JoinMonthSucess)obj;

        //if (FishClientData.Instance.RoleMonthInfo.ContainsKey(ncb.MonthInfo.dwUserID))
        //{
        //    FishClientData.Instance.RoleMonthInfo[ncb.MonthInfo.dwUserID] = ncb.MonthInfo;
        //}
        //else
        //    FishClientData.Instance.RoleMonthInfo.Add(ncb.MonthInfo.dwUserID, ncb.MonthInfo);
        if (ncb.MonthInfo.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthInfo(ncb.MonthInfo);

            PlayerRole.Instance.RoleGameData.SetRoleJoinMonth();//玩家进入比赛

            tagMonthAddEvent pEvent = new tagMonthAddEvent(ncb.MonthInfo.dwUserID);
            MsgEventHandle.HandleMsg(pEvent);

            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Month_JoinMonth_Sucess);
            MsgEventHandle.HandleMsg(pUOM);
        }
        else
        {
            TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(ncb.MonthInfo.dwUserID);
            if (pRole != null)
            {
                pRole.SetMonthInfo(ncb.MonthInfo);

                tagMonthAddEvent pEvent = new tagMonthAddEvent(ncb.MonthInfo.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }

        return(true);
    }