Compare commits

..

No commits in common. "4b83a7a3d53b833b98fdc4cee05e7b1df82ad7d5" and "570d8e43b2d860a39159c50b4c7198c61fcce0e1" have entirely different histories.

13 changed files with 19 additions and 41 deletions

View File

@ -136,7 +136,7 @@ Steam_Client *get_steam_clientserver_old()
static bool steamclient_has_ipv6_functions_flag; static bool steamclient_has_ipv6_functions_flag;
bool steamclient_has_ipv6_functions() bool steamclient_has_ipv6_functions()
{ {
return steamclient_has_ipv6_functions_flag || get_steam_client()->gameserver_has_ipv6_functions; return steamclient_has_ipv6_functions_flag;
} }
static void *create_client_interface(const char *ver) static void *create_client_interface(const char *ver)

View File

@ -5843,15 +5843,9 @@ STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation( IStea
return self->GetServerReputation(); return self->GetServerReputation();
} }
STEAMAPI_API void *SteamAPI_ISteamGameServer_GetPublicIP( intptr_t instancePtr, void *instancePtr_possible ) STEAMAPI_API SteamIPAddress_t SteamAPI_ISteamGameServer_GetPublicIP( ISteamGameServer* self )
{ {
//abuse call convention rules to get this working. return self->GetPublicIP();
if (steamclient_has_ipv6_functions()) {
get_steam_client()->steam_gameserver->GetPublicIP_fix((SteamIPAddress_t *)instancePtr);
return (void *)instancePtr;
} else {
return (void *)((ISteamGameServer012 *)instancePtr)->GetPublicIP_old();
}
} }
STEAMAPI_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket( ISteamGameServer* self, const void * pData, int cbData, uint32 srcIP, uint16 srcPort ) STEAMAPI_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket( ISteamGameServer* self, const void * pData, int cbData, uint32 srcIP, uint16 srcPort )

View File

