Guest User

Untitled

a guest
Feb 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. Index: src/com/kongregate/http/HttpMethodWrapper.java
  2. ===================================================================
  3. --- src/com/kongregate/http/HttpMethodWrapper.java (revision 12199)
  4. +++ src/com/kongregate/http/HttpMethodWrapper.java (working copy)
  5. @@ -155,14 +155,15 @@
  6. * Creates an HttpMethod for banning the given user AS the user with the given session lookup key
  7. * SessionID must belong to a moderator or greater.
  8. */
  9. - public static HttpMethodWrapper createBanMethod( String sessionLookupKey, String username, int minutes ){
  10. + public static HttpMethodWrapper createBanMethod( String sessionLookupKey, String username, int minutes, String reason ){
  11. // Format is: /accounts/<username>/ban
  12. String url = URL.getBaseURL() + "/accounts/" + username + "/ban_internal";
  13. PostMethod method = createPostMethod( url );
  14. NameValuePair[] request = {
  15. createAdminKeyPair(),
  16. new NameValuePair("uid", sessionLookupKey),
  17. - new NameValuePair("duration", String.valueOf( minutes ) )
  18. + new NameValuePair("duration", String.valueOf( minutes ) ),
  19. + new NameValuePair("reason", reason )
  20. };
  21. method.setRequestBody(request);
  22. int[] acceptedCodes = { HttpStatus.SC_OK };
  23. @@ -174,7 +175,7 @@
  24. * Creates an HttpMethod for banning the given user AS the user with the given session lookup key
  25. * SessionID must belong to a moderator or greater.
  26. */
  27. - public static HttpMethodWrapper createSilenceMethod( String sessionLookupKey, String username, int minutes ){
  28. + public static HttpMethodWrapper createSilenceMethod( String sessionLookupKey, String username, int minutes, String reason ){
  29. // Format is: /silencings.json
  30. String url = URL.getBaseURL() + "/silencings.json";
  31. PostMethod method = createPostMethod( url );
  32. @@ -182,7 +183,8 @@
  33. createAdminKeyPair(),
  34. new NameValuePair("username", username),
  35. new NameValuePair("uid", sessionLookupKey),
  36. - new NameValuePair("duration", String.valueOf( minutes ) )
  37. + new NameValuePair("duration", String.valueOf( minutes ) ),
  38. + new NameValuePair("reason", reason )
  39. };
  40. method.setRequestBody(request);
  41. int[] acceptedCodes = { HttpStatus.SC_OK };
  42. Index: src/com/kongregate/comm/Opcode.java
  43. ===================================================================
  44. --- src/com/kongregate/comm/Opcode.java (revision 12199)
  45. +++ src/com/kongregate/comm/Opcode.java (working copy)
  46. @@ -75,6 +75,7 @@
  47. public static final String PARAM_SESSION_ID = "sessionid"; // The session id
  48. public static final String PARAM_SESSION_LOOKUP_KEY = "slk"; // The session lookup key
  49. public static final String PARAM_DURATION = "duration"; // duration
  50. + public static final String PARAM_REASON = "reason"; // reason
  51. public static final String PARAM_GAME_ID = "game_id"; // The game ID
  52. public static final String PARAM_GAME_NAME = "game_name"; // Game's full name
  53. public static final String PARAM_DATA = "data"; // Data
Add Comment
Please, Sign In to add comment