Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cookie.IsSet() #2218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugins/include/clientprefs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ methodmap Cookie < Handle {
this.Set(client, sValue);
}


// Retrieve the value of a Client preference cookie.
//
// @param client Client index.
Expand Down Expand Up @@ -202,6 +201,16 @@ methodmap Cookie < Handle {
return value;
}

// Checks whether a Client preference cookie has been set (is not an empty string).
//
// @param client Client index.
// @error Invalid cookie handle or invalid client index.
public bool IsSet(int client) {
char buffer[2];
this.Get(client, buffer, sizeof(buffer));
return buffer[0] != '\0';
}

// Set the value of a Client preference cookie based on an authID string.
//
// @param authID String Auth/STEAM ID of player to set.
Expand Down