Package edu.wisc.game.rest
Class GameService2
java.lang.Object
edu.wisc.game.rest.GameService2
- Direct Known Subclasses:
AutomaticRuleGeneratorService
,CheckPlanService
,GameService2Html
@Path("/GameService2") public class GameService2 extends Object
The "Second Batch" of API calls, primarily for use with players constrained by an experiment plan, and playing a sequence of games as outlined in the trial list to which the player is assigned. This API is set up in accordance with Kevin Mui's request, 2020-08-17.
-
Constructor Summary
Constructors Constructor Description GameService2()
-
Method Summary
Modifier and Type Method Description ActivateBonusWrapper
activateBonus(String playerId)
ColorMap
colorMap()
Returns a hash map that maps each color name (in upper case) to a vector of 3 integers, representing RGB values.EpisodeInfo.ExtendedDisplay
display(String episodeId)
LaunchRulesBase.AndroidRuleInfoReport
findPlans(int uid)
String
getVersion()
Reports the current version of the serverGiveUpWrapper
giveUp(String playerId, int seriesNo)
FileWriteReport
guess(String episodeId, String text, int confidence)
Records a player's guess about the rules.ListShapesWrapper
listShapes()
Lists the names of all shapes.NewEpisodeWrapper2
mostRecentEpisode(String playerId)
Changed to existing=false on 2022-11-04, due to an error reported by Paul.EpisodeInfo.ExtendedDisplay
move(String episodeId, int x, int y, int cnt)
EpisodeInfo.ExtendedDisplay
move(String episodeId, int x, int y, int bx, int by, int cnt)
NewEpisodeWrapper2
newEpisode(String playerId, boolean activateBonus, boolean giveUp)
PlayerResponse
player(String playerId, String exp, int uid)
UserResponse
registerUser(String email, String nickname, boolean anon)
-
Constructor Details
-
GameService2
public GameService2()
-
-
Method Details
-
registerUser
@POST @Path("/registerUser") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public UserResponse registerUser(@DefaultValue("null") @FormParam("email") String email, @DefaultValue("null") @FormParam("nickname") String nickname, @DefaultValue("false") @FormParam("anon") boolean anon) -
player
@POST @Path("/player") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public PlayerResponse player(@DefaultValue("null") @FormParam("playerId") String playerId, @DefaultValue("null") @FormParam("exp") String exp, @DefaultValue("-1") @FormParam("uid") int uid) -
mostRecentEpisode
@POST @Path("/mostRecentEpisode") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public NewEpisodeWrapper2 mostRecentEpisode(@FormParam("playerId") String playerId)Changed to existing=false on 2022-11-04, due to an error reported by Paul. -
newEpisode
@POST @Path("/newEpisode") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public NewEpisodeWrapper2 newEpisode(@FormParam("playerId") String playerId, @DefaultValue("false") @FormParam("activateBonus") boolean activateBonus, @DefaultValue("false") @FormParam("giveUp") boolean giveUp) -
display
@GET @Path("/display") @Produces("application/json") public EpisodeInfo.ExtendedDisplay display(@QueryParam("episode") String episodeId) -
move
@POST @Path("/move") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public EpisodeInfo.ExtendedDisplay move(@FormParam("episode") String episodeId, @FormParam("x") int x, @FormParam("y") int y, @FormParam("bx") int bx, @FormParam("by") int by, @FormParam("cnt") int cnt) -
move
@POST @Path("/pick") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public EpisodeInfo.ExtendedDisplay move(@FormParam("episode") String episodeId, @FormParam("x") int x, @FormParam("y") int y, @FormParam("cnt") int cnt) -
activateBonus
@POST @Path("/activateBonus") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public ActivateBonusWrapper activateBonus(@FormParam("playerId") String playerId) -
giveUp
@POST @Path("/giveUp") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public GiveUpWrapper giveUp(@FormParam("playerId") String playerId, @FormParam("seriesNo") int seriesNo) -
guess
@POST @Path("/guess") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public FileWriteReport guess(@FormParam("episode") String episodeId, @FormParam("data") String text, @DefaultValue("-1") @FormParam("confidence") int confidence)Records a player's guess about the rules. This is typically used at the end of an episode. -
colorMap
Returns a hash map that maps each color name (in upper case) to a vector of 3 integers, representing RGB values. The data come from the file in game-data/colors. Note that calling this method causes the system to re-read the file; so the client may want to cache the data. -
listShapes
Lists the names of all shapes. This can be used e.g. in a board editor. -
getVersion
Reports the current version of the server -
findPlans
@GET @Path("/findPlans") @Produces("application/json") public LaunchRulesBase.AndroidRuleInfoReport findPlans(@DefaultValue("-1") @QueryParam("uid") int uid)
-