• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Accounts.Account类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateAccount

        public static Account CreateAccount(string email, string password)
        {
            var account = new Account(email, password);
            Accounts.Add(email, account);
            account.SaveToDB();

            return account;
        }
开发者ID:rosebud,项目名称:mooege,代码行数:8,代码来源:AccountManager.cs


示例2: CreateAccount

        public static Account CreateAccount(string email, string password, Account.UserLevels userLevel = Account.UserLevels.User)
        {
            var account = new Account(email, password, userLevel);
            Accounts.Add(email, account);
            account.SaveToDB();

            return account;
        }
开发者ID:wow4all,项目名称:mooege,代码行数:8,代码来源:AccountManager.cs


示例3: AreFriends

 public static bool AreFriends(Account account1, Account account2)
 {
     foreach (var friend in Friends[account1.BnetEntityId.Low])
     {
         if (friend.Id.Low == account2.BnetEntityId.Low)
             return true;
     }
     return false;
 }
开发者ID:God601,项目名称:mooege,代码行数:9,代码来源:FriendManager.cs


示例4: InvitationExists

 public static bool InvitationExists(Account inviter, Account invitee)
 {
     foreach (var invitation in OnGoingInvitations.Values)
     {
         if ((invitation.InviterIdentity.AccountId == inviter.BnetEntityId) && (invitation.InviteeIdentity.AccountId == invitee.BnetEntityId))
             return true;
     }
     return false;
 }
开发者ID:God601,项目名称:mooege,代码行数:9,代码来源:FriendManager.cs


示例5: CreateAccount

        public static Account CreateAccount(string email, string password, string battleTag, Account.UserLevels userLevel = Account.UserLevels.User)
        {
            var hashCode = AccountManager.GetUnusedHashCodeForBattleTag(battleTag);
            var account = new Account(email, password, battleTag, hashCode, userLevel);
            Accounts.Add(email, account);
            account.SaveToDB();

            return account;
        }
开发者ID:God601,项目名称:mooege,代码行数:9,代码来源:AccountManager.cs


示例6: SendFriends

        private void SendFriends(Account account)
        {
            if (!_friends.ContainsKey(account.BnetAccountID)) return;
            var friends = _friends[account.BnetAccountID];

            foreach (var friend in friends)
            {

            }
        }
开发者ID:sexywop,项目名称:mooege,代码行数:10,代码来源:FriendManager.cs


示例7: GetAccountByEmail

        public static Account GetAccountByEmail(string email)
        {
            Account account;

            if (Accounts.ContainsKey(email))
                account = Accounts[email];
            else
            {
                account = new Account(email);
                Accounts.Add(email, account);
                account.SaveToDB();
            }

            return account;
        }
开发者ID:Rianon,项目名称:mooege,代码行数:15,代码来源:AccountManager.cs


示例8: LoadAccounts

        private static void LoadAccounts()
        {
            var query = "SELECT * from accounts";
            var cmd = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows) return;

            while (reader.Read())
            {
                var databaseId = (ulong)reader.GetInt64(0);
                var email = reader.GetString(1);
                var account = new Account(databaseId, email);
                Accounts.Add(email, account);
            }
        }
开发者ID:Rianon,项目名称:mooege,代码行数:16,代码来源:AccountManager.cs


示例9: DeleteAccount

        public static bool DeleteAccount(Account account)
        {
            if (account == null) return false;
            if (!Accounts.ContainsKey(account.Email)) return false;

            try
            {
                var query = string.Format("DELETE from accounts where id={0}", account.PersistentID);
                var cmd = new SQLiteCommand(query, DBManager.Connection);
                cmd.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                Logger.ErrorException(e, "DeleteAccount()");
                return false;
            }

            Accounts.Remove(account.Email);
            // we should be also disconnecting the account if he's online. /raist.

            return true;
        }
开发者ID:God601,项目名称:mooege,代码行数:22,代码来源:AccountManager.cs


