Unify spectator client accessing native names
Just call them "client" instead of "spectator"
This commit is contained in:
parent
00c6f56c69
commit
b8c666cac0
18
natives.cpp
18
natives.cpp
@ -646,8 +646,8 @@ static cell_t Native_IsClientProxy(IPluginContext *pContext, const cell_t *param
|
||||
return pClient->BaseClient()->IsHLTV();
|
||||
}
|
||||
|
||||
// native SourceTV_GetSpectatorName(client, String:name[], maxlen);
|
||||
static cell_t Native_GetSpectatorName(IPluginContext *pContext, const cell_t *params)
|
||||
// native SourceTV_GetClientName(client, String:name[], maxlen);
|
||||
static cell_t Native_GetClientName(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
if (hltvserver == nullptr)
|
||||
return 0;
|
||||
@ -670,8 +670,8 @@ static cell_t Native_GetSpectatorName(IPluginContext *pContext, const cell_t *pa
|
||||
return 0;
|
||||
}
|
||||
|
||||
// native SourceTV_GetSpectatorIP(client, String:ip[], maxlen);
|
||||
static cell_t Native_GetSpectatorIP(IPluginContext *pContext, const cell_t *params)
|
||||
// native SourceTV_GetClientIP(client, String:ip[], maxlen);
|
||||
static cell_t Native_GetClientIP(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
if (hltvserver == nullptr)
|
||||
return 0;
|
||||
@ -694,8 +694,8 @@ static cell_t Native_GetSpectatorIP(IPluginContext *pContext, const cell_t *para
|
||||
return 0;
|
||||
}
|
||||
|
||||
// native SourceTV_GetSpectatorPassword(client, String:password[], maxlen);
|
||||
static cell_t Native_GetSpectatorPassword(IPluginContext *pContext, const cell_t *params)
|
||||
// native SourceTV_GetClientPassword(client, String:password[], maxlen);
|
||||
static cell_t Native_GetClientPassword(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
if (hltvserver == nullptr)
|
||||
return 0;
|
||||
@ -776,10 +776,10 @@ const sp_nativeinfo_t sourcetv_natives[] =
|
||||
{ "SourceTV_GetMaxClients", Native_GetMaxClients },
|
||||
{ "SourceTV_GetClientCount", Native_GetClientCount },
|
||||
{ "SourceTV_IsClientConnected", Native_IsClientConnected },
|
||||
{ "SourceTV_GetSpectatorName", Native_GetSpectatorName },
|
||||
{ "SourceTV_GetSpectatorIP", Native_GetSpectatorIP },
|
||||
{ "SourceTV_GetSpectatorPassword", Native_GetSpectatorPassword },
|
||||
{ "SourceTV_IsClientProxy", Native_IsClientProxy },
|
||||
{ "SourceTV_GetClientName", Native_GetClientName },
|
||||
{ "SourceTV_GetClientIP", Native_GetClientIP },
|
||||
{ "SourceTV_GetClientPassword", Native_GetClientPassword },
|
||||
{ "SourceTV_KickClient", Native_KickClient },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
@ -181,15 +181,16 @@ public Action:Cmd_GetDelay(client, args)
|
||||
public Action:Cmd_Spectators(client, args)
|
||||
{
|
||||
ReplyToCommand(client, "SourceTV spectator count: %d/%d", SourceTV_GetSpectatorCount(), SourceTV_GetClientCount());
|
||||
new String:sName[64], String:sIP[16];
|
||||
new String:sName[64], String:sIP[16], String:sPassword[256];
|
||||
for (new i=1;i<=SourceTV_GetClientCount();i++)
|
||||
{
|
||||
if (!SourceTV_IsClientConnected(i))
|
||||
continue;
|
||||
|
||||
SourceTV_GetSpectatorName(i, sName, sizeof(sName));
|
||||
SourceTV_GetSpectatorIP(i, sIP, sizeof(sIP));
|
||||
ReplyToCommand(client, "Client %d%s: %s - %s", i, (SourceTV_IsClientProxy(i)?" (RELAY)":""), sName, sIP);
|
||||
SourceTV_GetClientName(i, sName, sizeof(sName));
|
||||
SourceTV_GetClientIP(i, sIP, sizeof(sIP));
|
||||
SourceTV_GetClientPassword(i, sPassword, sizeof(sPassword));
|
||||
ReplyToCommand(client, "Client %d%s: %s - %s (password: %s)", i, (SourceTV_IsClientProxy(i)?" (RELAY)":""), sName, sIP, sPassword);
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ native bool:SourceTV_IsClientProxy(client);
|
||||
* @noreturn
|
||||
* @error Invalid client index or not connected.
|
||||
*/
|
||||
native SourceTV_GetSpectatorName(client, String:name[], maxlen);
|
||||
native SourceTV_GetClientName(client, String:name[], maxlen);
|
||||
|
||||
/**
|
||||
* Get the IP of a SourceTV spectator client.
|
||||
@ -361,7 +361,7 @@ native SourceTV_GetSpectatorName(client, String:name[], maxlen);
|
||||
* @noreturn
|
||||
* @error Invalid client index or not connected.
|
||||
*/
|
||||
native SourceTV_GetSpectatorIP(client, String:ip[], maxlen);
|
||||
native SourceTV_GetClientIP(client, String:ip[], maxlen);
|
||||
|
||||
/**
|
||||
* Get the password of a SourceTV spectator client.
|
||||
@ -374,7 +374,7 @@ native SourceTV_GetSpectatorIP(client, String:ip[], maxlen);
|
||||
* @noreturn
|
||||
* @error Invalid client index or not connected.
|
||||
*/
|
||||
native SourceTV_GetSpectatorPassword(client, String:password[], maxlen);
|
||||
native SourceTV_GetClientPassword(client, String:password[], maxlen);
|
||||
|
||||
/**
|
||||
* Kick a SourceTV spectator client.
|
||||
@ -485,10 +485,10 @@ public __ext_stvmngr_SetNTVOptional()
|
||||
MarkNativeAsOptional("SourceTV_GetMaxClients");
|
||||
MarkNativeAsOptional("SourceTV_GetClientCount");
|
||||
MarkNativeAsOptional("SourceTV_IsClientConnected");
|
||||
MarkNativeAsOptional("SourceTV_GetSpectatorName");
|
||||
MarkNativeAsOptional("SourceTV_GetSpectatorIP");
|
||||
MarkNativeAsOptional("SourceTV_GetSpectatorPassword");
|
||||
MarkNativeAsOptional("SourceTV_IsClientProxy");
|
||||
MarkNativeAsOptional("SourceTV_GetClientName");
|
||||
MarkNativeAsOptional("SourceTV_GetClientIP");
|
||||
MarkNativeAsOptional("SourceTV_GetClientPassword");
|
||||
MarkNativeAsOptional("SourceTV_KickClient");
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user