-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c43f9ee
commit 17994ba
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/main/java/com/lapisberry/net/packets/ClientPacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.lapisberry.net.packets; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* The {@code ClientPacket} class is a packet sending from client to server. | ||
*/ | ||
public class ClientPacket implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = -2286074370601221667L; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/lapisberry/net/packets/JoinRequestPacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.lapisberry.net.packets; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* The {@code JoinRequestPacket} class is the first packet sending from client to server to join the server. | ||
*/ | ||
public class JoinRequestPacket extends ClientPacket implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = -3120924882895484001L; | ||
// Fields | ||
private final String username; | ||
|
||
// Constructors | ||
public JoinRequestPacket(String username) { | ||
this.username = username; | ||
} | ||
|
||
// Getters | ||
public String getUsername() { | ||
return username; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/lapisberry/net/packets/ServerPacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.lapisberry.net.packets; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* The {@code ServerPacket} class is a packet sending from server to client. | ||
*/ | ||
public class ServerPacket implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 726935260428407157L; | ||
} |