Retrieves the title-specific custom data for the user which is readable and writable by the client
Inheritance: Command
コード例 #1
0
        public static UserData GetUserData()
        {
            GetUserDataCommand command = new GetUserDataCommand();

            command.EMail = EMAIL;
            command.Hash  = HASH;

            return(JsonConvert.DeserializeObject <UserData>(TCPManager.SendRequest(JsonConvert.SerializeObject(command))));
        }
コード例 #2
0
        public async Task <CommandResult <InputUserDataResult> > GetUsers([FromServices] GetUserDataCommand _getUserDataCommand, string siteId, string cookieSessionId = null)
        {
            var userInput = new UserInput <GetUserDataInput>
            {
                Data = new GetUserDataInput {
                    SiteId = siteId
                },
                UserId = User?.GetUserId()
            };

            var result =
                await Business
                .InvokeAsync <GetUserDataCommand, UserInput <GetUserDataInput>, CommandResult <InputUserDataResult> >(
                    _getUserDataCommand, userInput).ConfigureAwait(false);

            return(result);
        }
コード例 #3
0
        private static string GetUserData(string CommandPara)
        {
            SQLManager.Connection.Close();

            UserData           Result  = new UserData();
            GetUserDataCommand Command = new GetUserDataCommand();

            Command = JsonConvert.DeserializeObject <GetUserDataCommand>(CommandPara);

            if (CheckUserData(Command.EMail, Command.Hash) == false)
            {
                Result.statusCode = 270;
                return(JsonConvert.SerializeObject(Result));
            }

            using (MySqlCommand mysqlCommand = SQLManager.Connection.CreateCommand())
            {
                SQLManager.Connection.Open();
                mysqlCommand.CommandText = "SELECT UID, Firstname, Lastname, Gender, HasSelected, HasActivated FROM users WHERE EMail='" + Command.EMail + "'";

                MySqlDataReader mysqlreader;

                mysqlreader = mysqlCommand.ExecuteReader();


                if (mysqlreader.Read())
                {
                    Result.UID          = mysqlreader.GetInt32("UID");
                    Result.Firstname    = mysqlreader.GetString("Firstname");
                    Result.Lastname     = mysqlreader.GetString("Lastname");
                    Result.Gender       = mysqlreader.GetString("Gender");
                    Result.HasActivated = mysqlreader.GetBoolean("HasActivated");
                    Result.HasSelected  = mysqlreader.GetBoolean("HasSelected");
                }

                mysqlreader.Close();

                SQLManager.Connection.Close();

                Result.statusCode = 201;

                return(JsonConvert.SerializeObject(Result));
            }
        }
コード例 #4
0
ファイル: Commands.cs プロジェクト: huangjk/uGameFramework
 protected void GetUserDataCommandHandler(GetUserDataCommand cmd)
 {
     _backendService.GetUserData(cmd.UserID, cmd.Fields);
 }