예제 #1
0
파일: Account.cs 프로젝트: tuita520/GDNET
 /// <summary>
 /// Gets an account from the servers.
 /// </summary>
 /// <param name="userId">The account ID of the user.</param>
 /// <returns>An account.</returns>
 public static Account Get(int userId) =>
 RobtopAnalyzer.DeserializeObject <Account>(WebRequestClient.SendRequest(new WebRequest
 {
     Url     = "http://boomlings.com/database/getGJUserInfo20.php",
     Content = new FormUrlEncodedContent(new Dictionary <string, string>
     {
         { "targetAccountID", userId.ToString() },
         { "secret", "Wmfd2893gb7" }
     })
 }));
예제 #2
0
        /// <summary>
        /// A method to login to an account, creating a <see cref="UserAccount" /> object.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password</param>
        /// <returns>A user account, if successful.</returns>
        public static UserAccount Login(string username, string password)
        {
            var response = WebRequestClient.SendRequest(new WebRequest
            {
                Url     = @"http://boomlings.com/database/accounts/loginGJAccount.php",
                Content = new FormUrlEncodedContent(new Dictionary <string, string>
                {
                    { "userName", username },
                    { "password", password },
                    { "secret", "Wmfv3899gc9" },
                    { "udid", "GDNET" }
                }),
                Method = HttpMethod.Post
            });

            return(RobtopAnalyzer.DeserializeObject <UserAccount>(GetString(int.Parse(response.Split(',')[0]))));
        }