Browse Source

Update

Update
master
Juan Molina 1 year ago
parent
commit
e974785baa
  1. 2
      pom.xml
  2. BIN
      publicroom-1.0.jar
  3. BIN
      publicroom-1.1.jar
  4. 21
      src/main/java/es/publicroom/Database/Database.java
  5. 2
      src/main/java/es/publicroom/PublicRoom.java
  6. 15
      src/main/java/es/publicroom/commands/CommandPublicRoom.java
  7. 1
      src/main/java/es/publicroom/core/ReadTexts.java
  8. 7
      src/main/java/es/publicroom/room/Listener.java

2
pom.xml

@ -6,7 +6,7 @@
<groupId>es.publicroom</groupId>
<artifactId>publicroom</artifactId>
<version>1.0</version>
<version>1.1</version>
<build>
<plugins>
<plugin>

BIN
publicroom-1.0.jar

BIN
publicroom-1.1.jar

21
src/main/java/es/publicroom/Database/Database.java

@ -0,0 +1,21 @@
package es.publicroom.Database;
import com.eu.habbo.Emulator;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Database {
public static void PublicUpdate(String state, int room_id) {
try (Connection connect = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement pS2 = connect.prepareStatement("UPDATE rooms SET is_public = ? WHERE id = ?")) {
pS2.setString(1, state);
pS2.setInt(2, room_id);
pS2.execute();
}
} catch(SQLException e) {}
}
}

2
src/main/java/es/publicroom/PublicRoom.java

@ -20,7 +20,7 @@ public class PublicRoom extends HabboPlugin implements EventListener {
public static PublicRoom INSTANCE = null;
public static String name = "PublicRoom Plugin";
public static String author = "Juan Molina (Ouis)";
public static String version = "1.0";
public static String version = "1.1";
private static final Logger LOGGER = LoggerFactory.getLogger(Emulator.class);
@Override

15
src/main/java/es/publicroom/commands/CommandPublicRoom.java

@ -3,7 +3,11 @@ package es.publicroom.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.RoomSettingsSavedComposer;
import com.eu.habbo.messages.outgoing.rooms.RoomSettingsUpdatedComposer;
import es.publicroom.Database.Database;
public class CommandPublicRoom extends Command {
public CommandPublicRoom(String permission, String[] keys)
@ -13,14 +17,21 @@ public class CommandPublicRoom extends Command {
@Override
public boolean handle(GameClient client, String[] vars) {
Room room = client.getHabbo().getRoomUnit().getRoom();
if(client.getHabbo().getRoomUnit().getRoom().isPublicRoom()){
client.getHabbo().getRoomUnit().getRoom().setPublicRoom(false);
Database.PublicUpdate("0", room.getId());
room.setPublicRoom(false);
client.getHabbo().whisper(Emulator.getTexts().getValue("commands.success.publicroom.disabled"), RoomChatMessageBubbles.ALERT);
}else{
client.getHabbo().getRoomUnit().getRoom().setPublicRoom(true);
Database.PublicUpdate("1", room.getId());
room.setPublicRoom(true);
client.getHabbo().whisper(Emulator.getTexts().getValue("commands.success.publicroom.enabled"), RoomChatMessageBubbles.ALERT);
}
room.sendComposer(new RoomSettingsUpdatedComposer(room).compose());
client.sendResponse(new RoomSettingsSavedComposer(room));
Emulator.getGameEnvironment().getNavigatorManager().loadNavigator();
Emulator.getGameEnvironment().getRoomManager().loadRoomModels();

1
src/main/java/es/publicroom/core/ReadTexts.java

@ -10,6 +10,7 @@ public class ReadTexts {
public static void readText() {
try {
Emulator.getTexts().register("commands.description.cmd_publicroom", ":publicroom");
Emulator.getTexts().register("commands.success.publicroom.enabled", "¡Felicidades, ahora está sala se encuentra pública!");
Emulator.getTexts().register("commands.success.publicroom.disabled", "¡Es una pena, ahora está sala ha dejado de ser pública!");
Emulator.getTexts().register("habbo.cmd_publicroom.keys", "publicroom;pr");

7
src/main/java/es/publicroom/room/Listener.java

@ -1,7 +0,0 @@
package es.roleplay.room;
import com.eu.habbo.plugin.EventListener;
public class Listener implements EventListener {
//
}
Loading…
Cancel
Save