Skip to content

Commit

Permalink
fix(ip): Fallback on public IP if net_public_adr fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushaway authored Jul 18, 2024
1 parent 5dfcb71 commit a486e58
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/sourcemod/scripting/CallAdmin.sp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Plugin myinfo =
name = PLUGIN_NAME,
author = "inGame, maxime1907, .Rushaway",
description = "Send a calladmin message to discord",
version = "2.0.2",
version = "2.0.3",
url = "https://github.com/srcdslab/sm-plugin-CallAdmin"
};

Expand Down Expand Up @@ -387,11 +387,11 @@ stock void SendWebHook(int userid, char sReason[256], char sWebhookURL[WEBHOOK_U
}

g_cvNetPublicAddr = FindConVar("net_public_adr");
if (g_cvNetPublicAddr != null)
{
GetConVarString(g_cvNetPublicAddr, sNetIP, sizeof(sNetIP));
delete g_cvNetPublicAddr;
}
if (g_cvNetPublicAddr == null)
g_cvNetPublicAddr = FindConVar("hostip");

GetConVarString(g_cvNetPublicAddr, sNetIP, sizeof(sNetIP));
delete g_cvNetPublicAddr;

GetConVarString(g_cvRedirectURL, sURL, sizeof(sURL));
FormatEx(sConnect, sizeof(sConnect), "[%s:%s](%s?ip=%s&port=%s)", sNetIP, sNetPort, sURL, sNetIP, sNetPort);
Expand Down

0 comments on commit a486e58

Please sign in to comment.