C# Class GarrysModLuaShared.cookie

Used to store permanent variables/settings on clients that will persist between servers. They are stored in the cl.db SQLite database located in the root Garry's Mod folder.
显示文件 Open project: OmegaExtern/gmod-csharp-binary-module

Public Methods

Method Description
Delete ( LuaState luaState, string name ) : void

Deletes a cookie on the client.

GetNumber ( LuaState luaState, string name, object @default = null ) : double

Gets the value of a cookie on the client as a number.

GetString ( LuaState luaState, string name, object @default = null ) : string

Gets the value of a cookie on the client as a string.

Set ( LuaState luaState, string name, string value ) : void

Sets the value of a cookie on the client. These are stored in the cl.db file.

Method Details

Delete() public static method

Deletes a cookie on the client.
public static Delete ( LuaState luaState, string name ) : void
luaState LuaState Pointer to lua_State struct.
name string The name of the cookie that you want to delete.
return void

GetNumber() public static method

Gets the value of a cookie on the client as a number.
public static GetNumber ( LuaState luaState, string name, object @default = null ) : double
luaState LuaState Pointer to lua_State struct.
name string The name of the cookie that you want to get.
@default object
return double

GetString() public static method

Gets the value of a cookie on the client as a string.
public static GetString ( LuaState luaState, string name, object @default = null ) : string
luaState LuaState Pointer to lua_State struct.
name string The name of the cookie that you want to get.
@default object
return string

Set() public static method

Sets the value of a cookie on the client. These are stored in the cl.db file.
public static Set ( LuaState luaState, string name, string value ) : void
luaState LuaState Pointer to lua_State struct.
name string The name of the cookie that you want to set.
value string Value to store in the cookie.
return void