🎉 Add Network Packets

Dieser Commit ist enthalten in:
Chaoscaot 2022-04-24 20:55:46 +02:00
Ursprung 5c195d8e28
Commit 4c79af0182
4 geänderte Dateien mit 31 neuen und 29 gelöschten Zeilen

Datei anzeigen

@ -22,7 +22,7 @@ package de.steamwar.network.packets;
import de.steamwar.network.packets.common.FightInfoPacket; import de.steamwar.network.packets.common.FightInfoPacket;
import de.steamwar.network.packets.common.FightEndsPacket; import de.steamwar.network.packets.common.FightEndsPacket;
public interface NetworkHandler { public abstract class NetworkHandler {
void handle(FightEndsPacket packet); public void handle(FightEndsPacket packet) {};
void handle(FightInfoPacket packet); public void handle(FightInfoPacket packet) {};
} }

Datei anzeigen

@ -19,12 +19,13 @@
package de.steamwar.network.packets.client; package de.steamwar.network.packets.client;
import de.steamwar.network.packets.NetworkHandler;
import de.steamwar.network.packets.server.*; import de.steamwar.network.packets.server.*;
public interface ClientNetworkHandler { public abstract class ClientNetworkHandler extends NetworkHandler {
void handle(BaumemberUpdatePacket packet); public void handle(BaumemberUpdatePacket packet) {};
void handle(CloseInventoryPacket packet); public void handle(CloseInventoryPacket packet) {};
void handle(InventoryPacket packet); public void handle(InventoryPacket packet) {}
void handle(PingPacket packet); public void handle(PingPacket packet) {}
void handle(StartingServerPacket packet); public void handle(StartingServerPacket packet) {}
} }

Datei anzeigen

@ -28,20 +28,20 @@ import java.util.List;
public class FightInfoPacket extends CommonPacket{ public class FightInfoPacket extends CommonPacket{
private static final long serialVersionUID = 7448644597856605853L; private static final long serialVersionUID = 7448644597856605853L;
private String serverName; // Name of the Server private String serverName;
private String gameMode; // GameMode aka Schematictype (if known, else "") private String gameMode;
private String arena; // Name of the arena private String arena;
private String blueName; // Name of the blue team, expected to begin with "§a" colorcode private String blueName;
private String redName; // Name of the red team, expected to begin with "§a" colorcode private String redName;
private String fightState; // Fight state (technical term) (if known, else "") private String fightState;
private int countdown; // Countdown state in seconds (if known, else 0) private int countdown;
private int blueLeader; // SWUserID of the blue team leader (if known, else 0) private int blueLeader;
private int redLeader; // SWUserID of the red team leader (if known, else 0) private int redLeader;
private int blueSchem; // Blue SchemID (if known, else 0) private int blueSchem;
private int redSchem; // Red SchemID (if known, else 0) private int redSchem;
private List<Integer> bluePlayers; // List of Blue SWUserIDs private List<Integer> bluePlayers;
private List<Integer> redPlayers; // List of Red SWUserIDs private List<Integer> redPlayers;
private List<Integer> spectators; // List of Spectator SWUserIDs private List<Integer> spectators;
@Override @Override
public void handle(NetworkHandler handler) { public void handle(NetworkHandler handler) {

Datei anzeigen

@ -19,12 +19,13 @@
package de.steamwar.network.packets.server; package de.steamwar.network.packets.server;
import de.steamwar.network.packets.NetworkHandler;
import de.steamwar.network.packets.client.*; import de.steamwar.network.packets.client.*;
public interface ServerNetworkHandler { public abstract class ServerNetworkHandler extends NetworkHandler {
void handle(ExecuteCommandPacket packet); public void handle(ExecuteCommandPacket packet) {};
void handle(ImALobbyPacket packet); public void handle(ImALobbyPacket packet) {}
void handle(InventoryCallbackPacket packet); public void handle(InventoryCallbackPacket packet) {}
void handle(PrepareSchemPacket packet); public void handle(PrepareSchemPacket packet) {}
void handle(TablistNamePacket packet); public void handle(TablistNamePacket packet) {}
} }