Esempio n. 1
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;
            NetManager.Instance.Send <CL_Cmd_ChangeRoleNickName>(ncb);
            return(true);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        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;
            NetManager.Instance.Send <CL_Cmd_OnUseItem>(ncb);
            return(true);
        }
Esempio n. 4
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;
            NetManager.Instance.Send <CL_Cmd_ChangeRoleGender>(ncb);
            return(true);
        }
Esempio n. 5
0
        private bool HandleOnUseItemResult(NetCmdBase obj)
        {
            LC_Cmd_OnUseItem ncb    = (LC_Cmd_OnUseItem)obj;
            tagItemUseEvent  pEvent = new tagItemUseEvent(ncb.Result, ncb.ItemOnlyID, ncb.ItemID, ncb.ItemSum);
            //MsgEventHandle.HandleMsg(pEvent);

            tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Item_UseItem_Sucess : UserOperateMessage.UOM_Item_UseItem_Failed_5));

            //MsgEventHandle.HandleMsg(pUOM);
            return(true);
        }
Esempio n. 6
0
        public bool ResetAccountPassword(string OldPassword, string NewPassword)
        {
            /*if (GlobalLogon.Instance.AccountData == null)
             *  return false;*/
            //进行验证
            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, OldPassword, StringCheckType.SCT_Password))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangePassword_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, NewPassword, StringCheckType.SCT_Password))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangePassword_Failed_2);
                //MsgEventHandle.HandleMsg(pUOM);
            }
            if (NewPassword.CompareTo(OldPassword) == 0)
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangePassword_Failed_3);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            string AccountName = "";//GlobalLogon.Instance.AccountData.AccountInfo.UID;
            //发送命令到服务器去
            UInt32 OldCrc1, OldCrc2, OldCrc3;

            if (!NativeInterface.ComputeCrc(AccountName, OldPassword, out OldCrc1, out OldCrc2, out OldCrc3))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangePassword_Failed_4);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            UInt32 NewCrc1, NewCrc2, NewCrc3;

            if (!NativeInterface.ComputeCrc(AccountName, NewPassword, out NewCrc1, out NewCrc2, out NewCrc3))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangePassword_Failed_5);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            CL_Cmd_ResetPassword ncb = new CL_Cmd_ResetPassword();

            ncb.SetCmdType(NetCmdType.CMD_CL_ResetPassword);
            ncb.OldPasswordCrc1 = OldCrc1;
            ncb.OldPasswordCrc2 = OldCrc2;
            ncb.OldPasswordCrc3 = OldCrc3;
            ncb.NewPasswordCrc1 = NewCrc1;
            ncb.NewPasswordCrc2 = NewCrc2;
            ncb.NewPasswordCrc3 = NewCrc3;
            NetManager.Instance.Send <CL_Cmd_ResetPassword>(ncb);
            return(true);
        }
Esempio n. 7
0
        bool HandleChangePassword(NetCmdBase obj)
        {
            LC_Cmd_ResetPassword ncb = (LC_Cmd_ResetPassword)obj;

            if (ncb.Result)
            {
                //GlobalLogon.Instance.SaveAccountPassWord(ncb.NewPasswordCrc1, ncb.NewPasswordCrc2, ncb.NewPasswordCrc3);
            }
            tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Role_ChangePassword_Sucess : UserOperateMessage.UOM_Role_ChangePassword_Failed_6));

            //MsgEventHandle.HandleMsg(pUOM);
            return(true);
        }
Esempio n. 8
0
        bool HandleChangeRoleTitle(NetCmdBase obj)
        {
            LC_Cmd_ChangeRoleTitle ncb = (LC_Cmd_ChangeRoleTitle)obj;

            m_RoleInfo.SetTitleID(ncb.TitleID);

            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Title_Sucess);
            //MsgEventHandle.HandleMsg(pUOM);

            tagRoleChangeEvent pEvent = new tagRoleChangeEvent();

            //MsgEventHandle.HandleMsg(pEvent);
            return(true);
        }
Esempio n. 9
0
        bool HandleChangeRoleIsShowIpAddress(NetCmdBase obj)
        {
            LC_Cmd_ChangeRoleIsShowIpAddress ncb = (LC_Cmd_ChangeRoleIsShowIpAddress)obj;

            RoleMe.SetIsShowIpAddress(ncb.IsShowIpAddress);

            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_IsShowIpAddress_Sucess);
            //MsgEventHandle.HandleMsg(pUOM);

            tagRoleChangeEvent pEvent = new tagRoleChangeEvent();

            //MsgEventHandle.HandleMsg(pEvent);
            return(true);
        }
Esempio n. 10
0
        bool HandleLCChangeRoleGender(NetCmdBase obj)
        {
            LC_Cmd_ChangeRoleGender ncb = (LC_Cmd_ChangeRoleGender)obj;

            m_RoleInfo.SetGender(ncb.bGender);

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

            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_Gender_Sucess);

            //MsgEventHandle.HandleMsg(pUOM);

            return(true);
        }
Esempio n. 11
0
        public void SendIsShowIpAddress(bool States)
        {
            if (States == RoleMe.IsShowIpAddress())
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_IsShowIpAddress_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return;
            }

            CL_Cmd_ChangeRoleIsShowIpAddress ncb = new CL_Cmd_ChangeRoleIsShowIpAddress();

            ncb.SetCmdType(NetCmdType.CMD_CL_ChangeRoleIsShowIpAddress);
            ncb.IsShowIpAddress = States;
            NetManager.Instance.Send <CL_Cmd_ChangeRoleIsShowIpAddress>(ncb);
        }
Esempio n. 12
0
        public bool ResetAccountInfo(string AccountInfo, string Password)//无须旧密码 因为游客根本不找到旧密码
        {
            //必须为游客才可以重置账号
            if (!PlayerRole.Instance.RoleInfo.RoleMe.GetIsCanResetAccount())
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ResetAccount_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.AccountNameMinLength, FishDataInfo.AccountNameLength, AccountInfo, StringCheckType.SCT_AccountName))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ResetAccount_Failed_2);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, Password, StringCheckType.SCT_Password))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ResetAccount_Failed_3);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            UInt32 NewCrc1, NewCrc2, NewCrc3;

            if (!NativeInterface.ComputeCrc(AccountInfo, Password, out NewCrc1, out NewCrc2, out NewCrc3))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ResetAccount_Failed_4);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            //发送命令到服务器端去 需要判断账号是否存在
            CL_Cmd_AccountResetAccount ncb = new CL_Cmd_AccountResetAccount();

            ncb.SetCmdType(NetCmdType.CMD_CL_AccountResetAccount);
            ncb.NewAccountName = AccountInfo;
            ncb.PasswordCrc1   = NewCrc1;
            ncb.PasswordCrc2   = NewCrc2;
            ncb.PasswordCrc3   = NewCrc3;
            NetManager.Instance.Send <CL_Cmd_AccountResetAccount>(ncb);

            /*GlobalLogon.Instance.AccountData.TempAccountInfo.Clear();
             * GlobalLogon.Instance.AccountData.TempPhoneInfo.Clear();
             * GlobalLogon.Instance.AccountData.TempAccountInfo.UID = AccountInfo;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC1 = NewCrc1;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC2 = NewCrc2;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC3 = NewCrc3;*/

            return(true);
        }
Esempio n. 13
0
        private bool SendChangeRoleNormalFaceID(UInt32 FaceID)
        {
            //玩家切换普通的头像ID
            if (FaceID == m_RoleInfo.GetFaceID())
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangeFace_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            CL_Cmd_ChangeRoleNormalFaceID ncb = new CL_Cmd_ChangeRoleNormalFaceID();

            ncb.SetCmdType(NetCmdType.CMD_CL_ChangeRoleNormalFaceID);
            ncb.dwFaceID = FaceID;
            NetManager.Instance.Send <CL_Cmd_ChangeRoleNormalFaceID>(ncb);
            return(true);
        }
Esempio n. 14
0
        bool HandleLCChangeRoleNickName(NetCmdBase obj)
        {
            LC_Cmd_ChangeRoleNickName ncb = (LC_Cmd_ChangeRoleNickName)obj;

            if (ncb.Result)
            {
                m_RoleInfo.SetNickName(ncb.NickName);

                tagRoleChangeEvent pEvent = new tagRoleChangeEvent();
                //MsgEventHandle.HandleMsg(pEvent);
            }
            tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Role_NickName_Sucess : UserOperateMessage.UOM_Role_NickName_Failed_3));

            //MsgEventHandle.HandleMsg(pUOM);
            return(true);
        }
Esempio n. 15
0
        public bool OnAcceptItemByGameID(UInt32 GameID, UInt32 ItemOnlyID, UInt32 ItemSum)
        {
            if (ItemSum == 0)
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_AcceptItem_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            tagItemInfo pInfo;

            if (!ItemMap.TryGetValue(ItemOnlyID, out pInfo))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_AcceptItem_Failed_2);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (pInfo.ItemOnlyID != ItemOnlyID || pInfo.ItemSum < ItemSum)
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_AcceptItem_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_AcceptItem_Failed_2);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (pConfig.ItemTypeID != EItemType.IT_GlobelBag)
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Item_AcceptItem_Failed_4);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            CL_Cmd_OnAcceptItem ncb = new CL_Cmd_OnAcceptItem();

            ncb.SetCmdType(NetCmdType.CMD_CL_OnAcceptItem);
            ncb.ItemOnlyID     = ItemOnlyID;
            ncb.ItemID         = pInfo.ItemID;
            ncb.ItemSum        = ItemSum;
            ncb.dwID           = GameID;
            ncb.GameIDorUserID = true;
            NetManager.Instance.Send <CL_Cmd_OnAcceptItem>(ncb);
            return(true);
        }
Esempio n. 16
0
        bool HandleRoleGetMonthCardReward(NetCmdBase obj)
        {
            LC_Cmd_GetMonthCardReward ncb = (LC_Cmd_GetMonthCardReward)obj;

            if (ncb.Result)
            {
                PlayerRole.Instance.RoleInfo.RoleMe.SetMonthCardRewardTime(SystemTime.Instance.GetSystemTimeTotalSecond());//领取时间记录为当前时间
            }
            tagUserOperationEvent pUOM = new tagUserOperationEvent(ncb.Result ? UserOperateMessage.UOM_Role_MonthCardReward_Sucess : UserOperateMessage.UOM_Role_MonthCardReward_Failed_3);
            //MsgEventHandle.HandleMsg(pUOM);

            //发送事件
            tagRoleMonthCardRewardEvent pEvent = new tagRoleMonthCardRewardEvent(ncb.Result);//参数玩家获得月卡奖励的事件

            //MsgEventHandle.HandleMsg(pEvent);

            return(true);
        }
Esempio n. 17
0
        bool HandleResetAccountName(NetCmdBase obj)
        {
            LC_Cmd_AccountResetAccount ncb = (LC_Cmd_AccountResetAccount)obj;

            if (ncb.Result)
            {
                //重置账号成功了
                PlayerRole.Instance.RoleInfo.RoleMe.SetAccountIsCanReset(false);

                //GlobalLogon.Instance.AccountData.LoadTempAccountInfo();
                // GlobalLogon.Instance.AccountData.SaveAccountData();


                //GlobalHallUIMgr.Instance.ChangeAccountSeccess();
            }
            tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Role_ResetAccount_Sucess : UserOperateMessage.UOM_Role_ResetAccount_Failed_5));

            // MsgEventHandle.HandleMsg(pUOM);
            return(true);
        }
Esempio n. 18
0
        bool HandleLCChangeRoleFaceID(NetCmdBase obj)
        {
            LC_Cmd_ChangeRoleFaceID ncb = (LC_Cmd_ChangeRoleFaceID)obj;

            m_RoleInfo.SetFaceID(ncb.dwFaceID);

            if (ncb.dwFaceID <= 100)
            {
                //系统头像
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_ChangeFace_Sucess);
                //MsgEventHandle.HandleMsg(pUOM);
            }
            else
            {
                //自定义头像
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Role_CustFace_Sucess);//使用用户头像成功
                //MsgEventHandle.HandleMsg(pUOM);
            }
            tagRoleChangeEvent pEvent = new tagRoleChangeEvent();

            //MsgEventHandle.HandleMsg(pEvent);
            return(true);
        }
