From 92e95d5a99284b3278e157174dfcbbb82e6c66d0 Mon Sep 17 00:00:00 2001 From: rarified Date: Sat, 16 Mar 2019 14:34:19 -0600 Subject: [PATCH] Add function NetCliAuthGetCurrentConnPort() to plNglGame to provide current Auth server port to Game client connection code. For use where non-default port is being used for Auth/Game servers. --- .../Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp | 9 +++++++++ .../Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h | 1 + .../Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index 978aef9e..2b61278c 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -5215,6 +5215,15 @@ void NetCliAuthStartConnect ( } } +//============================================================================ +unsigned NetCliAuthGetCurrentConnPort() { + unsigned port; + s_critsect.Enter(); + port = NetAddressGetPort(s_active->addr); + s_critsect.Leave(); + return port; +} + //============================================================================ bool NetCliAuthQueryConnected () { diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h index d8d024db..9b21e766 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h @@ -66,6 +66,7 @@ void NetCliAuthStartConnect ( ); bool NetCliAuthQueryConnected (); void NetCliAuthAutoReconnectEnable (bool enable); // is enabled by default +unsigned NetCliAuthGetCurrentConnPort(); // for Game Server socket port // Called after the auth/client connection is encrypted typedef void (*FNetCliAuthConnectCallback)(); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index e08fc897..a2132eda 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -743,7 +743,7 @@ void NetCliGameStartConnect ( const NetAddressNode & node ) { NetAddress addr; - NetAddressFromNode(node, kNetDefaultClientPort, &addr); + NetAddressFromNode(node, NetCliAuthGetCurrentConnPort(), &addr); Connect(addr); }