cookies: Align output with sm_help (#977)
* Update clientprefs.sp * Update clientprefs.sp * Update clientprefs.sp * Update clientprefs.sp * Update clientprefs.sp * Update clientprefs.sp * Create natives.sp * Delete natives.sp
This commit is contained in:
parent
100f1e56ca
commit
4a4b9ce7f0
@ -67,24 +67,19 @@ public Action Command_Cookie(int client, int args)
|
|||||||
Handle iter = GetCookieIterator();
|
Handle iter = GetCookieIterator();
|
||||||
|
|
||||||
char name[30];
|
char name[30];
|
||||||
name[0] = '\0';
|
|
||||||
char description[255];
|
char description[255];
|
||||||
description[0] = '\0';
|
|
||||||
|
|
||||||
PrintToConsole(client, "%t:", "Cookie List");
|
PrintToConsole(client, "%t:", "Cookie List");
|
||||||
|
|
||||||
CookieAccess access;
|
CookieAccess access;
|
||||||
|
|
||||||
while (ReadCookieIterator(iter,
|
int count = 1;
|
||||||
name,
|
|
||||||
sizeof(name),
|
while (ReadCookieIterator(iter, name, sizeof(name), access, description, sizeof(description)) != false)
|
||||||
access,
|
|
||||||
description,
|
|
||||||
sizeof(description)) != false)
|
|
||||||
{
|
{
|
||||||
if (access < CookieAccess_Private)
|
if (access < CookieAccess_Private)
|
||||||
{
|
{
|
||||||
PrintToConsole(client, "%s - %s", name, description);
|
PrintToConsole(client, "[%03d] %s - %s", count++, name, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +94,7 @@ public Action Command_Cookie(int client, int args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char name[30];
|
char name[30];
|
||||||
name[0] = '\0';
|
|
||||||
GetCmdArg(1, name, sizeof(name));
|
GetCmdArg(1, name, sizeof(name));
|
||||||
|
|
||||||
Handle cookie = FindClientCookie(name);
|
Handle cookie = FindClientCookie(name);
|
||||||
@ -120,17 +115,33 @@ public Action Command_Cookie(int client, int args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char value[100];
|
char value[100];
|
||||||
value[0] = '\0';
|
|
||||||
|
|
||||||
if (args == 1)
|
if (args == 1)
|
||||||
{
|
{
|
||||||
|
Handle iter = GetCookieIterator();
|
||||||
|
|
||||||
GetClientCookie(client, cookie, value, sizeof(value));
|
GetClientCookie(client, cookie, value, sizeof(value));
|
||||||
ReplyToCommand(client, "[SM] %t", "Cookie Value", name, value);
|
ReplyToCommand(client, "[SM] %t", "Cookie Value", name, value);
|
||||||
|
|
||||||
|
char CookieName[30];
|
||||||
|
char description[255];
|
||||||
|
|
||||||
|
while (ReadCookieIterator(iter, CookieName, sizeof(CookieName), access, description, sizeof(description)) != false) // We're allowed to re-use access since we're about to return anyways.
|
||||||
|
{
|
||||||
|
if (StrEqual(CookieName, name, true))
|
||||||
|
{
|
||||||
|
TrimString(description);
|
||||||
|
if (description[0] != EOS)
|
||||||
|
ReplyToCommand(client, "- %s", description);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete iter;
|
||||||
delete cookie;
|
delete cookie;
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access == CookieAccess_Protected)
|
if (access == CookieAccess_Protected)
|
||||||
{
|
{
|
||||||
ReplyToCommand(client, "[SM] %t", "Protected Cookie", name);
|
ReplyToCommand(client, "[SM] %t", "Protected Cookie", name);
|
||||||
|
Loading…
Reference in New Issue
Block a user