plugins/include/clientprefs.inc
author Scott Ehlert <ds@alliedmods.net>
Thu Apr 24 10:25:44 2008 +0000 (2008-04-24)
changeset 2023 1bd756a9f8db
parent 2009 1a1236dfdbb1
child 2048 2454ff4d6afb
permissions -rw-r--r--
Added any tag to ADT array functions to fix potential tag mismatches
     1 /**
     2  * vim: set ts=4 :
     3  * =============================================================================
     4  * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
     5  * =============================================================================
     6  *
     7  * This file is part of the SourceMod/SourcePawn SDK.
     8  *
     9  * This program is free software; you can redistribute it and/or modify it under
    10  * the terms of the GNU General Public License, version 3.0, as published by the
    11  * Free Software Foundation.
    12  * 
    13  * This program is distributed in the hope that it will be useful, but WITHOUT
    14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    15  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    16  * details.
    17  *
    18  * You should have received a copy of the GNU General Public License along with
    19  * this program.  If not, see <http://www.gnu.org/licenses/>.
    20  *
    21  * As a special exception, AlliedModders LLC gives you permission to link the
    22  * code of this program (as well as its derivative works) to "Half-Life 2," the
    23  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    24  * by the Valve Corporation.  You must obey the GNU General Public License in
    25  * all respects for all other code used.  Additionally, AlliedModders LLC grants
    26  * this exception to all derivative works.  AlliedModders LLC defines further
    27  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    28  * or <http://www.sourcemod.net/license.php>.
    29  *
    30  * Version: $Id$
    31  */
    32  
    33 #if defined _clientprefs_included
    34  #endinput
    35 #endif
    36 #define _clientprefs_included
    37 
    38 /**
    39  * Creates a new Client preference cookie.
    40  *
    41  * @param name			Name of the new preference cookie.
    42  * @param description	Optional description of the preference cookie.
    43  * @return				A handle to the newly created cookie. If the cookie already exists, a handle to it will still be returned.
    44  * @error				Cookie name is blank.
    45  */
    46 native Handle:RegClientPrefCookie(const String:name[], const String:description[]);
    47 
    48 /**
    49  * Searches for a Client preference cookie.
    50  *
    51  * @param name			Name of cookie to find.
    52  * @return				A handle to the cookie if it is found. INVALID_HANDLE otherwise.
    53  */
    54 native Handle:FindClientPrefCookie(const String:name[]);
    55 
    56 /**
    57  * Set the value of a Client preference cookie.
    58  *
    59  * @param client		Client index.
    60  * @param cookie		Client preference cookie handle.
    61  * @param value			String value to set.
    62  * @noreturn			
    63  * @error				Invalid cookie handle or invalid client index.
    64  */
    65 native SetClientPrefCookie(client, Handle:cookie, const String:value[]);
    66 
    67 /**
    68  * Retrieve the value of a Client preference cookie.
    69  *
    70  * @param client		Client index.
    71  * @param cookie		Client preference cookie handle.
    72  * @param buffer		Copyback buffer for value.
    73  * @param maxlen		Maximum length of the buffer.
    74  * @error				Invalid cookie handle or invalid client index.
    75  */
    76 native GetClientPrefCookie(client, Handle:cookie, String:buffer[], maxlen);
    77 
    78 /**
    79  * Checks if a clients cookies have been loaded from the database.
    80  *
    81  * @param client		Client index.
    82  * @return 				True if loaded, false otherwise.
    83  * @error				Invalid client index.
    84  */
    85 native bool:AreClientCookiesCached(client);
    86 
    87 /**
    88  * Called once a client's saved cookies have been loaded from the database.
    89  *
    90  * @param client		Client index.
    91  */
    92 forward OnClientCookiesLoaded(client);
    93 
    94 
    95 /**
    96  * Do not edit below this line!
    97  */
    98 public Extension:__ext_clientprefs = 
    99 {
   100 	name = "Client Preferences",
   101 	file = "clientprefs.ext",
   102 	autoload = 1,
   103 #if defined REQUIRE_EXTENSIONS
   104 	required = 1,
   105 #else
   106 	required = 0,
   107 #endif
   108 };