mirror of
https://github.com/TribesNext/t2-scripts.git
synced 2026-07-13 07:14:32 +00:00
Merge pull request #2 from Ragora/master
Fixed T2 crash when running in Listen mode
This commit is contained in:
commit
29eb0c7376
2 changed files with 13 additions and 1 deletions
|
|
@ -290,6 +290,12 @@ function t2csri_processDownloadCompletion()
|
||||||
function t2csri_gameServerHexAddress()
|
function t2csri_gameServerHexAddress()
|
||||||
{
|
{
|
||||||
%ip = ServerConnection.getAddress();
|
%ip = ServerConnection.getAddress();
|
||||||
|
|
||||||
|
// DarkDragonDX: Fix listen server crashes because .getAddress() returns
|
||||||
|
// "local" when in listen
|
||||||
|
if (trim(%ip) $= "local")
|
||||||
|
%ip = "IP:127.0.0.1:" @ $Host::Port; // Build the local IP ourselves
|
||||||
|
|
||||||
%ip = getSubStr(%ip, strstr(%ip, ":") + 1, strlen(%ip));
|
%ip = getSubStr(%ip, strstr(%ip, ":") + 1, strlen(%ip));
|
||||||
%ip = getSubStr(%ip, 0, strstr(%ip, ":"));
|
%ip = getSubStr(%ip, 0, strstr(%ip, ":"));
|
||||||
%ip = strReplace(%ip, ".", " ");
|
%ip = strReplace(%ip, ".", " ");
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,12 @@ function serverCmdt2csri_sendCertChunk(%client, %chunk)
|
||||||
function t2csri_gameClientHexAddress(%client)
|
function t2csri_gameClientHexAddress(%client)
|
||||||
{
|
{
|
||||||
%ip = %client.getAddress();
|
%ip = %client.getAddress();
|
||||||
|
|
||||||
|
// DarkDragonDX: Fix listen server crashes because .getAddress() returns
|
||||||
|
// "local" when in listen
|
||||||
|
if (trim(%ip) $= "local")
|
||||||
|
%ip = "IP:127.0.0.1:" @ $Host::Port; // Just build the local IP
|
||||||
|
|
||||||
%ip = getSubStr(%ip, strstr(%ip, ":") + 1, strlen(%ip));
|
%ip = getSubStr(%ip, strstr(%ip, ":") + 1, strlen(%ip));
|
||||||
%ip = getSubStr(%ip, 0, strstr(%ip, ":"));
|
%ip = getSubStr(%ip, 0, strstr(%ip, ":"));
|
||||||
%ip = strReplace(%ip, ".", " ");
|
%ip = strReplace(%ip, ".", " ");
|
||||||
|
|
@ -291,7 +297,7 @@ package t2csri_server
|
||||||
// clan support will be implemented via delegation to a community server
|
// clan support will be implemented via delegation to a community server
|
||||||
function GameConnection::getAuthInfo(%client)
|
function GameConnection::getAuthInfo(%client)
|
||||||
{
|
{
|
||||||
if (%client.getAddress() $= "Local" && %client.t2csri_authInfo $= "")
|
if (trim(%client.getAddress()) $= "local" && %client.t2csri_authInfo $= "")
|
||||||
%client.t2csri_authInfo = WONGetAuthInfo();
|
%client.t2csri_authInfo = WONGetAuthInfo();
|
||||||
return %client.t2csri_authInfo;
|
return %client.t2csri_authInfo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue