Skip to content

Commit e34de8f

Browse files
committed
feat: packet changes
1 parent 48d4121 commit e34de8f

2 files changed

Lines changed: 52 additions & 20 deletions

File tree

src/main/java/com/mcdiamondfire/proto/PluginMessages.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ public final class PluginMessages {
1414
private static final Map<Class<? extends Message>, String> messages = new HashMap<>();
1515

1616
static {
17+
// Server.
18+
messages.put(ServerInfo.class, "server_info");
1719
messages.put(ServerBooster.class, "server_booster");
20+
21+
// Plot.
1822
messages.put(PlotInfo.class, "plot_info");
23+
24+
// Player.
1925
messages.put(PlayerCurrency.class, "player_currency");
2026
messages.put(PlayerPermissions.class, "player_permissions");
21-
messages.put(PlayerMode.class, "player_mode");
27+
messages.put(PlayerSwitchMode.class, "player_switch_mode");
2228
}
2329

2430
private PluginMessages() {

src/main/proto/mod_api.proto

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ syntax = "proto3";
33
option java_package = "com.mcdiamondfire.proto";
44
option java_multiple_files = true;
55

6+
// Server.
7+
68
// Sent when the player joins the server.
79
message ServerInfo {
810
// Represents a server type.
@@ -16,7 +18,7 @@ message ServerInfo {
1618
PRIVATE = 6; // Private nodes.
1719
}
1820

19-
string protocol_version = 1; // The version of the protocol in semver format.
21+
string protocol_version = 1; // The version of the protocol in semver format, major versions are not guaranteed to be compatible.
2022
string bungee_name = 2; // The identifier of the server.
2123
string patch_version = 3; // The patch version of the server.
2224
DFServerType server_type = 4; // The type of the server.
@@ -37,6 +39,8 @@ message ServerBooster {
3739
optional ActiveBooster active_booster = 2; // The active booster, if any.
3840
}
3941

42+
// Plot.
43+
4044
// Sent when the player joins a plot.
4145
message PlotInfo {
4246
// Represents a player in a plot.
@@ -46,7 +50,23 @@ message PlotInfo {
4650
bool is_owner = 3; // Whether the player is the owner of the plot.
4751
bool is_developer = 4; // Whether the player has developer permissions on the plot.
4852
bool is_builder = 5; // Whether the player has builder permissions on the plot.
49-
Mode mode = 6; // The mode the player is in.
53+
PlayerMode mode = 6; // The mode the player is in.
54+
}
55+
56+
enum PlotTag {
57+
ARCADE = 0; // One or multiple fast and fun minigames!
58+
VERSUS = 1; // Compete with other players!
59+
COMBAT = 2; // Fight your enemies!
60+
PARKOUR = 3; // Prove your platforming skills!
61+
ADVENTURE = 4; // Games with many places to explore!
62+
ROLEPLAY = 5; // Become part of an immersive setting or story!
63+
STRATEGY = 6; // Plan your next moves to be victorious!
64+
PUZZLE = 7; // Put your mind to the test!
65+
TRIVIA = 8; // Try to guess the correct answers!
66+
RESOURCES = 9; // Games where you collect resources to advance!
67+
ELIMINATION = 10; // Be the last one standing!
68+
CREATION = 11; // Games in which you can express your creativity!
69+
MISCELLANEOUS = 12; // Plots that don't really fit the other categories!
5070
}
5171

5272
int32 id = 1; // The identifier of the plot.
@@ -56,17 +76,19 @@ message PlotInfo {
5676
int32 plot_size = 5; // The size of the plot (1 = Basic, 2 = Large, 3 = Massive, 4 = Mega).
5777
int32 plot_min_x = 6; // The minimum X coordinate of the plot.
5878
int32 plot_min_z = 7; // The minimum Z coordinate of the plot.
59-
int32 spawn_pos_x = 8; // The spawn X coordinate of the plot.
60-
int32 spawn_pos_y = 9; // The spawn Y coordinate of the plot.
61-
int32 spawn_pos_z = 10; // The spawn Z coordinate of the plot.
79+
double spawn_pos_x = 8; // The spawn X coordinate of the plot.
80+
double spawn_pos_y = 9; // The spawn Y coordinate of the plot.
81+
double spawn_pos_z = 10; // The spawn Z coordinate of the plot.
6282
bool is_owner = 11; // Whether the player is the owner of the plot.
63-
bool is_developer = 12; // Whether the player has developer permissions on the plot.
64-
bool is_builder = 13; // Whether the player has builder permissions on the plot.
65-
repeated string tags = 14; // The tags of this plot (e.g. "adventure", "combat", ...).
83+
bool is_developer = 12; // Whether the player has developer permissions on the plot, is an administrator, or is the support member in a session.
84+
bool is_builder = 13; // Whether the player has builder permissions on the plot, is an administrator, or is the support member in a session.
85+
repeated PlotTag tags = 14; // The tags of this plot (e.g. "adventure", "combat", ...).
6686
string handle = 15; // The handle of the plot, or empty if none is set.
6787
repeated PlotPlayer players = 16; // The players currently on the plot.
6888
}
6989

90+
// Player.
91+
7092
// Sent when the player joins the server.
7193
message PlayerCurrency {
7294
// Represents an unclaimed ticket bundle.
@@ -85,23 +107,27 @@ message PlayerCurrency {
85107
// Sent when the player joins the server, admins will have all permissions set to their highest level.
86108
message PlayerPermissions {
87109
int32 donor = 1; // The donor rank level of the player. (Noble, Emperor, Mythic, Overlord)
88-
int32 support = 2; // The support rank level of the player. (JrHelper, Helper, SrHelper)
89-
int32 mod = 3; // The mod rank level of the player. (JrMod, Mod, SrMod)
90-
int32 admin = 4; // The admin rank level of the player. (Dev, Admin, Owner)
110+
int32 vip = 2; // The VIP rank level of the player. (VIP)
111+
int32 sponsor = 3; // The sponsor rank level of the player. (Tier 1, Tier 2, Tier 3)
112+
int32 support = 4; // The support rank level of the player. (JrHelper, Helper, SrHelper)
113+
int32 moderation = 5; // The mod rank level of the player. (JrMod, Mod, SrMod)
114+
int32 admin = 6; // The admin rank level of the player. (Dev, Admin, Owner)
91115
}
92116

93117
// Represents a player's mode.
94-
enum Mode {
118+
// Warning: IDs for vanish, idle, and verify will change in an upcoming refactor, the IDs here post-refactor.
119+
// I hope this only releases after the refactor.
120+
enum PlayerMode {
95121
PLAY = 0; // Play mode.
96122
BUILD = 1; // Build mode.
97-
CODE = 2; // Dev (code) mode.
98-
STALK = 3; // Code spectate (stalk) mode.
99-
VANISH = 4; // Mod vanish mode.
100-
SPAWN = 5; // Spawn (idle) mode.
101-
VERIFY = 6; // Account check (verify) mode.
123+
DEV = 2; // Dev (code) mode.
124+
CODE_STALK = 3; // Code spectate (stalk) mode.
125+
VERIFY = 4; // Account check (verify) mode.
126+
VANISH = 5; // Mod vanish mode.
127+
IDLE = 6; // Spawn (idle) mode.
102128
}
103129

104130
// Sent when the player switches modes.
105-
message PlayerMode {
106-
Mode mode = 1; // The mode the player is in.
131+
message PlayerSwitchMode {
132+
PlayerMode mode = 1; // The mode the player is in.
107133
}

0 commit comments

Comments
 (0)