当前位置: 首页>>代码示例>>C#>>正文


C# ClientPackets类代码示例

本文整理汇总了C#中ClientPackets的典型用法代码示例。如果您正苦于以下问题:C# ClientPackets类的具体用法?C# ClientPackets怎么用?C# ClientPackets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ClientPackets类属于命名空间,在下文中一共展示了ClientPackets类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CharacterInfo

        public CharacterInfo(ClientPackets.NewCharacter p, MirConnection c)
        {
            Name = p.Name;
            Class = p.Class;
            Gender = p.Gender;

            CreationIP = c.IPAddress;
            CreationDate = SMain.Envir.Now;
        }
开发者ID:Shamwow2,项目名称:mir2,代码行数:9,代码来源:CharacterInfo.cs

示例2: RegisterResponse

 private void RegisterResponse(ClientPackets packet)
 {
     if (!this.IsDisposed)
     {
         if (packet == ClientPackets.RegisterAccept)
         {
             if (MessageBox.Show(Program.LanguageManager.Translation.RegistMsb4) == System.Windows.Forms.DialogResult.OK)
             {
                 DialogResult = System.Windows.Forms.DialogResult.OK;
             }
         }
         else if (packet == ClientPackets.RegisterFailed)
         {
             MessageBox.Show(Program.LanguageManager.Translation.RegistMsb5);
         }
     }
 }
开发者ID:Belmakar,项目名称:DevProLauncher,代码行数:17,代码来源:Register_frm.cs

示例3: LoginResponse

        private void LoginResponse(ClientPackets type, LoginData data)
        {
            if (type == ClientPackets.Banned)
            {
                if (ResetTimeout != null)
                    ResetTimeout();
                MessageBox.Show("You are banned.");
            }
            else if (type == ClientPackets.LoginFailed)
            {
                if (ResetTimeout != null)
                    ResetTimeout();
                MessageBox.Show("Incorrect Password or Username.");
            }
            else
            {
                _userInfo.Username = _username;
                _userInfo.LoginKey = data.LoginKey.ToString();
                _userInfo.Rank = data.UserRank;

                if (NotifyLogin != null)
                    NotifyLogin();
            }
        }
开发者ID:Belmakar,项目名称:DevProLauncher,代码行数:24,代码来源:Authenticator.cs

示例4: ChangePassword

        public void ChangePassword(ClientPackets.ChangePassword p, MirConnection c)
        {
            if (!Settings.AllowChangePassword)
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 0});
                return;
            }

            if (!AccountIDReg.IsMatch(p.AccountID))
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 1});
                return;
            }

            if (!PasswordReg.IsMatch(p.CurrentPassword))
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 2});
                return;
            }

            if (!PasswordReg.IsMatch(p.NewPassword))
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 3});
                return;
            }

            AccountInfo account = GetAccount(p.AccountID);

            if (account == null)
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 4});
                return;
            }

            if (account.Banned)
            {
                if (account.ExpiryDate > Now)
                {
                    c.Enqueue(new ServerPackets.ChangePasswordBanned {Reason = account.BanReason, ExpiryDate = account.ExpiryDate});
                    return;
                }
                account.Banned = false;
            }
            account.BanReason = string.Empty;
            account.ExpiryDate = DateTime.MinValue;

            if (String.CompareOrdinal(account.Password, p.CurrentPassword) != 0)
            {
                c.Enqueue(new ServerPackets.ChangePassword {Result = 5});
                return;
            }

            account.Password = p.NewPassword;
            c.Enqueue(new ServerPackets.ChangePassword {Result = 6});
        }
开发者ID:nerestaren,项目名称:mir2,代码行数:55,代码来源:Envir.cs

示例5: NewAccount

        public void NewAccount(ClientPackets.NewAccount p, MirConnection c)
        {
            if (!Settings.AllowNewAccount)
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 0});
                return;
            }

            if (!AccountIDReg.IsMatch(p.AccountID))
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 1});
                return;
            }

            if (!PasswordReg.IsMatch(p.Password))
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 2});
                return;
            }
            if (!string.IsNullOrWhiteSpace(p.EMailAddress) && !EMailReg.IsMatch(p.EMailAddress) ||
                p.EMailAddress.Length > 50)
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 3});
                return;
            }

            if (!string.IsNullOrWhiteSpace(p.UserName) && p.UserName.Length > 20)
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 4});
                return;
            }

            if (!string.IsNullOrWhiteSpace(p.SecretQuestion) && p.SecretQuestion.Length > 30)
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 5});
                return;
            }

            if (!string.IsNullOrWhiteSpace(p.SecretAnswer) && p.SecretAnswer.Length > 30)
            {
                c.Enqueue(new ServerPackets.NewAccount {Result = 6});
                return;
            }

            lock (AccountLock)
            {
                if (AccountExists(p.AccountID))
                {
                    c.Enqueue(new ServerPackets.NewAccount {Result = 7});
                    return;
                }

                AccountList.Add(new AccountInfo(p) {Index = ++NextAccountID, CreationIP = c.IPAddress});

                c.Enqueue(new ServerPackets.NewAccount {Result = 8});
            }
        }
开发者ID:nerestaren,项目名称:mir2,代码行数:57,代码来源:Envir.cs

示例6: AccountInfo

        public AccountInfo(C.NewAccount p)
        {
            AccountID = p.AccountID;
            Password = p.Password;
            UserName = p.UserName;
            SecretQuestion = p.SecretQuestion;
            SecretAnswer = p.SecretAnswer;
            EMailAddress = p.EMailAddress;

            BirthDate = p.BirthDate;
            CreationDate = SMain.Envir.Now;
        }
开发者ID:Ilmarinen946,项目名称:mir2,代码行数:12,代码来源:AccountInfo.cs

示例7: MergeItem

        private void MergeItem(C.MergeItem p)
        {
            if (Stage != GameStage.Game) return;

            Player.MergeItem(p.GridFrom, p.GridTo, p.IDFrom, p.IDTo);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例8: GuildInvite

        private void GuildInvite(C.GuildInvite p)
        {
            if (Stage != GameStage.Game) return;

            Player.GuildInvite(p.AcceptInvite);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例9: MarketSearch

        private void MarketSearch(C.MarketSearch p)
        {
            if (Stage != GameStage.Game) return;

            Player.MarketSearch(p.Match);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例10: NewCharacter

        private void NewCharacter(C.NewCharacter p)
        {
            if (Stage != GameStage.Select) return;

            SMain.Envir.NewCharacter(p, this);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例11: DeleteMail

        public void DeleteMail(C.DeleteMail p)
        {
            if (Stage != GameStage.Game) return;

            Player.DeleteMail(p.MailID);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例12: IntelligentCreaturePickup

        //IntelligentCreature
        private void IntelligentCreaturePickup(C.IntelligentCreaturePickup p)
        {
            if (Stage != GameStage.Game) return;

            Player.IntelligentCreaturePickup(p.MouseMode, p.Location);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:7,代码来源:MirConnection.cs

示例13: Login

        private void Login(C.Login p)
        {
            if (Stage != GameStage.Login) return;

            SMain.Envir.Login(p, this);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs

示例14: Harvest

        private void Harvest(C.Harvest p)
        {
            if (Stage != GameStage.Game) return;

            if (!Player.Dead && Player.ActionTime > SMain.Envir.Time)
                _retryList.Enqueue(p);
            else
                Player.Harvest(p.Direction);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:9,代码来源:MirConnection.cs

示例15: Inspect

        private void Inspect(C.Inspect p)
        {
            if (Stage != GameStage.Game) return;

            Player.Inspect(p.ObjectID);
        }
开发者ID:Roborius,项目名称:mir2,代码行数:6,代码来源:MirConnection.cs


注:本文中的ClientPackets类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。