Esempio n. 1
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);
    }
Esempio n. 2
0
 public Int32 GetCharmValue(UInt32 dwUserID)
 {
     if (PlayerRole.Instance.RoleInfo.RoleMe.GetUserID() == dwUserID)
     {
         return(GetCharmValue());
     }
     else
     {
         TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(dwUserID);
         if (pRole == null)
         {
             return(0);
         }
         else
         {
             Int32 charmSun = 0;
             for (byte i = 0; i < pRole.GetCharmInfo().Length; ++i)
             {
                 tagCharmOnce charmOnce;
                 if (FishConfig.Instance.m_CharmInfo.CharmIndexMap.TryGetValue(i, out charmOnce))
                 {
                     charmSun += Convert.ToInt32(pRole.GetCharmInfo()[i] * (int)charmOnce.ChangeCharmValue); //有可能为-数
                 }
             }
             return(charmSun);
         }
     }
 }
Esempio n. 3
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);
    }
Esempio n. 4
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);
    }
Esempio n. 5
0
        public TableItem(TableRole role, string tableAlias, string tableName)
        {
            tableAlias.AssertHasText(nameof(tableAlias));

            Role       = role;
            TableAlias = tableAlias;
            TableName  = tableName;
        }
Esempio n. 6
0
    bool HandleResetOtherUser(NetCmdBase obj)
    {
        LC_Cmd_ResetOtherUserInfo ncb = (LC_Cmd_ResetOtherUserInfo)obj;

        TableRole pTableRole = new TableRole(ncb.UserInfo);

        m_TableRole.Add(pTableRole.GetUserID(), pTableRole);
        m_TableRoleSeat.Add(pTableRole.GetSeat(), pTableRole);

        tagTableChangeEvent pEvent = new tagTableChangeEvent(ncb.UserInfo.dwUserID);

        MsgEventHandle.HandleMsg(pEvent);
        return(true);
    }
Esempio n. 7
0
        private string JoinClause(JoinType type, string tableAlias, string tableName)
        {
            tableAlias.AssertHasText(nameof(tableAlias));
            tableName.AssertHasText(nameof(tableName));

            string    joinClause = null;
            TableRole role       = TableRole.FromTable;

            switch (type)
            {
            case JoinType.CrossJoin:
                joinClause = $" CROSS JOIN {tableName} {tableAlias}";
                role       = TableRole.CrossJoinTable;
                break;

            case JoinType.FullJoin:
                joinClause = $" FULL JOIN {tableName} {tableAlias}";
                role       = TableRole.FullJoinTable;
                break;

            case JoinType.InnerJoin:
                joinClause = $" INNER JOIN {tableName} {tableAlias}";
                role       = TableRole.InnerJoinTable;
                break;

            case JoinType.LeftJoin:
                joinClause = $" LEFT JOIN {tableName} {tableAlias}";
                role       = TableRole.LeftJoinTable;
                break;

            case JoinType.RightJoin:
                joinClause = $" RIGHT JOIN {tableName} {tableAlias}";
                role       = TableRole.RightJoinTable;
                break;
            }

            TableItem tableItem = new TableItem(role, tableAlias, tableName);

            _joinInfo.RightTable = tableItem;
            _tablesMap.AddIfNecessary(tableItem);

            return(joinClause);
        }
Esempio n. 8
0
    private bool HandleResetRoleMonth(NetCmdBase obj)
    {
        LC_Cmd_ResetMonthInfo ncb = (LC_Cmd_ResetMonthInfo)obj;

        if (ncb.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Month_ResetMonth_Sucess : UserOperateMessage.UOM_Month_ResetMonth_Failed_6));
            MsgEventHandle.HandleMsg(pUOM);

            if (ncb.MonthID != PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() || !ncb.Result)
            {
                return(true);
            }

            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthGlobel(FishConfig.Instance.m_MatchInfo.m_MonthMap[ncb.MonthID].InitMonthGlobel);
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthScore(0);
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthAddGlobelNum(0);

            tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
            MsgEventHandle.HandleMsg(pEvent);
        }
        else
        {
            if (ncb.MonthID != PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() || !ncb.Result)
            {
                return(true);
            }

            TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(ncb.dwUserID);
            if (pRole != null)
            {
                pRole.SetMonthGlobel(FishConfig.Instance.m_MatchInfo.m_MonthMap[ncb.MonthID].InitMonthGlobel);
                pRole.SetMonthScore(0);
                pRole.SetMonthAddGlobelNum(0);

                tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }
        return(true);
    }
Esempio n. 9
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);
    }
Esempio n. 10
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);
    }
