send server brand during login

* send server brand to client

* send brand regardless of `0x02` being recieved by server or not

* send brand regardless of `0x02` being recieved by server or not
+ if statement to match previous lines

* ifdef check for brand sending

* commit main.c for ifdef check (i forgot)

* commit main.c for ifdef check (i forgot)

* change sc_pluginMessage to sc_sendPluginMessage

- added params to it for use in other cases
- other changes to fit PR reviews

* revert .gitignore

* revert unrelated changes

* send byte instead of varint for constant packet id

* gate declaration of brand string behind ifdef

* make logging consistent with codebase

---------

Co-authored-by: p2r3 <p2r3@p2r3.com>
This commit is contained in:
Bradlee Barnes
2025-09-13 11:22:06 +00:00
committed by GitHub
parent 2a9e443a8d
commit 969f7d3974
5 changed files with 37 additions and 0 deletions

View File

@@ -102,6 +102,11 @@
// clients from Keep Alive packets.
#define NETWORK_TIMEOUT_TIME 15000000
// If defined, sends the server brand to clients. Doesn't do much, but will
// show up in the top-left of the F3/debug menu, in the Minecraft client.
// You can change the brand string in the "brand" variable in src/globals.c
#define SEND_BRAND
// If defined, rebroadcasts ALL incoming movement updates, disconnecting
// movement from the server's tickrate. This makes movement much smoother
// on very low tickrates, at the cost of potential network instability when
@@ -170,6 +175,11 @@ extern uint32_t server_ticks;
extern char motd[];
extern uint8_t motd_len;
#ifdef SEND_BRAND
extern char brand[];
extern uint8_t brand_len;
#endif
extern uint16_t client_count;
typedef struct {

View File

@@ -26,6 +26,7 @@ int cs_playerCommand (int client_fd);
int sc_statusResponse (int client_fd);
int sc_loginSuccess (int client_fd, uint8_t *uuid, char *name);
int sc_knownPacks (int client_fd);
int sc_sendPluginMessage (int client_fd, const char *channel, const uint8_t *data, size_t data_len);
int sc_finishConfiguration (int client_fd);
int sc_loginPlay (int client_fd);
int sc_synchronizePlayerPosition (int client_fd, double x, double y, double z, float yaw, float pitch);