mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Merge branch 'dev' into 'master'
2.3.1 See merge request morningstar/Arcturus-Community!109
This commit is contained in:
commit
e47a48eb3d
@ -94,7 +94,7 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getWiredData() {
|
public String getWiredData() {
|
||||||
StringBuilder data = new StringBuilder(this.startRotation.getValue() + "\t" + this.rotateAction + "\t" + this.items.size());
|
StringBuilder data = new StringBuilder(this.getDelay() + this.startRotation.getValue() + "\t" + this.rotateAction + "\t" + this.items.size());
|
||||||
|
|
||||||
for (Map.Entry<HabboItem, RoomUserRotation> entry : this.items.entrySet()) {
|
for (Map.Entry<HabboItem, RoomUserRotation> entry : this.items.entrySet()) {
|
||||||
data.append("\t").append(entry.getKey().getId()).append(":").append(entry.getValue().getValue());
|
data.append("\t").append(entry.getKey().getId()).append(":").append(entry.getValue().getValue());
|
||||||
@ -107,6 +107,9 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
public void loadWiredData(ResultSet set, Room room) throws SQLException {
|
public void loadWiredData(ResultSet set, Room room) throws SQLException {
|
||||||
String[] data = set.getString("wired_data").split("\t");
|
String[] data = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
|
if (data.length >= 1) {
|
||||||
|
this.setDelay(Integer.valueOf(data[0]));
|
||||||
|
}
|
||||||
if (data.length >= 3) {
|
if (data.length >= 3) {
|
||||||
this.startRotation = RoomUserRotation.fromValue(Integer.valueOf(data[0]));
|
this.startRotation = RoomUserRotation.fromValue(Integer.valueOf(data[0]));
|
||||||
this.rotateAction = Integer.valueOf(data[1]);
|
this.rotateAction = Integer.valueOf(data[1]);
|
||||||
@ -178,6 +181,7 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
this.items.put(item, this.startRotation);
|
this.items.put(item, this.startRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.setDelay(packet.readInt());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,7 +857,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
try {
|
try {
|
||||||
if (!this.traxManager.disposed()) {
|
|
||||||
|
if (this.traxManager != null && !this.traxManager.disposed()) {
|
||||||
this.traxManager.dispose();
|
this.traxManager.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class TraxManager implements Disposable {
|
|||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
HabboItem musicDisc = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set.getInt("item_id"));
|
HabboItem musicDisc = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set.getInt("item_id"));
|
||||||
|
if(musicDisc != null) {
|
||||||
if (!(musicDisc instanceof InteractionMusicDisc) || musicDisc.getRoomId() != -1) {
|
if (!(musicDisc instanceof InteractionMusicDisc) || musicDisc.getRoomId() != -1) {
|
||||||
try (PreparedStatement stmt = connection.prepareStatement("DELETE FROM room_trax_playlist WHERE room_id = ? AND item_id = ? LIMIT 1")) {
|
try (PreparedStatement stmt = connection.prepareStatement("DELETE FROM room_trax_playlist WHERE room_id = ? AND item_id = ? LIMIT 1")) {
|
||||||
stmt.setInt(1, this.room.getId());
|
stmt.setInt(1, this.room.getId());
|
||||||
@ -63,6 +63,8 @@ public class TraxManager implements Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
Emulator.getLogging().logSQLException(e);
|
Emulator.getLogging().logSQLException(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user