Created
November 3, 2014 18:59
-
-
Save AriDEV/0b3141b507de12523070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.../Server/AuthServer/Commands/AccountCommands.cs | 29 ++++++++++++++++++++++ | |
1 file changed, 29 insertions(+) | |
diff --git a/Projects/Server/AuthServer/Commands/AccountCommands.cs b/Projects/Server/AuthServer/Commands/AccountCommands.cs | |
index a660ac1..e97edb3 100644 | |
--- a/Projects/Server/AuthServer/Commands/AccountCommands.cs | |
+++ b/Projects/Server/AuthServer/Commands/AccountCommands.cs | |
@@ -122,5 +122,34 @@ namespace AuthServer.Commands | |
Log.Message(LogType.Error, "Account '{0}' doesn't exist.", account.Email); | |
} | |
} | |
+ | |
+ [ConsoleCommand("DeleteGameAccount", "")] | |
+ public static void DeleteGameAccount(string[] args) | |
+ { | |
+ var email = Command.Read<string>(args, 0); | |
+ var game = Command.Read<string>(args, 1); | |
+ var index = Command.Read<byte>(args, 2); | |
+ | |
+ if (email != "" && game != "" && index != 0) | |
+ { | |
+ var account = DB.Auth.Single<Account>(a => a.Email == email); | |
+ | |
+ if (account != null) | |
+ { | |
+ var exists = account.GameAccounts != null ? account.GameAccounts.Any(ga => ga.Game == game && ga.Index == index) : false; | |
+ | |
+ if (exists) | |
+ { | |
+ if (DB.Auth.Delete<Account>(gameAccount)) | |
+ Log.Message(LogType.Normal, "GameAccount '{0}{1}' for Account '{2}' successfully deleted.", game, index, email); | |
+ else | |
+ Log.Message(LogType.Error, "GameAccount '{0}{1}' for Account '{2}' failed to delete.", game, index, email); | |
+ } | |
+ } | |
+ else | |
+ Log.Message(LogType.Error, "GameAccount '{0}{1}' for Account '{2}' doesn't exist.", game, index, email); | |
+ } | |
+ } | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment