🎉 Add Network Packets
Dieser Commit ist enthalten in:
Ursprung
5c195d8e28
Commit
4c79af0182
@ -22,7 +22,7 @@ package de.steamwar.network.packets;
|
||||
import de.steamwar.network.packets.common.FightInfoPacket;
|
||||
import de.steamwar.network.packets.common.FightEndsPacket;
|
||||
|
||||
public interface NetworkHandler {
|
||||
void handle(FightEndsPacket packet);
|
||||
void handle(FightInfoPacket packet);
|
||||
public abstract class NetworkHandler {
|
||||
public void handle(FightEndsPacket packet) {};
|
||||
public void handle(FightInfoPacket packet) {};
|
||||
}
|
||||
|
@ -19,12 +19,13 @@
|
||||
|
||||
package de.steamwar.network.packets.client;
|
||||
|
||||
import de.steamwar.network.packets.NetworkHandler;
|
||||
import de.steamwar.network.packets.server.*;
|
||||
|
||||
public interface ClientNetworkHandler {
|
||||
void handle(BaumemberUpdatePacket packet);
|
||||
void handle(CloseInventoryPacket packet);
|
||||
void handle(InventoryPacket packet);
|
||||
void handle(PingPacket packet);
|
||||
void handle(StartingServerPacket packet);
|
||||
public abstract class ClientNetworkHandler extends NetworkHandler {
|
||||
public void handle(BaumemberUpdatePacket packet) {};
|
||||
public void handle(CloseInventoryPacket packet) {};
|
||||
public void handle(InventoryPacket packet) {}
|
||||
public void handle(PingPacket packet) {}
|
||||
public void handle(StartingServerPacket packet) {}
|
||||
}
|
||||
|
@ -28,20 +28,20 @@ import java.util.List;
|
||||
public class FightInfoPacket extends CommonPacket{
|
||||
|
||||
private static final long serialVersionUID = 7448644597856605853L;
|
||||
private String serverName; // Name of the Server
|
||||
private String gameMode; // GameMode aka Schematictype (if known, else "")
|
||||
private String arena; // Name of the arena
|
||||
private String blueName; // Name of the blue team, expected to begin with "§a" colorcode
|
||||
private String redName; // Name of the red team, expected to begin with "§a" colorcode
|
||||
private String fightState; // Fight state (technical term) (if known, else "")
|
||||
private int countdown; // Countdown state in seconds (if known, else 0)
|
||||
private int blueLeader; // SWUserID of the blue team leader (if known, else 0)
|
||||
private int redLeader; // SWUserID of the red team leader (if known, else 0)
|
||||
private int blueSchem; // Blue SchemID (if known, else 0)
|
||||
private int redSchem; // Red SchemID (if known, else 0)
|
||||
private List<Integer> bluePlayers; // List of Blue SWUserIDs
|
||||
private List<Integer> redPlayers; // List of Red SWUserIDs
|
||||
private List<Integer> spectators; // List of Spectator SWUserIDs
|
||||
private String serverName;
|
||||
private String gameMode;
|
||||
private String arena;
|
||||
private String blueName;
|
||||
private String redName;
|
||||
private String fightState;
|
||||
private int countdown;
|
||||
private int blueLeader;
|
||||
private int redLeader;
|
||||
private int blueSchem;
|
||||
private int redSchem;
|
||||
private List<Integer> bluePlayers;
|
||||
private List<Integer> redPlayers;
|
||||
private List<Integer> spectators;
|
||||
|
||||
@Override
|
||||
public void handle(NetworkHandler handler) {
|
||||
|
@ -19,12 +19,13 @@
|
||||
|
||||
package de.steamwar.network.packets.server;
|
||||
|
||||
import de.steamwar.network.packets.NetworkHandler;
|
||||
import de.steamwar.network.packets.client.*;
|
||||
|
||||
public interface ServerNetworkHandler {
|
||||
void handle(ExecuteCommandPacket packet);
|
||||
void handle(ImALobbyPacket packet);
|
||||
void handle(InventoryCallbackPacket packet);
|
||||
void handle(PrepareSchemPacket packet);
|
||||
void handle(TablistNamePacket packet);
|
||||
public abstract class ServerNetworkHandler extends NetworkHandler {
|
||||
public void handle(ExecuteCommandPacket packet) {};
|
||||
public void handle(ImALobbyPacket packet) {}
|
||||
public void handle(InventoryCallbackPacket packet) {}
|
||||
public void handle(PrepareSchemPacket packet) {}
|
||||
public void handle(TablistNamePacket packet) {}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren