From ab080773c8c9d6e9e13aec3eb93b5f98b0ad5ccb Mon Sep 17 00:00:00 2001 From: alterwain Date: Thu, 6 Mar 2025 21:09:54 +0300 Subject: [PATCH] LocationsObjects bugfix --- .../java/com/alterdekim/game/component/GameServer.java | 8 ++++---- .../alterdekim/game/entity/LocationObjectInstance.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/alterdekim/game/component/GameServer.java b/src/main/java/com/alterdekim/game/component/GameServer.java index 0ee58ef..2bf889d 100644 --- a/src/main/java/com/alterdekim/game/component/GameServer.java +++ b/src/main/java/com/alterdekim/game/component/GameServer.java @@ -146,28 +146,28 @@ public class GameServer { message.getTransactionId(), xmlMapper.writeValueAsString( locationService.getDefaultLocation() - ) + ).replace("<", "<") ); return; } long requestedLocation = message.getArguments().get(1).getLong(); if( requestedLocation == -1L ) { int homePlayerId = message.getArguments().get(0).getInt(); - this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getHomeByUserId(homePlayerId))); + this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getHomeByUserId(homePlayerId)).replace("<", "<")); return; } if( requestedLocation == -2L ) { return; } - this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(requestedLocation))); + this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(requestedLocation)).replace("<", "<")); } case GetUserLocationById -> { long nextLocation = message.getArguments().get(1).getLong(); if (nextLocation == -1) { nextLocation = 0; } - this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(nextLocation))); + this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(nextLocation)).replace("<", "<")); } case ChatMessage -> { String text = message.getArguments().get(1).toString(); diff --git a/src/main/java/com/alterdekim/game/entity/LocationObjectInstance.java b/src/main/java/com/alterdekim/game/entity/LocationObjectInstance.java index 3bce5ce..535c040 100644 --- a/src/main/java/com/alterdekim/game/entity/LocationObjectInstance.java +++ b/src/main/java/com/alterdekim/game/entity/LocationObjectInstance.java @@ -4,6 +4,7 @@ import com.alterdekim.game.controller.result.api.ApiResult; import com.alterdekim.game.controller.result.api.LocationObjectInstanceResult; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; import jakarta.persistence.*; import lombok.AllArgsConstructor; import lombok.Getter; @@ -41,7 +42,7 @@ public class LocationObjectInstance implements ApiResult { @JacksonXmlProperty(isAttribute = true, localName = "y") private Double y; - @JsonIgnore + @JacksonXmlText private String options; @JsonIgnore