示例#1
0
 public async Task UnBan(string Studio, string Token, string TokenPlayer)
 {
     if (await Player.UnBanPlayer(Studio, Token, TokenPlayer) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#2
0
 public async Task AddEmail(string Token, string Studio, string TokenPlayer, string Email)
 {
     if (await Player.AddEmail(Token, Studio, TokenPlayer, Email) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#3
0
 public async Task ResetLeaderboard(string Token, string Studio, string NameLeaderboard)
 {
     if (await Leaderboard.Reset(Token, Studio, NameLeaderboard) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#4
0
 public async Task RemovePlayerAchievements(string Token, string Studio, string TokenPlayer, string Detail)
 {
     if (await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         if (await ModelAchievements.Remove(Token, Studio, ObjectId.Parse(TokenPlayer), BsonDocument.Parse(Detail)))
         {
             Response.StatusCode = Ok().StatusCode;
         }
         else
         {
             Response.StatusCode = BadRequest().StatusCode;
         }
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#5
0
        public async Task <string> ReciveLeaderboardSetting(string Token, string Studio, string NameLeaderboard)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Read))
            {
                var result = await LeaderboardModel.SettingLeaderboard(Token, Studio, NameLeaderboard);

                if (result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }
                return(result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#6
0
        public async Task <string> ReciveBackups(string Token, string Studio, string NameLeaderboard, string Count)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Read))
            {
                var Result = await Leaderboard.ReciveBackup(Token, Studio, NameLeaderboard, int.Parse(Count));

                if (Result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }
                return(Result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#7
0
        /// <summary>
        /// Return PlayerAccount
        /// </summary>
        public async Task <string> Token(string Token, string Studio, string TokenPlayer)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Write))
            {
                var Result = await Player.LoginPlayer(Token, Studio, TokenPlayer);

                if (Result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }
                return(Result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#8
0
        public async Task <string> PlayerAchievements(string Token, string Studio, string TokenPlayer)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Write))
            {
                var Result = await ModelAchievements.PlayerAchievements(Token, Studio, ObjectId.Parse(TokenPlayer));

                if (Result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }

                return(Result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#9
0
        public async Task <string> ListAchievements(string Studio, string Token)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Read))
            {
                var Result = await ModelAchievements.ReciveAchievements(Token, Studio);

                if (Result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }

                return(Result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#10
0
        public async Task <string> Token(string Token, string Studio, string Username, string Password)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Write))
            {
                var Result = await Player.CreatPlayer(Token, Studio, Username, Password);

                if (Result.Length >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }

                return(Result);
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#11
0
        public async Task <string> ReciveStatices(string Token, string Studio)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Read))
            {
                var result = await Dashboard.ReciveDetail(Token, Studio);

                if (result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }

                return(result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#12
0
        public async Task <string> SearchPlayerUsername(string Token, string Studio, string Username)
        {
            if (await BasicAPIs.ReadWriteControll(Studio, API.Read))
            {
                var result = await Player.SearchUsername(Token, Studio, Username);

                if (result.ElementCount >= 1)
                {
                    Response.StatusCode = Ok().StatusCode;
                }
                else
                {
                    Response.StatusCode = BadRequest().StatusCode;
                }

                return(result.ToString());
            }
            else
            {
                Response.StatusCode = BadRequest().StatusCode;
                return(new BsonDocument().ToString());
            }
        }
示例#13
0
 public async Task AddPlayer(string Token, string Studio, string TokenPlayer, string NameLeaderboard, string Value)
 {
     if (await LeaderboardModel.Add(Token, Studio, TokenPlayer, NameLeaderboard, Value) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#14
0
 public async Task AddPassword(string Token, string Studio, string TokenPlayer, string OldPassword, string NewPassword)
 {
     if (await Player.AddPassword(Token, Studio, TokenPlayer, OldPassword, NewPassword) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#15
0
 public async Task AddLogPlayer(string Token, string Studio, string TokenPlayer, string Header, string Description)
 {
     if (await Player.AddLogPlayer(Token, Studio, TokenPlayer, Header, Description) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }
示例#16
0
 public async Task AddLog(string Token, string Studio, string Header, string Description, string Detail, string IsNotification)
 {
     if (await Log.AddLog(Token, Studio, Header, Description, Detail, IsNotification) && await BasicAPIs.ReadWriteControll(Studio, API.Write))
     {
         Response.StatusCode = Ok().StatusCode;
     }
     else
     {
         Response.StatusCode = BadRequest().StatusCode;
     }
 }