Browse Source

road 2 map

master
gsd 1 year ago
parent
commit
ee40926d1d
  1. 7
      ext/sourcepawn-client/Facti13BackendIntegration.sp
  2. 13
      src/main/java/app/entities/server/request/PlayerOnServer.java

7
ext/sourcepawn-client/Facti13BackendIntegration.sp

@ -136,6 +136,13 @@ stock JSONObject createPayload() {
char steam2[32];
GetClientAuthId(client, AuthId_Steam3, steam2, sizeof(steam2));
player.SetString("steam2", steam2);
/* Position on map */
float pos[3];
GetClientAbsOrigin(client, pos);
player.SetFloat("pos_x", pos[0]);
player.SetFloat("pos_y", pos[1]);
player.SetFloat("pos_z", pos[2]);
/* push */
players.Push(player);
}

13
src/main/java/app/entities/server/request/PlayerOnServer.java

@ -2,10 +2,21 @@ package app.entities.server.request;
import app.entities.server.players.RCONPlayer;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class PlayerOnServer extends RCONPlayer {
float[] pos = {};
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
float pos_x = 0.0F;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
float pos_y = 0.0F;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
float pos_z = 0.0F;
//int duration_seconds = 0;
@JsonGetter
public float[] getPos() {
return new float[]{pos_x, pos_y, pos_z};
}
}
Loading…
Cancel
Save