aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Network/SessionInfo.h
diff options
context:
space:
mode:
authorlspepinho <162769565+lspepinho@users.noreply.github.com>2026-03-02 20:30:22 -0300
committerGitHub <noreply@github.com>2026-03-03 06:30:22 +0700
commit8b28c20d7adc3824f96fbcc34ad65d778a97a05b (patch)
treee61705a557e4e064d707ec542c53dbdac1acbe09 /Minecraft.Client/Common/Network/SessionInfo.h
parent15129932da9442c2815974c519258345b22d5588 (diff)
Fixes for PR #96 (#170)
* Implement basic multiplayer functionality * Update README.md --------- Co-authored-by: Slenderman <ssimulpong@outlook.com>
Diffstat (limited to 'Minecraft.Client/Common/Network/SessionInfo.h')
-rw-r--r--Minecraft.Client/Common/Network/SessionInfo.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/Minecraft.Client/Common/Network/SessionInfo.h b/Minecraft.Client/Common/Network/SessionInfo.h
index 31472a19..ce6365bc 100644
--- a/Minecraft.Client/Common/Network/SessionInfo.h
+++ b/Minecraft.Client/Common/Network/SessionInfo.h
@@ -23,9 +23,9 @@ typedef struct _GameSessionData
_GameSessionData()
{
netVersion = 0;
- memset(hostName,0,XUSER_NAME_SIZE);
- memset(players,0,MINECRAFT_NET_MAX_PLAYERS*sizeof(players[0]));
- memset(szPlayers,0,MINECRAFT_NET_MAX_PLAYERS*XUSER_NAME_SIZE);
+ memset(hostName, 0, XUSER_NAME_SIZE);
+ memset(players, 0, MINECRAFT_NET_MAX_PLAYERS * sizeof(players[0]));
+ memset(szPlayers, 0, MINECRAFT_NET_MAX_PLAYERS * XUSER_NAME_SIZE);
isJoinable = true;
m_uiGameHostSettings = 0;
texturePackParentId = 0;
@@ -50,7 +50,7 @@ typedef struct _GameSessionData
_GameSessionData()
{
netVersion = 0;
- memset(players,0,MINECRAFT_NET_MAX_PLAYERS*sizeof(players[0]));
+ memset(players, 0, MINECRAFT_NET_MAX_PLAYERS * sizeof(players[0]));
isJoinable = true;
m_uiGameHostSettings = 0;
texturePackParentId = 0;
@@ -63,12 +63,19 @@ typedef struct _GameSessionData
#else
typedef struct _GameSessionData
{
- unsigned short netVersion; // 2 bytes
- unsigned int m_uiGameHostSettings; // 4 bytes
- unsigned int texturePackParentId; // 4 bytes
- unsigned char subTexturePackId; // 1 byte
+ unsigned short netVersion;
+ unsigned int m_uiGameHostSettings;
+ unsigned int texturePackParentId;
+ unsigned char subTexturePackId;
- bool isReadyToJoin; // 1 byte
+ bool isReadyToJoin;
+ bool isJoinable;
+
+ char hostIP[64];
+ int hostPort;
+ wchar_t hostName[XUSER_NAME_SIZE];
+ unsigned char playerCount;
+ unsigned char maxPlayers;
_GameSessionData()
{
@@ -76,6 +83,13 @@ typedef struct _GameSessionData
m_uiGameHostSettings = 0;
texturePackParentId = 0;
subTexturePackId = 0;
+ isReadyToJoin = false;
+ isJoinable = true;
+ memset(hostIP, 0, sizeof(hostIP));
+ hostPort = 0;
+ memset(hostName, 0, sizeof(hostName));
+ playerCount = 0;
+ maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
}
} GameSessionData;
#endif
@@ -91,7 +105,7 @@ public:
#elif defined(_DURANGO)
DQRNetworkManager::SessionSearchResult searchResult;
#endif
- wchar_t *displayLabel;
+ wchar_t* displayLabel;
unsigned char displayLabelLength;
unsigned char displayLabelViewableStartIndex;
GameSessionData data;
@@ -107,7 +121,7 @@ public:
~FriendSessionInfo()
{
- if(displayLabel!=NULL)
+ if (displayLabel != NULL)
delete displayLabel;
}
};