Esempio n. 19
0
        public bool ChangeSecPassword(string OldPassword, string NewPassword)
        {
            //修改二级密码
            CL_Cmd_ChangeSecondPassword ncb = new CL_Cmd_ChangeSecondPassword();

            ncb.SetCmdType(NetCmdType.CMD_CL_ChangeSecondPassword);

            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, OldPassword, StringCheckType.SCT_Password))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_1);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, NewPassword, StringCheckType.SCT_Password))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_2);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }
            if (NewPassword.CompareTo(OldPassword) == 0)
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_3);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }

            NormalAccountInfo ad1 = new NormalAccountInfo();

            if (!NativeInterface.ComputeCrc("", OldPassword, out ad1.CRC1, out ad1.CRC2, out ad1.CRC3))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_4);
                // MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }

            NormalAccountInfo ad2 = new NormalAccountInfo();

            if (!NativeInterface.ComputeCrc("", NewPassword, out ad2.CRC1, out ad2.CRC2, out ad2.CRC3))
            {
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_5);
                //MsgEventHandle.HandleMsg(pUOM);
                return(false);
            }

            //GlobalLogon.Instance.AccountData.SaveAccountData();

            ncb.dwOldCrc1 = ad1.CRC1;
            ncb.dwOldCrc2 = ad1.CRC2;
            ncb.dwOldCrc3 = ad1.CRC3;

            ncb.dwNewCrc1 = ad2.CRC1;
            ncb.dwNewCrc2 = ad2.CRC2;
            ncb.dwNewCrc3 = ad2.CRC3;

            /*GlobalLogon.Instance.AccountData.TempPhoneInfo.Clear();
             * GlobalLogon.Instance.AccountData.TempAccountInfo.Clear();
             * GlobalLogon.Instance.AccountData.TempAccountInfo.UID = GlobalLogon.Instance.AccountData.AccountInfo.UID;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC1 = ad2.CRC1;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC2 = ad2.CRC2;
             * GlobalLogon.Instance.AccountData.TempAccountInfo.CRC3 = ad2.CRC3;*/

            //NetServices.Instance.Send<CL_Cmd_ChangeSecondPassword>(ncb);

            return(true);
        }
Esempio n. 20
0
        public TableError IsCanJoinTable(Byte TableType, bool IsShowErrorID)
        {
            if (!FishConfig.Instance.m_TableInfo.m_TableConfig.ContainsKey(TableType))
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_IsNotExists);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_1);
                //MsgEventHandle.HandleMsg(pUOM);

                return(TableError.TE_IsNotExists);
            }

            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinLevel != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetLevel() < FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinLevel)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MinLevel);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_9);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MinLevel);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxLevel != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetLevel() > FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxLevel)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MaxLevel);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_10);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MaxLevel);
            }

            if (!int256Function.GetBitStates(PlayerRole.Instance.RoleInfo.RoleMe.GetRateValue(), FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinRate))
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_RateError);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_8);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_RateError);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinGlobelSum != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinGlobelSum)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MinGlobel);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_2);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MinGlobel);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxGlobelSum != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() > FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxGlobelSum)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MaxGlobel);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_3);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MaxGlobel);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinCurreySum != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetCurrency() < FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinCurreySum)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MinCurrcey);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_4);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MinCurrcey);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxCurreySum != 0xffffffff && PlayerRole.Instance.RoleInfo.RoleMe.GetCurrency() > FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxCurreySum)
            {
                if (!IsShowErrorID)
                {
                    return(TableError.TE_MaxCurrcey);
                }
                tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_5);
                //MsgEventHandle.HandleMsg(pUOM);
                return(TableError.TE_MaxCurrcey);
            }
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Count > 0)
            {
                for (int i = 0; i < FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Count; ++i)
                {
                    UInt32 ItemID  = FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Keys.ElementAt <UInt32>(i);
                    UInt32 ItemSum = FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Values.ElementAt <UInt32>(i);
                    if (PlayerRole.Instance.ItemManager.GetItemSum(ItemID) < ItemSum)
                    {
                        if (!IsShowErrorID)
                        {
                            return(TableError.TE_ItemError);
                        }
                        tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Table_JoinTable_Failed_6);
                        //MsgEventHandle.HandleMsg(pUOM);
                        return(TableError.TE_ItemError);
                    }
                }
            }
            return(TableError.TE_Sucess);
        }