mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
WiredTriggerHabboEntersRoom now saves as json
This commit is contained in:
parent
0cdadfab8b
commit
4123593308
@ -41,12 +41,21 @@ public class WiredTriggerHabboEntersRoom extends InteractionWiredTrigger {
|
||||
|
||||
@Override
|
||||
public String getWiredData() {
|
||||
return this.username;
|
||||
return WiredHandler.getGsonBuilder().create().toJson(new JsonData(
|
||||
this.username
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadWiredData(ResultSet set, Room room) throws SQLException {
|
||||
this.username = set.getString("wired_data");
|
||||
String wiredData = set.getString("wired_data");
|
||||
|
||||
if (wiredData.startsWith("{")) {
|
||||
JsonData data = WiredHandler.getGsonBuilder().create().fromJson(wiredData, JsonData.class);
|
||||
this.username = data.username;
|
||||
} else {
|
||||
this.username = wiredData;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -86,4 +95,12 @@ public class WiredTriggerHabboEntersRoom extends InteractionWiredTrigger {
|
||||
public boolean isTriggeredByRoomUnit() {
|
||||
return true;
|
||||
}
|
||||
|
||||
static class JsonData {
|
||||
String username;
|
||||
|
||||
public JsonData(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user