Garry's Mod

Garry's Mod

评价数不足
E2 Cookies Extension
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
插件标签: 快乐, 写实
文件大小
发表于
更新日期
2.299 KB
2016 年 10 月 29 日 下午 12:08
2016 年 11 月 5 日 上午 7:07
8 项改动说明 ( 查看 )

订阅以下载
E2 Cookies Extension

在 SammyT291 的 3 个合集中
FineTree Pack 1
73 件物品
BlueArrow Rail Server Addons
167 件物品
FineBuild - Server Side
68 件物品
描述
E2 Cookies
Allows E2 chips to Set and Get cookies (saved info) from the server / client / friends clients

##############
Server Functions
##############

getCookie( S )
Returns the value of your cookie S from the server

setCookie( S, S2 )
Sets the value of your cookie S on the server to S2

deleteCookie( S )
Deletes your cookie S from the server

#############
Client Functions
#############

getClientCookie( S )
Requests the cookie S to be sent from your client
See the notes section below on how to return client cookies!

setClientCookie( S, S2 )
Sends the value S2 to be saved to the cookie S on your client

deleteClientCookie( S )
Requests the cookie S to be deleted from your client

####################
Client 2 Client Functions
####################

getClientCookie( E, S )
Requests the cookie S to be sent from E's client
See the notes section below on how to return client cookies!

setClientCookie( E, S, S2 )
Sends the value S2 to be saved to the cookie S on E's client

deleteClientCookie( E, S )
Requests the cookie S to be deleted from E's client

#############
Other Functions
#############

runOnCookie( N )
if N is not 0 then the expression will execute upon the server recieving a client Cookie

cookieClk()
Return 1 if the expression was executed by the server receiving a client cookie, other wise returns 0

cookieClk( E )
Return 1 if the expression was executed by the server receiving a client cookie from player E, otherwise returns 0

cookieKey()
Returns the last client cookie the server received

cookieValue()
Returns the last data the server received from a client cookie

cookieError()
Returns the last error encountered by the extension

cookieErrorChip()
Returns the last expression that caused an error

canCookie( S )
Returns 1 if you can Set/Get/Delete a cookie of type S, otherwise returns 0
Types can be: "sv" for server "cl" for client and "cross" for client 2 client

remainingCookie( S )
Returns how many Set/Get/Deletes you can use currently of type S
Types can be: "sv" for server "cl" for client and "cross" for client 2 client

#####
Notes
#####

1. Returning a client cookie example:
if(first()){
T = findPlayerByName( "ARandomName" )
getClientCookie( T )
}

runOnCookie(1)

if(cookieClk()){
print( cookieKey() + " had the following data:" )
print( cookieValue() )
}

2. In order to Set/Get/Delete a cookie on someone elses client you need to have their prop protection.

3. In order to return cookieKey() or cookieValue() you must have the Prop Protection of the player the data came from.

#############
Server ConVars
#############

e2_cookies_cl_mode
Sets if client functions should be allowed for everyone (0), admins (1) or superAdmins (2) only
Default is 0

e2_cookies_sv_mode
Sets if server functions should be allowed for everyone (0), admins (1) or superAdmins (2) only
Default is 0

e2_cookies_cross_mode
Sets if client 2 client functions should be allowed for everyone (0), admins (1) or superAdmins (2) only
Default is 1

e2_cookies_clear_time
How long in seconds until reseting the rate limit values
Can be decimal such as 2.5 seconds
default is 2.0

e2_cookies_cl_rate
How many client function requests to allow per time set above
Default is 4

e2_cookies_sv_rate
How many server function requests to allow per time set above
Default is 8

e2_cookies_cross_rate
How many client 2 client function requests to allow per time set above
Default is 2