@ -232,10 +232,10 @@ static void kill_socket(sock_t sock)
static void kill_tcp_socket(struct TCP_Socket &socket) static void kill_tcp_socket(struct TCP_Socket &socket)
{ {
kill_socket(socket.sock); kill_socket(socket.sock);
socket = TCP_Socket(); socket = TCP_Socket();
} }
static bool initialed;
static void run_at_startup() static void run_at_startup()
{ {
static bool initialed = false; static bool initialed = false;
@ -1271,6 +1271,7 @@ bool Networking::isAlive()
return alive; return alive;
} }
void Networking::startQuery(IP_PORT ip_port) void Networking::startQuery(IP_PORT ip_port)
{ {
if (ip_port.port <= 1024) if (ip_port.port <= 1024)

View File

@ -86,8 +86,8 @@ struct Connection {
class Networking { class Networking {
bool enabled = false; bool enabled = false;
bool alive;
bool query_alive; bool query_alive;
bool alive;
std::chrono::high_resolution_clock::time_point last_run; std::chrono::high_resolution_clock::time_point last_run;
sock_t query_socket, udp_socket, tcp_socket; sock_t query_socket, udp_socket, tcp_socket;
uint16 udp_port, tcp_port; uint16 udp_port, tcp_port;

View File

@ -109,8 +109,6 @@ Steam_Client::Steam_Client()
steam_gameserver_game_coordinator = new Steam_Game_Coordinator(settings_server, network, callback_results_server, callbacks_server, run_every_runcb); steam_gameserver_game_coordinator = new Steam_Game_Coordinator(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
steam_masterserver_updater = new Steam_Masterserver_Updater(settings_server, network, callback_results_server, callbacks_server, run_every_runcb); steam_masterserver_updater = new Steam_Masterserver_Updater(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
gameserver_has_ipv6_functions = false;
last_cb_run = 0; last_cb_run = 0;
PRINT_DEBUG("client init end\n"); PRINT_DEBUG("client init end\n");
} }
@ -305,10 +303,8 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte
} else if (strcmp(pchVersion, "SteamGameServer012") == 0) { } else if (strcmp(pchVersion, "SteamGameServer012") == 0) {
return (ISteamGameServer *)(void *)(ISteamGameServer012 *)steam_gameserver; return (ISteamGameServer *)(void *)(ISteamGameServer012 *)steam_gameserver;
} else if (strcmp(pchVersion, STEAMGAMESERVER_INTERFACE_VERSION) == 0) { } else if (strcmp(pchVersion, STEAMGAMESERVER_INTERFACE_VERSION) == 0) {
gameserver_has_ipv6_functions = true;
return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver; return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver;
} else { } else {
gameserver_has_ipv6_functions = true;
return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver; return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver;
} }

View File

@ -139,8 +139,6 @@ public:
unsigned steam_pipe_counter = 1; unsigned steam_pipe_counter = 1;
std::map<HSteamPipe, enum Steam_Pipe> steam_pipes; std::map<HSteamPipe, enum Steam_Pipe> steam_pipes;
bool gameserver_has_ipv6_functions;
Steam_Client(); Steam_Client();
~Steam_Client(); ~Steam_Client();
// Creates a communication pipe to the Steam client. // Creates a communication pipe to the Steam client.

View File

@ -81,7 +81,7 @@ void Steam_GameServer::SetProduct( const char *pszProduct )
{ {
PRINT_DEBUG("SetProduct\n"); PRINT_DEBUG("SetProduct\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex); std::lock_guard<std::recursive_mutex> lock(global_mutex);
server_data.set_product(pszProduct);// Set product to game name if this is empty server_data.set_product(pszProduct);
} }
@ -617,12 +617,6 @@ SteamIPAddress_t Steam_GameServer::GetPublicIP()
return ip; return ip;
} }
void Steam_GameServer::GetPublicIP_fix(SteamIPAddress_t *out)
{
PRINT_DEBUG("GetPublicIP_fix\n");
if (out) *out = GetPublicIP();
}
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own // These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
// socket to talk to the master server on, it lets the game use its socket to forward messages // socket to talk to the master server on, it lets the game use its socket to forward messages
// back and forth. This prevents us from requiring server ops to open up yet another port // back and forth. This prevents us from requiring server ops to open up yet another port

View File

@ -291,7 +291,6 @@ public:
// connect to // connect to
uint32 GetPublicIP_old(); uint32 GetPublicIP_old();
SteamIPAddress_t GetPublicIP(); SteamIPAddress_t GetPublicIP();
void GetPublicIP_fix(SteamIPAddress_t *out);
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own // These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
// socket to talk to the master server on, it lets the game use its socket to forward messages // socket to talk to the master server on, it lets the game use its socket to forward messages

View File

@ -239,7 +239,6 @@ bool GetAchievement( const char *pchName, bool *pbAchieved )
try { try {
auto it = defined_achievements_find(pchName); auto it = defined_achievements_find(pchName);
if (it == defined_achievements.end()) return false;
std::string pch_name = it->value("name", std::string()); std::string pch_name = it->value("name", std::string());
auto ach = user_achievements.find(pch_name); auto ach = user_achievements.find(pch_name);
@ -262,7 +261,6 @@ bool SetAchievement( const char *pchName )
try { try {
auto it = defined_achievements_find(pchName); auto it = defined_achievements_find(pchName);
if (it == defined_achievements.end()) return false;
std::string pch_name = it->value("name", std::string()); std::string pch_name = it->value("name", std::string());
if (it != defined_achievements.end()) { if (it != defined_achievements.end()) {
@ -290,7 +288,6 @@ bool ClearAchievement( const char *pchName )
try { try {
auto it = defined_achievements_find(pchName); auto it = defined_achievements_find(pchName);
if (it == defined_achievements.end()) return false;
std::string pch_name = it->value("name", std::string()); std::string pch_name = it->value("name", std::string());
if (it != defined_achievements.end()) { if (it != defined_achievements.end()) {
@ -316,7 +313,6 @@ bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32
try { try {
auto it = defined_achievements_find(pchName); auto it = defined_achievements_find(pchName);
if (it == defined_achievements.end()) return false;
std::string pch_name = it->value("name", std::string()); std::string pch_name = it->value("name", std::string());
auto ach = user_achievements.find(pch_name); auto ach = user_achievements.find(pch_name);
@ -421,8 +417,6 @@ bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint
try { try {
auto it = defined_achievements_find(pchName); auto it = defined_achievements_find(pchName);
if (it == defined_achievements.end()) return false;
std::string pch_name = it->value("name", std::string()); std::string pch_name = it->value("name", std::string());
auto ach = user_achievements.find(pch_name); auto ach = user_achievements.find(pch_name);

View File

@ -190,6 +190,8 @@ public:
// connect to // connect to
virtual uint32 GetPublicIP_old() = 0; virtual uint32 GetPublicIP_old() = 0;
virtual SteamIPAddress_t GetPublicIP() = 0;
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own // These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
// socket to talk to the master server on, it lets the game use its socket to forward messages // socket to talk to the master server on, it lets the game use its socket to forward messages
// back and forth. This prevents us from requiring server ops to open up yet another port // back and forth. This prevents us from requiring server ops to open up yet another port

View File

@ -1011,7 +1011,7 @@ STEAMAPI_API EUserHasLicenseForAppResult SteamAPI_ISteamGameServer_UserHasLicens
STEAMAPI_API bool SteamAPI_ISteamGameServer_RequestUserGroupStatus( ISteamGameServer* self, uint64_steamid steamIDUser, uint64_steamid steamIDGroup ); STEAMAPI_API bool SteamAPI_ISteamGameServer_RequestUserGroupStatus( ISteamGameServer* self, uint64_steamid steamIDUser, uint64_steamid steamIDGroup );
STEAMAPI_API void SteamAPI_ISteamGameServer_GetGameplayStats( ISteamGameServer* self ); STEAMAPI_API void SteamAPI_ISteamGameServer_GetGameplayStats( ISteamGameServer* self );
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation( ISteamGameServer* self ); STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation( ISteamGameServer* self );
//STEAMAPI_API SteamIPAddress_t SteamAPI_ISteamGameServer_GetPublicIP( ISteamGameServer* self ); STEAMAPI_API SteamIPAddress_t SteamAPI_ISteamGameServer_GetPublicIP( ISteamGameServer* self );
STEAMAPI_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket( ISteamGameServer* self, const void * pData, int cbData, uint32 srcIP, uint16 srcPort ); STEAMAPI_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket( ISteamGameServer* self, const void * pData, int cbData, uint32 srcIP, uint16 srcPort );
STEAMAPI_API int SteamAPI_ISteamGameServer_GetNextOutgoingPacket( ISteamGameServer* self, void * pOut, int cbMaxOut, uint32 * pNetAdr, uint16 * pPort ); STEAMAPI_API int SteamAPI_ISteamGameServer_GetNextOutgoingPacket( ISteamGameServer* self, void * pOut, int cbMaxOut, uint32 * pNetAdr, uint16 * pPort );
STEAMAPI_API void SteamAPI_ISteamGameServer_EnableHeartbeats( ISteamGameServer* self, bool bActive ); STEAMAPI_API void SteamAPI_ISteamGameServer_EnableHeartbeats( ISteamGameServer* self, bool bActive );

Binary file not shown.

Binary file not shown.