LocationsObjects bugfix

This commit is contained in:
Michael Wain 2025-03-06 21:09:54 +03:00
parent f5e313dda3
commit ab080773c8
2 changed files with 6 additions and 5 deletions

View File

@ -146,28 +146,28 @@ public class GameServer {
message.getTransactionId(), message.getTransactionId(),
xmlMapper.writeValueAsString( xmlMapper.writeValueAsString(
locationService.getDefaultLocation() locationService.getDefaultLocation()
) ).replace("&lt;", "<")
); );
return; return;
} }
long requestedLocation = message.getArguments().get(1).getLong(); long requestedLocation = message.getArguments().get(1).getLong();
if( requestedLocation == -1L ) { if( requestedLocation == -1L ) {
int homePlayerId = message.getArguments().get(0).getInt(); 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("&lt;", "<"));
return; return;
} }
if( requestedLocation == -2L ) { if( requestedLocation == -2L ) {
return; return;
} }
this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(requestedLocation))); this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(requestedLocation)).replace("&lt;", "<"));
} }
case GetUserLocationById -> { case GetUserLocationById -> {
long nextLocation = message.getArguments().get(1).getLong(); long nextLocation = message.getArguments().get(1).getLong();
if (nextLocation == -1) { if (nextLocation == -1) {
nextLocation = 0; nextLocation = 0;
} }
this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(nextLocation))); this.sendResult(playerId, message.getTransactionId(), xmlMapper.writeValueAsString(locationService.getLocationById(nextLocation)).replace("&lt;", "<"));
} }
case ChatMessage -> { case ChatMessage -> {
String text = message.getArguments().get(1).toString(); String text = message.getArguments().get(1).toString();

View File

@ -4,6 +4,7 @@ import com.alterdekim.game.controller.result.api.ApiResult;
import com.alterdekim.game.controller.result.api.LocationObjectInstanceResult; import com.alterdekim.game.controller.result.api.LocationObjectInstanceResult;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -41,7 +42,7 @@ public class LocationObjectInstance implements ApiResult {
@JacksonXmlProperty(isAttribute = true, localName = "y") @JacksonXmlProperty(isAttribute = true, localName = "y")
private Double y; private Double y;
@JsonIgnore @JacksonXmlText
private String options; private String options;
@JsonIgnore @JsonIgnore