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(),
xmlMapper.writeValueAsString(
locationService.getDefaultLocation()
)
).replace("&lt;", "<")
);
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("&lt;", "<"));
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("&lt;", "<"));
}
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("&lt;", "<"));
}
case ChatMessage -> {
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.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