示例10: CreateAccount

        public static Account CreateAccount(string email, string password, string battleTag, Account.UserLevels userLevel = Account.UserLevels.User)
        {
            if (password.Length > 16) password = password.Substring(0, 16); // make sure the password does not exceed 16 chars.
            var hashCode = GetRandomHashCodeForBattleTag();
            var salt = SRP6a.GetRandomBytes(32);
            var passwordVerifier = SRP6a.CalculatePasswordVerifierForAccount(email, password, salt);


            var newDBAccount = new DBAccount
                                   {
                                       Email = email,
                                       Salt = salt,
                                       PasswordVerifier = passwordVerifier,
                                       BattleTagName = battleTag,
                                       UserLevel = userLevel,
                                       HashCode = hashCode
                                   };


            DBSessions.AccountSession.SaveOrUpdate(newDBAccount);
            DBSessions.AccountSession.Flush();

            return GetAccountByDBAccount(newDBAccount);
        }
开发者ID:loonbg,项目名称:mooege,代码行数:24,代码来源:AccountManager.cs


示例11: SetField

        private void SetField(Account owner)
        {
            this.Owner = owner;
            this.OwnerIdField.Value = owner.BnetEntityId;
            var bnetGameAccountHigh = ((ulong)EntityIdHelper.HighIdType.GameAccountId) + (0x6200004433);
            this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh(bnetGameAccountHigh).SetLow(this.PersistentID).Build();
            this.D3GameAccountId = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(bnetGameAccountHigh).SetIdLow(this.PersistentID).Build();

            //TODO: Now hardcode all game account notifications to D3
            this.ProgramField.Value = "D3";
            this.GameAccountNameField.Value = Owner.BnetEntityId.Low.ToString() + "#1";
            this.BattleTagField.Value = this.Owner.BattleTag;

            this.Achievements = new List<bnet.protocol.achievements.AchievementUpdateRecord>();
            this.AchievementCriteria = new List<bnet.protocol.achievements.CriteriaUpdateRecord>();

        }
开发者ID:God601,项目名称:mooege,代码行数:17,代码来源:GameAccount.cs


示例12: LoadAccounts

        private static void LoadAccounts()
        {
            var query = "SELECT * from accounts";
            var cmd = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows) return;

            while (reader.Read())
            {
                var accountId = (ulong)reader.GetInt64(0);
                var email = reader.GetString(1);

                var salt = new byte[32];
                var readBytes = reader.GetBytes(2, 0, salt, 0, 32);

                var passwordVerifier = new byte[128];
                readBytes = reader.GetBytes(3, 0, passwordVerifier, 0, 128);

                var battleTagName = reader.GetString(4);

                var hashCode = reader.GetInt32(5);

                var userLevel = reader.GetByte(6);

                var account = new Account(accountId, email, salt, passwordVerifier, battleTagName, hashCode, (Account.UserLevels)userLevel);
                Accounts.Add(email, account);
            }
        }
开发者ID:avatar21,项目名称:mooege,代码行数:29,代码来源:AccountManager.cs


示例13: SetFields

        private void SetFields(string name, int hashCode, ToonClass @class, ToonFlags flags, byte level, Account owner,uint timePlayed)
        {
            this.ToonHandle = new ToonHandleHelper(this.PersistentID);
            this.D3EntityID = this.ToonHandle.ToD3EntityID();
            this.BnetEntityID = this.ToonHandle.ToBnetEntityID();
            this.Name = name;
            this.HashCode = hashCode;
            this.HashCodeString = HashCode.ToString("D3");
            this.Class = @class;
            this.Flags = flags;
            this.Level = level;
            this.Owner = owner;
            this.TimePlayed = timePlayed;

            var visualItems = new[]
            {                                
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Head
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Chest
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Feet
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Hands
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Weapon (1)
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Weapon (2)
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Shoulders
                D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Legs
            };

            this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build();

        }
开发者ID:keltins,项目名称:mooege,代码行数:29,代码来源:Toon.cs


示例14: CommandGroupAttribute

 public CommandGroupAttribute(string name, string help, Account.UserLevels minUserLevel = Account.UserLevels.User)
 {
     this.Name = name.ToLower();
     this.Help = help;
     this.MinUserLevel = minUserLevel;
 }
开发者ID:wow4all,项目名称:mooege,代码行数:6,代码来源:CommandAttribute.cs


示例15: GetToonsForAccount

 public static Dictionary<ulong, Toon> GetToonsForAccount(Account account)
 {
     return Toons.Where(pair => pair.Value.Owner != null).Where(pair => pair.Value.Owner.PersistentID == account.PersistentID).ToDictionary(pair => pair.Key, pair => pair.Value);
 }