Esempio n. 11
0
        public async Task <Tuple <string, TableInfo> > UpdateTableInfoAsync(string oldTableName, TableInfo oldTableInfo)
        {
            ConvertInfo converter = null;

            if (StringUtils.EqualsIgnoreCase(TableAdministrator.OldTableName, oldTableName))
            {
                var table = new TableAdministrator(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableAdministratorsInRoles.OldTableName, oldTableName))
            {
                var table = new TableAdministratorsInRoles(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableChannel.OldTableNames, oldTableName))
            {
                var table = new TableChannel(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableChannelGroup.OldTableNames, oldTableName))
            {
                var table = new TableChannelGroup(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableConfig.OldTableName, oldTableName))
            {
                var table = new TableConfig(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableContentCheck.OldTableName, oldTableName))
            {
                var table = new TableContentCheck(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableContentGroup.OldTableNames, oldTableName))
            {
                var table = new TableContentGroup(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableDbCache.OldTableName, oldTableName))
            {
                var table = new TableDbCache(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableErrorLog.OldTableName, oldTableName))
            {
                converter = TableErrorLog.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableLog.OldTableName, oldTableName))
            {
                var table = new TableLog(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TablePermissionsInRoles.OldTableName, oldTableName))
            {
                var table = new TablePermissionsInRoles(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableRelatedField.OldTableNames, oldTableName))
            {
                var table = new TableRelatedField(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableRelatedFieldItem.OldTableNames, oldTableName))
            {
                var table = new TableRelatedFieldItem(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableRole.OldTableName, oldTableName))
            {
                var table = new TableRole(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSite.OldTableNames, oldTableName))
            {
                var table = new TableSite(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSiteLog.OldTableNames, oldTableName))
            {
                var table = new TableSiteLog(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSitePermissions.OldTableNames, oldTableName))
            {
                var table = new TableSitePermissions(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableTableStyle.OldTableName, oldTableName))
            {
                var table = new TableTableStyle(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableContentTag.OldTableName, oldTableName))
            {
                var table = new TableContentTag(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableTemplate.OldTableNames, oldTableName))
            {
                var table = new TableTemplate(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableTemplateLog.OldTableNames, oldTableName))
            {
                var table = new TableTemplateLog(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableUser.OldTableName, oldTableName))
            {
                var table = new TableUser(_databaseManager);
                converter = table.Converter;
            }

            return(await GetNewTableInfoAsync(oldTableName, oldTableInfo, converter));
        }
Esempio n. 12
0
 protected void GridViewRole_RowDeleted(object sender, GridViewDeletedEventArgs e)
 {
     TableRole.DataBind();
 }
