further logmessages that are helpful atm
This commit is contained in:
parent
2ad829bd54
commit
31d550bbcf
@ -97,8 +97,10 @@ public void OnClientDisconnect(int client)
|
|||||||
public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], const char[] sIP, const char[] sSteam32ID, char sRejectReason[255])
|
public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], const char[] sIP, const char[] sSteam32ID, char sRejectReason[255])
|
||||||
{
|
{
|
||||||
// Server not full, nothing to do...
|
// Server not full, nothing to do...
|
||||||
if(GetClientCount(false) < MaxClients)
|
if (GetClientCount(false) < MaxClients)
|
||||||
|
{
|
||||||
return k_OnClientPreConnectEx_Accept;
|
return k_OnClientPreConnectEx_Accept;
|
||||||
|
}
|
||||||
|
|
||||||
// Try to get precached admin id.
|
// Try to get precached admin id.
|
||||||
AdminId admin = FindAdminByIdentity(AUTHMETHOD_STEAM, sSteam32ID);
|
AdminId admin = FindAdminByIdentity(AUTHMETHOD_STEAM, sSteam32ID);
|
||||||
@ -108,7 +110,6 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
|
|||||||
if(admin != INVALID_ADMIN_ID && GetAdminFlag(admin, Admin_Reservation))
|
if(admin != INVALID_ADMIN_ID && GetAdminFlag(admin, Admin_Reservation))
|
||||||
{
|
{
|
||||||
Immunity = GetAdminImmunityLevel(admin);
|
Immunity = GetAdminImmunityLevel(admin);
|
||||||
|
|
||||||
if(!KickValidClient(sName, sSteam32ID, admin, Immunity))
|
if(!KickValidClient(sName, sSteam32ID, admin, Immunity))
|
||||||
{
|
{
|
||||||
Format(sRejectReason, sizeof(sRejectReason), "No reserved slot available, sorry.");
|
Format(sRejectReason, sizeof(sRejectReason), "No reserved slot available, sorry.");
|
||||||
@ -131,6 +132,7 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
|
|||||||
pack.WriteCell(Immunity);
|
pack.WriteCell(Immunity);
|
||||||
pack.WriteString(sName);
|
pack.WriteString(sName);
|
||||||
|
|
||||||
|
LogMessage("here before AsyncHasSteamIDReservedSlot: sName: %s. sSteam32ID: %s", sName, sSteam32ID);
|
||||||
AsyncHasSteamIDReservedSlot(sSteam32ID, AsyncHasSteamIDReservedSlotCallback, pack);
|
AsyncHasSteamIDReservedSlot(sSteam32ID, AsyncHasSteamIDReservedSlotCallback, pack);
|
||||||
return k_OnClientPreConnectEx_Async;
|
return k_OnClientPreConnectEx_Async;
|
||||||
}
|
}
|
||||||
@ -145,6 +147,7 @@ public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Res
|
|||||||
// Slot free'd up while waiting or doesn't have a reserved slot?
|
// Slot free'd up while waiting or doesn't have a reserved slot?
|
||||||
if(GetClientCount(false) < MaxClients || Result <= 0)
|
if(GetClientCount(false) < MaxClients || Result <= 0)
|
||||||
{
|
{
|
||||||
|
LogMessage("here in return: sSteam32ID: %s. Result: %i", sSteam32ID, Result);
|
||||||
delete pack;
|
delete pack;
|
||||||
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
|
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
|
||||||
return;
|
return;
|
||||||
@ -162,10 +165,15 @@ public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Res
|
|||||||
if(Result > Immunity)
|
if(Result > Immunity)
|
||||||
Immunity = Result;
|
Immunity = Result;
|
||||||
|
|
||||||
|
LogMessage("here 2: sName: %s. sSteam32ID: %s. Result: %i", sName, sSteam32ID, Result);
|
||||||
if(!KickValidClient(sName, sSteam32ID, admin, Immunity))
|
if(!KickValidClient(sName, sSteam32ID, admin, Immunity))
|
||||||
|
{
|
||||||
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Reject, "No reserved slot available, sorry.");
|
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Reject, "No reserved slot available, sorry.");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
|
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId admin, int Immunity)
|
stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId admin, int Immunity)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user