Merge pull request #153 from alliedmodders/auth-fixups

More auth fixups for Steam auth (bug 6243, r=asherkin).
This commit is contained in:
Nicholas Hastings
2014-09-09 16:24:57 -04:00
11 changed files with 283 additions and 126 deletions
+7
View File
@@ -98,6 +98,13 @@ DecodeAuthMethod(const String:auth[], String:method[32], &offset)
{
if ((StrContains(auth, "STEAM_") == 0) || (strncmp("0:", auth, 2) == 0) || (strncmp("1:", auth, 2) == 0))
{
// Steam2 Id
strcopy(method, sizeof(method), AUTHMETHOD_STEAM);
offset = 0;
}
else if (!strncmp(auth, "[U:", 3) && auth[strlen(auth) - 1] == ']')
{
// Steam3 Id
strcopy(method, sizeof(method), AUTHMETHOD_STEAM);
offset = 0;
}
+1 -1
View File
@@ -477,7 +477,7 @@ FetchUser(Handle:db, client)
GetClientIP(client, ipaddr, sizeof(ipaddr));
steamid[0] = '\0';
if (GetClientAuthString(client, steamid, sizeof(steamid)))
if (GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid)))
{
if (StrEqual(steamid, "STEAM_ID_LAN"))
{
+1 -1
View File
@@ -534,7 +534,7 @@ public ParamCheck(client)
}
case SteamId:
{
if (GetClientAuthString(i, infoBuffer, sizeof(infoBuffer)))
if (GetClientAuthId(i, AuthId_Steam2, infoBuffer, sizeof(infoBuffer)))
AddMenuItem(itemMenu, infoBuffer, nameBuffer);
}
case IpAddress:
+1 -1
View File
@@ -356,7 +356,7 @@ native GetAdminUsername(AdminId:id, String:name[], maxlength);
* @param auth Auth method to use, predefined or from RegisterAuthIdentType().
* @param ident String containing the arbitrary, unique identity.
* @return True on success, false if the auth method was not found,
* or ident was already taken.
* ident was already taken, or ident invalid for auth method.
*/
native bool:BindAdminIdentity(AdminId:id, const String:auth[], const String:ident[]);