diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java index 77d70ed19..348dfc5db 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java @@ -256,16 +256,16 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur HttpPostRequestDecoder postDecoder = new HttpPostRequestDecoder(request); try { - String players = getFormParameterSafely(postDecoder, "players"); - String product = getFormParameterSafely(postDecoder, "product"); - String collectionType = getFormParameterSafely(postDecoder, "collectionType"); + String players = getFormParameterSafely(postDecoder, "players"); + String product = getFormParameterSafely(postDecoder, "product"); + String collectionType = getFormParameterSafely(postDecoder, "collectionType"); - Collection productItems = getProductItems(product); + Collection productItems = getProductItems(product); - List playerNames = getItems(players); + List playerNames = getItems(players); - for (String playerName : playerNames) { - Player player = _playerDao.getPlayer(playerName); + for (String playerName : playerNames) { + Player player = _playerDao.getPlayer(playerName); _collectionManager.addItemsToPlayerCollection(true, "Administrator action", player, createCollectionType(collectionType), productItems); } diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css index 4124db980..9cf39ea76 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css +++ b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css @@ -565,6 +565,7 @@ table.tables tr.privateForPlayer { .ui-button-text-only .ui-button-text { padding: .2em .5em; + text-align: center; } .standings td, .standings th { diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/includes/admin/generalAdmin.html b/gemp-lotr/gemp-lotr-async/src/main/web/includes/admin/generalAdmin.html index 0a9286446..6dfe16de3 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/includes/admin/generalAdmin.html +++ b/gemp-lotr/gemp-lotr-async/src/main/web/includes/admin/generalAdmin.html @@ -60,11 +60,27 @@ $("#motd-text").val(json.response); $("#motd-preview").html(json.response); }); + + + $("#add-items-button").button().click( + function () { + let execute = confirm("Are you sure you want to issue these items in these quantities to these players in that collection? THIS CANNOT BE UNDONE, EVEN MANUALLY."); + + if(!execute) + return; + + $("#add-items-response").html("Processing..."); + + hall.comm.addItems($("#collectionType").val(), $("#product").val(), $("#players").val(), function (string) { + $("#add-items-response").html("Response: " + string); + }); + }); + }); -
+
@@ -74,15 +90,15 @@ - + - + - + @@ -123,7 +139,7 @@

Message of the Day

-

Sets the MOTD in the Game Hall just beneath the action bar at the top of the window. Supports HTML.

+

Sets the MOTD in the Game Hall just beneath the action bar at the top of the window. Supports HTML.

@@ -138,31 +154,106 @@

- - -

Collections

-

Add items

+

Add Items

+ +
- - Ready. Puts the server into shutdown mode (cancels queues, disallows new table creation, otherwise leaves current tables open). Puts a site-wide chat alert telling players the server will restart soon.

@@ -92,29 +108,29 @@
- Ready. - All database operations have their results cached in memory to alleviate load on the DB while the server is running. This command clears that cache and forces any database calls to get the actual DB data. + All database operations have their results cached in memory to alleviate load on the DB while the server is running. This command clears that cache and forces any database calls to get the actual DB data.

- Also clears the internal caches of the League and Tournament services, forcing standings to be re-calculated. + Also clears the internal caches of the League and Tournament services, forcing standings to be re-calculated.
- Ready. - New-style card definitions are JSON text files, and as such can be hot-reloaded at will. This command will reload all definitions from file for cards that have been converted. + New-style card definitions are JSON text files, and as such can be hot-reloaded at will. This command will reload all definitions from file for cards that have been converted.
+ + + + + + + + + + + + + + + + + + + + + + + +
InputDescription
+ Type:
+
+ Which collection to insert the cards in. One of: +
    +
  • permanent
  • +
  • trophy
  • +
  • default
  • +
  • permanent+trophy
  • +
+ When awarding league awards, "trophy" is the one to use. +
+ Product:
+
+ A list of items + quantities to award (one item per line), in the form +
4x item_id
+ Where "4x" indicates how many copies to award, and "item_id" is the GEMP ID of the item to award. +

+ Things which can be awarded: +
    +
  • + Cards in the form +
    1x 11_123
    + where "11_123" is the GEMP ID of the card, usually set number + card number (but not always, especially for masterworks, tengwar, or full art promos).
    +
  • +
  • + Card selections in the form +
    1x (S)selection
    + where "selection" is the name of the items to choose from. For instance, "1x (S)FotR - Tengwar" would grant that player a choice of 1 tengwar card from sets 1, 2, or 3. +

    + The full list of selection items is too large to list here. See GenerateTrophyCollections.java, FixedLeaguePrizes.java, SealedLeaguePrizes.java, SealedLeagueProduct.java, and packs.txt for a (hopefully?) complete list.
    +
  • +
  • + Card packs in the form +
    1x packname
    + where packname is one of various ids (with no underscores). See PacksStorageBuilder.java for an incomplete list. +
  • +
+
+ Players:
+
+ A list of players to award cards to, one per line. Case sensitive. +
+ + + Invoking this command will add each of the listed items in Product to each of players listed in Players. THIS CANNOT BE UNDONE, even manually, so be *very sure* you have entered everything in correctly. Test on your own user if you must. +

+
+ + -

Add items to collection

+ + +
\ No newline at end of file diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/communication.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/communication.js index a46595671..4366b635c 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/communication.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/communication.js @@ -786,6 +786,22 @@ var GempLotrCommunication = Class.extend({ }); }, + addItems:function (collectionType, product, players, callback, errorMap) { + $.ajax({ + type:"POST", + url:this.url + "/admin/addItems", + cache:false, + data:{ + collectionType:collectionType, + product:product, + players:players + }, + success:this.deliveryCheck(callback), + error:this.errorCheck(errorMap), + dataType:"html" + }); + }, + //NEVER EVER EVER use this for actual authentication