From 9ead83ac83e58d9c61a277abb7a2c7c24c32a044 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 9 Mar 2024 21:27:48 +0100 Subject: [PATCH 1/3] New Packets --- .../packets/api/BauStatusRequestPacket.java | 36 +++++++++++++++++ .../packets/api/EventReloadPacket.java | 29 ++++++++++++++ .../client/AnvilInventoryCallbackPacket.java | 29 ++++++++++++++ .../packets/server/AnvilInventoryPacket.java | 40 +++++++++++++++++++ .../server/api/BauStatusResponsePacket.java | 40 +++++++++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 src/de/steamwar/network/packets/api/BauStatusRequestPacket.java create mode 100644 src/de/steamwar/network/packets/api/EventReloadPacket.java create mode 100644 src/de/steamwar/network/packets/client/AnvilInventoryCallbackPacket.java create mode 100644 src/de/steamwar/network/packets/server/AnvilInventoryPacket.java create mode 100644 src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java diff --git a/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java b/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java new file mode 100644 index 0000000..1673799 --- /dev/null +++ b/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java @@ -0,0 +1,36 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.network.packets.api; + +import de.steamwar.network.packets.NetworkPacket; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@Getter +public class BauStatusRequestPacket extends NetworkPacket { + private static final long serialVersionUID = 1442956004669738962L; + private int playerId; + private String responseCode; +} diff --git a/src/de/steamwar/network/packets/api/EventReloadPacket.java b/src/de/steamwar/network/packets/api/EventReloadPacket.java new file mode 100644 index 0000000..80af630 --- /dev/null +++ b/src/de/steamwar/network/packets/api/EventReloadPacket.java @@ -0,0 +1,29 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.network.packets.api; + +import de.steamwar.network.packets.NetworkPacket; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +public class EventReloadPacket extends NetworkPacket { + + private static final long serialVersionUID = 1814658967167959572L; +} diff --git a/src/de/steamwar/network/packets/client/AnvilInventoryCallbackPacket.java b/src/de/steamwar/network/packets/client/AnvilInventoryCallbackPacket.java new file mode 100644 index 0000000..fc33bb8 --- /dev/null +++ b/src/de/steamwar/network/packets/client/AnvilInventoryCallbackPacket.java @@ -0,0 +1,29 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.network.packets.client; + +import de.steamwar.network.packets.NetworkPacket; + +public class AnvilInventoryCallbackPacket extends NetworkPacket { + + private static final long serialVersionUID = 9000793526796115661L; + private int player; + private String text; +} diff --git a/src/de/steamwar/network/packets/server/AnvilInventoryPacket.java b/src/de/steamwar/network/packets/server/AnvilInventoryPacket.java new file mode 100644 index 0000000..a07e3e3 --- /dev/null +++ b/src/de/steamwar/network/packets/server/AnvilInventoryPacket.java @@ -0,0 +1,40 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.network.packets.server; + +import de.steamwar.network.packets.NetworkPacket; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@Getter +public class AnvilInventoryPacket extends NetworkPacket { + + private static final long serialVersionUID = -2283899431463763871L; + + private String title; + private int player; + private String defaultText; + private String item; +} diff --git a/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java new file mode 100644 index 0000000..3261c7f --- /dev/null +++ b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java @@ -0,0 +1,40 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.network.packets.server.api; + +import de.steamwar.network.packets.NetworkPacket; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.List; + +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@Getter +public class BauStatusResponsePacket extends NetworkPacket { + private static final long serialVersionUID = 4338519342870271560L; + + private String responseCode; + private boolean serverStatus; + private List onlinePlayers; +} -- 2.39.2 From 7cadd9525459b6b7cbaf68e3241cdca7108b08ea Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 9 Mar 2024 21:45:09 +0100 Subject: [PATCH 2/3] Fix --- .../network/packets/server/api/BauStatusResponsePacket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java index 3261c7f..57c958a 100644 --- a/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java +++ b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java @@ -36,5 +36,5 @@ public class BauStatusResponsePacket extends NetworkPacket { private String responseCode; private boolean serverStatus; - private List onlinePlayers; + private List onlinePlayers; } -- 2.39.2 From 9fad1a3a11ee6882c017e21d117140a317116a20 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 9 Mar 2024 21:45:32 +0100 Subject: [PATCH 3/3] Fix --- src/de/steamwar/network/packets/api/BauStatusRequestPacket.java | 1 - .../network/packets/server/api/BauStatusResponsePacket.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java b/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java index 1673799..703af59 100644 --- a/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java +++ b/src/de/steamwar/network/packets/api/BauStatusRequestPacket.java @@ -32,5 +32,4 @@ import lombok.NoArgsConstructor; public class BauStatusRequestPacket extends NetworkPacket { private static final long serialVersionUID = 1442956004669738962L; private int playerId; - private String responseCode; } diff --git a/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java index 57c958a..2c7fc1a 100644 --- a/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java +++ b/src/de/steamwar/network/packets/server/api/BauStatusResponsePacket.java @@ -34,7 +34,7 @@ import java.util.List; public class BauStatusResponsePacket extends NetworkPacket { private static final long serialVersionUID = 4338519342870271560L; - private String responseCode; + private int player; private boolean serverStatus; private List onlinePlayers; } -- 2.39.2