-
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
2ca619b
commit 7845b90
Showing
5 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
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
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,32 @@ | ||
package com.stmarygate.coral.entities; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
@Entity | ||
@Table(name = "accounts") | ||
public class Account { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(nullable = false, unique = true) | ||
private String username; | ||
|
||
@Column(nullable = false) | ||
private String password; // Hashed password | ||
|
||
@Column(nullable = false, unique = true) | ||
private String email; | ||
|
||
@Column(nullable = true) | ||
private String jwt; | ||
|
||
@OneToOne() | ||
@JoinColumn(name = "player_id") | ||
private Player player; | ||
} |
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,20 @@ | ||
package com.stmarygate.coral.entities; | ||
|
||
import jakarta.persistence.*; | ||
import java.util.UUID; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
@Entity | ||
@Table(name = "players") | ||
public class Player { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
private UUID id; | ||
|
||
@OneToOne(mappedBy = "player") | ||
private Account account; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/com/stmarygate/coral/network/packets/client/PacketGetPlayerInformations.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,48 @@ | ||
package com.stmarygate.coral.network.packets.client; | ||
|
||
import com.stmarygate.coral.network.packets.Packet; | ||
import com.stmarygate.coral.network.packets.PacketBuffer; | ||
import com.stmarygate.coral.network.packets.PacketHandler; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class PacketGetPlayerInformations extends Packet { | ||
|
||
/** | ||
* Constructs a new {@code PacketGetPlayerInformations}. | ||
*/ | ||
public PacketGetPlayerInformations() { | ||
|
||
} | ||
|
||
/** | ||
* Encodes the packet data into the provided {@link PacketBuffer}. | ||
* | ||
* @param packet The {@link PacketBuffer} to which the packet data will be written. | ||
*/ | ||
@Override | ||
public void encode(PacketBuffer packet) throws Exception { | ||
} | ||
|
||
/** | ||
* Handles the packet using the specified {@link PacketHandler}. | ||
* | ||
* @param handler The {@link PacketHandler} responsible for handling the packet. | ||
*/ | ||
@Override | ||
public void handle(PacketHandler handler) throws Exception { | ||
handler.handlePacket(this); | ||
} | ||
|
||
/** | ||
* Returns a string representation of the {@code PacketVersion}. | ||
* | ||
* @return A string representation containing version information. | ||
*/ | ||
@Override | ||
public String toString() { | ||
return ""; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...n/java/com/stmarygate/coral/network/packets/server/PacketGetPlayerInformationsResult.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,7 @@ | ||
package com.stmarygate.coral.network.packets.server; | ||
|
||
import com.stmarygate.coral.network.packets.Packet; | ||
|
||
public class PacketGetPlayerInformationsResult extends Packet { | ||
|
||
} |