From 9b729ed19e7c8483fc681ad626b3ed9da861311d Mon Sep 17 00:00:00 2001 From: MatthewBeshay <92357869+MatthewBeshay@users.noreply.github.com> Date: Thu, 9 Apr 2026 21:57:30 +1000 Subject: [PATCH] refactor: drop GameNetworkManager.h transitive include from Socket.h --- targets/app/common/Network/GameNetworkManager.h | 2 -- targets/app/common/Network/Socket.cpp | 1 - targets/app/common/Network/Socket.h | 7 ++++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/targets/app/common/Network/GameNetworkManager.h b/targets/app/common/Network/GameNetworkManager.h index 5c1119e79..c8de48bfd 100644 --- a/targets/app/common/Network/GameNetworkManager.h +++ b/targets/app/common/Network/GameNetworkManager.h @@ -22,8 +22,6 @@ class FriendSessionInfo; class INVITE_INFO; class INetworkPlayer; -const int NON_QNET_SENDDATA_ACK_REQUIRED = 1; - // This class implements the game-side interface to the networking system. As // such, it is platform independent and may contain bits of game-side code where // appropriate. It shouldn't ever reference any platform specifics of the diff --git a/targets/app/common/Network/Socket.cpp b/targets/app/common/Network/Socket.cpp index 68c3e3c7a..afae4a595 100644 --- a/targets/app/common/Network/Socket.cpp +++ b/targets/app/common/Network/Socket.cpp @@ -6,7 +6,6 @@ #include #include -// 4jcraft TODO #include "app/common/Network/GameNetworkManager.h" #include "minecraft/network/platform/NetworkPlayerInterface.h" #include "minecraft/server/network/ServerConnection.h" diff --git a/targets/app/common/Network/Socket.h b/targets/app/common/Network/Socket.h index 25037db28..787e8c251 100644 --- a/targets/app/common/Network/Socket.h +++ b/targets/app/common/Network/Socket.h @@ -10,7 +10,6 @@ #include #include -#include "app/common/Network/GameNetworkManager.h" #include "java/InputOutputStream/InputStream.h" #include "java/InputOutputStream/OutputStream.h" #include "minecraft/network/platform/NetworkPlayerInterface.h" @@ -21,6 +20,12 @@ class INetworkPlayer; #define SOCKET_CLIENT_END 0 #define SOCKET_SERVER_END 1 +// Flag bit for Socket::SocketOutputStream::writeWithFlags. Marks +// the message as needing positive acknowledgement before the caller +// can consider it delivered. Defined here so consumers don't have to +// drag in the entire CGameNetworkManager header just for this constant. +inline constexpr int NON_QNET_SENDDATA_ACK_REQUIRED = 1; + class SocketAddress; class ServerConnection;