开发者ID:wow4all,项目名称:mooege,代码行数:4,代码来源:ToonManager.cs


示例16: LoadAccounts

        private static void LoadAccounts()
        {
            var query = "SELECT * from accounts";
            var cmd = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows) return;

            while (reader.Read())
            {
                var accountId = (ulong)reader.GetInt64(0);
                var email = reader.GetString(1);

                var salt = new byte[32];
                var readBytes = reader.GetBytes(2, 0, salt, 0, 32);

                var passwordVerifier = new byte[128];
                readBytes = reader.GetBytes(3, 0, passwordVerifier, 0, 128);

                var battleTagName = reader.GetString(4);

                var hashCode = reader.GetInt32(5);

                var userLevel = reader.GetByte(6);

                //Don't set all values in c-tor. 
                var account = new Account(accountId, email, salt, passwordVerifier, battleTagName, hashCode, (Account.UserLevels)userLevel);

                if (!reader.IsDBNull(7))
                {
                    var lastSelectedHeroId = reader.GetInt64(7);
                    account.LastSelectedHeroField.Value = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId + (ulong)lastSelectedHeroId).SetIdLow((ulong)lastSelectedHeroId).Build();
                }

                Accounts.Add(email, account);
            }
        }
开发者ID:vrobel,项目名称:mooege,代码行数:37,代码来源:AccountManager.cs


示例17: CommandAttribute

 public CommandAttribute(string command, string help, Account.UserLevels minUserLevel = Account.UserLevels.User)
 {
     this.Name = command.ToLower();
     this.Help = help;
     this.MinUserLevel = minUserLevel;
 }
开发者ID:wow4all,项目名称:mooege,代码行数:6,代码来源:CommandAttribute.cs


示例18: Toon

 public Toon(string name, int classId, ToonFlags flags, byte level, Account account) // Toon with **newly generated** persistent ID
     : base(StringHashHelper.HashIdentity(name))
 {
     this.SetFields(name, GetClassByID(classId), flags, level, account);
 }
开发者ID:zicnic,项目名称:d3sharp,代码行数:5,代码来源:Toon.cs


示例19: LoadAccounts

        private static void LoadAccounts()
        {
            var query = "SELECT * FROM accounts";
            var cmd = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows) return;

            while (reader.Read())
            {
                var accountId = Convert.ToUInt64(reader["id"]);
                var email = Convert.ToString(reader["email"]);

                var salt = new byte[32];
                var readBytes = reader.GetBytes(2, 0, salt, 0, 32);

                var passwordVerifier = new byte[128];
                readBytes = reader.GetBytes(3, 0, passwordVerifier, 0, 128);

                var battleTagName = Convert.ToString(reader["battletagname"]);
                var hashCode = Convert.ToInt32(reader["hashCode"]);
                var userLevel = Convert.ToByte(reader["userLevel"]);

                var account = new Account(accountId, email, salt, passwordVerifier, battleTagName, hashCode, (Account.UserLevels)userLevel);
                account.LastOnlineField.Value = Convert.ToInt64(reader["LastOnline"]);
                Accounts.Add(email, account);
            }
        }
开发者ID:God601,项目名称:mooege,代码行数:28,代码来源:AccountManager.cs


示例20: AddFriendshipToDB

        private static void AddFriendshipToDB(Account inviter, Account invitee)
        {
            try
            {
                var query = string.Format("INSERT INTO friends (accountId, friendId) VALUES({0},{1}); INSERT INTO friends (accountId, friendId) VALUES({2},{3});", inviter.BnetEntityId.Low, invitee.BnetEntityId.Low, invitee.BnetEntityId.Low, inviter.BnetEntityId.Low);

                var cmd = new SQLiteCommand(query, DBManager.Connection);
                cmd.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                Logger.ErrorException(e, "FriendManager.AddFriendshipToDB()");
            }
        }
开发者ID:avatar21,项目名称:mooege,代码行数:14,代码来源:FriendManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GS.GameClient类代码示例发布时间:2022-05-26
下一篇:
C# Ticker.TickTimer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap