Browse Source

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.
rarified/gameserverportfix
rarified 5 years ago
parent
commit
92e95d5a99
  1. 9
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  2. 1
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h
  3. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp

9
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 () { bool NetCliAuthQueryConnected () {

1
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h

@ -66,6 +66,7 @@ void NetCliAuthStartConnect (
); );
bool NetCliAuthQueryConnected (); bool NetCliAuthQueryConnected ();
void NetCliAuthAutoReconnectEnable (bool enable); // is enabled by default void NetCliAuthAutoReconnectEnable (bool enable); // is enabled by default
unsigned NetCliAuthGetCurrentConnPort(); // for Game Server socket port
// Called after the auth/client connection is encrypted // Called after the auth/client connection is encrypted
typedef void (*FNetCliAuthConnectCallback)(); typedef void (*FNetCliAuthConnectCallback)();

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp

@ -743,7 +743,7 @@ void NetCliGameStartConnect (
const NetAddressNode & node const NetAddressNode & node
) { ) {
NetAddress addr; NetAddress addr;
NetAddressFromNode(node, kNetDefaultClientPort, &addr); NetAddressFromNode(node, NetCliAuthGetCurrentConnPort(), &addr);
Connect(addr); Connect(addr);
} }

Loading…
Cancel
Save