Add late load to UNLOZE_ForumIntegration and split secret
This commit is contained in:
parent
483d48047c
commit
18a9de4b88
@ -8,11 +8,10 @@
|
|||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <SteamWorks>
|
#include <SteamWorks>
|
||||||
#include <unloze>
|
#include <unloze>
|
||||||
|
#include <UNLOZE.secret> //#define UNLOZE_APIKEY here
|
||||||
|
|
||||||
#pragma newdecls required
|
#pragma newdecls required
|
||||||
|
|
||||||
#define APIKEY "k9Mk2lA3mF9Sk0FoaD"
|
|
||||||
|
|
||||||
/* STRINGS */
|
/* STRINGS */
|
||||||
char G_sGroup[MAXPLAYERS+1][64];
|
char G_sGroup[MAXPLAYERS+1][64];
|
||||||
|
|
||||||
@ -29,9 +28,30 @@ public Plugin myinfo =
|
|||||||
name = "UNLOZE Forum Integration",
|
name = "UNLOZE Forum Integration",
|
||||||
author = ".George & zaCade (Original by Botox)",
|
author = ".George & zaCade (Original by Botox)",
|
||||||
description = "Handles forum access ingame",
|
description = "Handles forum access ingame",
|
||||||
version = "1.2"
|
version = "1.2.1"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose: Late load
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public void OnPluginStart()
|
||||||
|
{
|
||||||
|
/* Late load */
|
||||||
|
for(int client = 1; client <= MaxClients; client++)
|
||||||
|
{
|
||||||
|
if(IsClientConnected(client))
|
||||||
|
OnClientConnected(client);
|
||||||
|
|
||||||
|
if(IsClientAuthorized(client) && !IsFakeClient(client))
|
||||||
|
{
|
||||||
|
char sSteamID32[32];
|
||||||
|
if(GetClientAuthId(client, AuthId_Steam2, sSteamID32, sizeof(sSteamID32)))
|
||||||
|
OnClientAuthorized(client, sSteamID32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -105,7 +125,7 @@ public void OnClientAuthorized(int client, const char[] sSteamID32)
|
|||||||
int iSerial = GetClientSerial(client);
|
int iSerial = GetClientSerial(client);
|
||||||
|
|
||||||
char sRequest[256];
|
char sRequest[256];
|
||||||
FormatEx(sRequest, sizeof(sRequest), "https://unloze.com/api/private_api.php?api_key=%s&steam_id=%s", APIKEY, sSteamID64);
|
FormatEx(sRequest, sizeof(sRequest), "https://unloze.com/api/private_api.php?api_key=%s&steam_id=%s", UNLOZE_APIKEY, sSteamID64);
|
||||||
|
|
||||||
Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, sRequest);
|
Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, sRequest);
|
||||||
if (!hRequest ||
|
if (!hRequest ||
|
||||||
@ -237,7 +257,7 @@ public int Native_HasSteamIDReservedSlot(Handle plugin, int numParams)
|
|||||||
SteamID32toSteamID64(sSteamID32, sSteamID64, sizeof(sSteamID64));
|
SteamID32toSteamID64(sSteamID32, sSteamID64, sizeof(sSteamID64));
|
||||||
|
|
||||||
char sRequest[256];
|
char sRequest[256];
|
||||||
FormatEx(sRequest, sizeof(sRequest), "https://unloze.com/api/private_api.php?api_key=%s&steam_id=%s", APIKEY, sSteamID64);
|
FormatEx(sRequest, sizeof(sRequest), "https://unloze.com/api/private_api.php?api_key=%s&steam_id=%s", UNLOZE_APIKEY, sSteamID64);
|
||||||
|
|
||||||
DataPack hDataPack = new DataPack();
|
DataPack hDataPack = new DataPack();
|
||||||
hDataPack.WriteString(sSteamID32);
|
hDataPack.WriteString(sSteamID32);
|
||||||
|
2
secrets
2
secrets
@ -1 +1 @@
|
|||||||
Subproject commit 090534b1abe620d7219b965855d758fa09896cea
|
Subproject commit 9652845af9651ea14931b71bf6bc74875a210c5b
|
Loading…
Reference in New Issue
Block a user