diff --git a/src/main/java/cactusServer/resources/InstancesRest.java b/src/main/java/cactusServer/resources/InstancesRest.java index e38a0f5..084c11e 100644 --- a/src/main/java/cactusServer/resources/InstancesRest.java +++ b/src/main/java/cactusServer/resources/InstancesRest.java @@ -156,21 +156,21 @@ return new URIAddressedEntity((INSTANCES_URI + "/" + instanceURI + "/players/" + ae.getId()), ae.getBody()); } -// @Path("/players/{playerId}") -// @PUT -// @Produces(MediaType.APPLICATION_JSON) -// public Player putPlayer(@PathParam("instanceId") String instanceId, @FormParam("characterURI") String characterURI, -// @FormParam("position") Position3D position, @FormParam("angle") Angle angle, -// @FormParam("cameraState") CameraState cameraState, @FormParam("animationClassToStart") EmoteState animationClassToStart) { -// return Instances.getInstance().putPlayer(characterURI, position, angle, cameraState, animationClassToStart); -// } + @Path("/players/{playerId}") + @PUT + @Produces(MediaType.APPLICATION_JSON) + public Player updatePlayer(@PathParam("instanceId") String instanceId, @FormParam("playerId") String playerId, + @FormParam("characterURI") String characterURI, @FormParam("position") Position3D position, @FormParam("angle") Angle angle, + @FormParam("cameraState") CameraState cameraState, @FormParam("animationClassToStart") EmoteState.EmoteType animationClassToStart) { + return Instances.getInstance().updatePlayer(playerId, characterURI, position, angle, cameraState, animationClassToStart); + } // @Path("/characters/{characterId}") // @PUT // @Produces(MediaType.APPLICATION_JSON) -// public Character putCharacter(@FormParam("position") Position3D position, @FormParam("angle") Angle angle, -// @FormParam("model") CharacterModel model) { -// HttpServletResponse response = Instance.putCharacter(position, angle, model); +// public Character updateCharacter(@FormParam("characterId") String characterId, @FormParam("position") Position3D position, +// @FormParam("angle") Angle angle, @FormParam("model") String model) { +// Character response = Instance.updateCharacter(characterId, position, angle, model); // response.setStatus(HttpServletResponse.SC_OK); // }