コード例 #1
0
        public ProfileDBO CreateProfile(string username, string passwordEncrypted, ulong steamId, string email, string country, IPAddress address)
        {
            var data = new ProfileDBO()
            {
                Name        = username,
                LastIp      = address.ToString(),
                Country     = country,
                Passwordenc = passwordEncrypted,
                Email       = email,
                SteamId     = steamId,
                Score1v1    = 1000,
                Score2v2    = 1000,
                Score3v3    = 1000,
                Modified    = DateTime.UtcNow.Ticks
            };

            var idBson = ProfilesTable.Insert(data);

            data.Id = idBson.AsInt64;


            ProfilesTable.Update(data);

            return(data);
        }
コード例 #2
0
        public static void UpdateProfilesCache(ProfileDBO profile)
        {
            var idString = profile.Id.ToString();

            if (ProfilesByIdCache.Contains(idString))
            {
                ProfilesByIdCache.Remove(idString, CacheEntryRemovedReason.Removed);
            }

            ProfilesByIdCache.Add(new CacheItem(idString, profile), new CacheItemPolicy()
            {
                SlidingExpiration = TimeSpan.FromMinutes(25)
            });
        }
コード例 #3
0
 internal static long Score3v3Selector(ProfileDBO state)
 {
     return(state.Score3v3);
 }
コード例 #4
0
 internal static void Score3v3Updated(ProfileDBO state, long value)
 {
     state.Score3v3 = value;
 }
コード例 #5
0
 public void UpdateProfileData(ProfileDBO stats)
 {
     ProfilesTable.Update(stats);
 }
コード例 #6
0
        private static string GenerateResponseValueWithEmail(ref LoginSocketState state, ref ProfileDBO clientData)
        {
            string value = state.PasswordEncrypted;

            value += new String(' ', 48);
            value += state.Name + "@" + (state.Email ?? clientData.Email);
            value += state.ClientChallenge;
            value += state.ServerChallenge;
            value += state.PasswordEncrypted;

            return(value.ToMD5());
        }