Esempio n. 13
0
        public bool OnAddUserGlobelByCatchedData(Byte Seat, int GlobelSum) //修改指定位置上玩家的金币 或者是积分 必须是 与鱼群相关的
        {
            //因为捕获鱼 添加金币
            Seat = SceneRuntime.ClientToServerSeat(Seat);
            bool IsInMonth = (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() != 0);

            if (PlayerRole.Instance.RoleInfo.RoleMe.GetSeat() == Seat)
            {
                if (PlayerRole.Instance.RoleInfo.RoleMe == null)
                {
                    return(false);
                }
                if (IsInMonth)
                {
                    if (GlobelSum >= 0)
                    {
                        PlayerRole.Instance.RoleInfo.RoleMe.SetMonthScore(
                            Convert.ToUInt32(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthScore() + GlobelSum));
                    }
                    else
                    {
                        if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthGlobel() < GlobelSum * -1)
                        {
                            return(false);
                        }
                        PlayerRole.Instance.RoleInfo.RoleMe.SetMonthGlobel(
                            Convert.ToUInt32(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthGlobel() + GlobelSum));
                    }
                    //tagMonthChangeEvent pEvent = new tagMonthChangeEvent(PlayerRole.Instance.RoleInfo.RoleMe.GetUserID());
                    //MsgEventHandle.HandleMsg(pEvent);
                    tagMatchScoreAddEvent pEvent =
                        new tagMatchScoreAddEvent(PlayerRole.Instance.RoleInfo.RoleMe.GetUserID());
                    //MsgEventHandle.HandleMsg(pEvent);
                    IEvent evnt = new Event(EventMsg.UPDATE_PLAYSCORE);
                    EventManager.Instance.DispatchEvent(evnt);
                    return(true);
                }
                else
                {
                    if (GlobelSum < 0 && PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < -1 * GlobelSum)
                    {
                        return(false);
                    }
                    PlayerRole.Instance.RoleInfo.RoleMe.SetGlobel(
                        Convert.ToUInt32(PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() + GlobelSum));
                    tagRoleChangeEvent pEvent = new tagRoleChangeEvent();
                    //MsgEventHandle.HandleMsg(pEvent);
                    return(true);
                }
            }
            else
            {
                if (IsInMonth)
                {
                    TableRole pTableRole = PlayerRole.Instance.TableManager.GetTableRole(Seat);
                    if (pTableRole == null)
                    {
                        return(false);
                    }
                    if (GlobelSum >= 0)
                    {
                        pTableRole.SetMonthScore(Convert.ToUInt32(pTableRole.GetMonthScore() + GlobelSum));
                    }
                    else
                    {
                        if (pTableRole.GetMonthGlobel() < GlobelSum * -1)
                        {
                            return(false);
                        }
                        pTableRole.SetMonthGlobel(Convert.ToUInt32(pTableRole.GetMonthGlobel() + GlobelSum));
                    }
                    tagMonthChangeEvent pEvent = new tagMonthChangeEvent(pTableRole.GetUserID());
                    //MsgEventHandle.HandleMsg(pEvent);
                    return(true);
                }
                else
                {
                    if (GlobelSum < 0 && PlayerRole.Instance.TableManager.GetTableRole(Seat).GetGlobel() < -1 * GlobelSum)
                    {
                        return(false);
                    }
                    TableRole pTableRole = PlayerRole.Instance.TableManager.GetTableRole(Seat);
                    if (pTableRole == null)
                    {
                        return(false);
                    }
                    pTableRole.SetGlobel(Convert.ToUInt32(pTableRole.GetGlobel() + GlobelSum));

                    tagTableChangeEvent pEvent = new tagTableChangeEvent(pTableRole.GetUserID());
                    //MsgEventHandle.HandleMsg(pEvent);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 14
0
    private bool HandleChangeUserAddMonthGlobelNum(NetCmdBase obj) //玩家续币成功的时候
    {
        LC_Cmd_ChangeUserAddMonthGlobelNum ncb = (LC_Cmd_ChangeUserAddMonthGlobelNum)obj;

        //桌子上一个玩家进行续币了 修改数据
        if (ncb.dwUserID == PlayerRole.Instance.RoleInfo.RoleMe.GetUserID())
        {
            //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)
            //    PlayerRole.Instance.RoleInfo.RoleMe.SetGlobel(0);
            //else
            //    PlayerRole.Instance.RoleInfo.RoleMe.SetGlobel(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);
            if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.ContainsKey(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()))
            {
                return(true);
            }
            if (!FishConfig.Instance.m_MatchInfo.m_MonthMap[PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()].m_ConvertMap.ContainsKey((Byte)(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthAddGlobelNum() + 1)))
            {
                return(true);
            }
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthGlobel(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthGlobel() + FishConfig.Instance.m_MatchInfo.m_MonthMap[PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()].m_ConvertMap[(Byte)(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthAddGlobelNum() + 1)].AddMonthGlobel);
            PlayerRole.Instance.RoleInfo.RoleMe.SetMonthAddGlobelNum(Convert.ToByte(PlayerRole.Instance.RoleInfo.RoleMe.GetMonthAddGlobelNum() + 1));

            tagRoleChangeEvent pRoleEvent = new tagRoleChangeEvent();
            MsgEventHandle.HandleMsg(pRoleEvent);

            tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
            MsgEventHandle.HandleMsg(pEvent);

            tagMatchContiueGoldEvent pContinueEvent = new tagMatchContiueGoldEvent();
            MsgEventHandle.HandleMsg(pContinueEvent);

            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Month_AddMonthGlobel_Sucess);
            MsgEventHandle.HandleMsg(pUOM);
        }
        else
        {
            TableRole pRole = PlayerRole.Instance.TableManager.GetTableRole(ncb.dwUserID);
            if (pRole != null)
            {
                //if (pRole.GetGlobel() <= FishConfig.Instance.m_MatchInfo.m_MonthMap[pRole.GetMonthID()].m_ConvertMap[(Byte)(pRole.GetMonthAddGlobelNum() + 1)].LostGlobel)
                //    pRole.SetGlobel(0);
                //else
                //    pRole.SetGlobel(pRole.GetGlobel() - FishConfig.Instance.m_MatchInfo.m_MonthMap[pRole.GetMonthID()].m_ConvertMap[(Byte)(pRole.GetMonthAddGlobelNum() + 1)].LostGlobel);
                if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.ContainsKey(pRole.GetMonthID()))
                {
                    return(true);
                }
                if (!FishConfig.Instance.m_MatchInfo.m_MonthMap[PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID()].m_ConvertMap.ContainsKey((Byte)(pRole.GetMonthAddGlobelNum() + 1)))
                {
                    return(true);
                }
                pRole.SetMonthGlobel(pRole.GetMonthGlobel() + FishConfig.Instance.m_MatchInfo.m_MonthMap[pRole.GetMonthID()].m_ConvertMap[(Byte)(pRole.GetMonthAddGlobelNum() + 1)].AddMonthGlobel);
                pRole.SetMonthAddGlobelNum(Convert.ToByte(pRole.GetMonthAddGlobelNum() + 1));

                tagRoleChangeEvent pRoleEvent = new tagRoleChangeEvent();
                MsgEventHandle.HandleMsg(pRoleEvent);

                tagMonthChangeEvent pEvent = new tagMonthChangeEvent(ncb.dwUserID);
                MsgEventHandle.HandleMsg(pEvent);
            }
        }
        return(true);
    }
Esempio n. 15
0
        public async Task <Tuple <string, TableInfo> > UpdateTableInfoAsync(string oldTableName, TableInfo oldTableInfo, List <string> tableNameListForGovPublic, List <string> tableNameListForGovInteract, List <string> tableNameListForJob)
        {
            ConvertInfo converter = null;

            if (StringUtils.EqualsIgnoreCase(TableAdministrator.OldTableName, oldTableName))
            {
                var table = new TableAdministrator(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableAdministratorsInRoles.OldTableName, oldTableName))
            {
                var table = new TableAdministratorsInRoles(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableChannel.OldTableNames, oldTableName))
            {
                var table = new TableChannel(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableChannelGroup.OldTableNames, oldTableName))
            {
                var table = new TableChannelGroup(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableConfig.OldTableName, oldTableName))
            {
                var table = new TableConfig(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableContentCheck.OldTableName, oldTableName))
            {
                var table = new TableContentCheck(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableContentGroup.OldTableNames, oldTableName))
            {
                var table = new TableContentGroup(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableDbCache.OldTableName, oldTableName))
            {
                var table = new TableDbCache(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableErrorLog.OldTableName, oldTableName))
            {
                converter = TableErrorLog.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableLog.OldTableName, oldTableName))
            {
                var table = new TableLog(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TablePermissionsInRoles.OldTableName, oldTableName))
            {
                var table = new TablePermissionsInRoles(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableRelatedField.OldTableNames, oldTableName))
            {
                var table = new TableRelatedField(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableRelatedFieldItem.OldTableNames, oldTableName))
            {
                var table = new TableRelatedFieldItem(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableRole.OldTableName, oldTableName))
            {
                var table = new TableRole(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSite.OldTableNames, oldTableName))
            {
                var table = new TableSite(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSiteLog.OldTableNames, oldTableName))
            {
                var table = new TableSiteLog(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableSitePermissions.OldTableNames, oldTableName))
            {
                var table = new TableSitePermissions(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableTableStyle.OldTableName, oldTableName))
            {
                var table = new TableTableStyle(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableContentTag.OldTableName, oldTableName))
            {
                var table = new TableContentTag(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableTemplate.OldTableNames, oldTableName))
            {
                var table = new TableTemplate(_databaseManager);
                converter = table.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(TableTemplateLog.OldTableNames, oldTableName))
            {
                var table = new TableTemplateLog(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableUser.OldTableName, oldTableName))
            {
                var table = new TableUser(_databaseManager);
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractChannel.OldTableName, oldTableName))
            {
                var table = new TableGovInteractChannel();
                converter = table.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractLog.OldTableName, oldTableName))
            {
                converter = TableGovInteractLog.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractPermissions.OldTableName, oldTableName))
            {
                converter = TableGovInteractPermissions.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractRemark.OldTableName, oldTableName))
            {
                converter = TableGovInteractRemark.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractReply.OldTableName, oldTableName))
            {
                converter = TableGovInteractReply.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovInteractType.OldTableName, oldTableName))
            {
                converter = TableGovInteractType.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovPublicCategory.OldTableName, oldTableName))
            {
                converter = TableGovPublicCategory.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovPublicCategoryClass.OldTableName, oldTableName))
            {
                converter = TableGovPublicCategoryClass.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovPublicIdentifierRule.OldTableName, oldTableName))
            {
                converter = TableGovPublicIdentifierRule.Converter;
            }
            else if (StringUtils.EqualsIgnoreCase(TableGovPublicIdentifierSeq.OldTableName, oldTableName))
            {
                converter = TableGovPublicIdentifierSeq.Converter;
            }
            else if (ListUtils.ContainsIgnoreCase(tableNameListForGovPublic, oldTableName))
            {
                var table = new TableGovPublicContent(_settingsManager);
                converter = table.GetConverter(oldTableInfo.Columns);
            }
            else if (ListUtils.ContainsIgnoreCase(tableNameListForGovInteract, oldTableName))
            {
                var table = new TableGovInteractContent(_settingsManager);
                converter = table.GetConverter(oldTableInfo.Columns);
            }
            else if (ListUtils.ContainsIgnoreCase(tableNameListForJob, oldTableName))
            {
                var table = new TableJobsContent(_settingsManager);
                converter = table.GetConverter(oldTableInfo.Columns);
            }

            return(await GetNewTableInfoAsync(oldTableName, oldTableInfo, converter));
        }