-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add runString function * Add VExtensions/tests to test E2 code through vex_test * Add vex_version, which tells you the version on the server + The most recent release. * Overhaul printGlobal, remove printglobal burstmax convar. * Add burstManager_sh in modules * Add tests in modules/server Closes #27
- Loading branch information
Showing
17 changed files
with
477 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
-- PrintGlobal by Vurv (363590853140152321) | ||
|
||
-- These are replicated from the server, so you cannot edit them but you can access their values. | ||
CreateConVar("vex_printglobal_charmax_sv","350",FCVAR_REPLICATED,"The amount of chars that can be sent with the e2function printGlobal()",0,2000) | ||
CreateConVar("vex_printglobal_argmax_sv","50",FCVAR_REPLICATED,"The amount of arguments that can be sent with the e2function printGlobal()",0,255) | ||
CreateConVar("vex_printglobal_burst_sv","4",FCVAR_REPLICATED,"How many times printGlobal can be used in a second.") | ||
CreateConVar("vex_printglobal_charmax_sv","500",FCVAR_REPLICATED,"The amount of chars that can be sent with the e2function printGlobal()",0,2000) | ||
CreateConVar("vex_printglobal_argmax_sv","100",FCVAR_REPLICATED,"The amount of arguments that can be sent with the e2function printGlobal()",0,255) | ||
CreateClientConVar("vex_printglobal_enable_cl","1",true,true,"Allows players to print messages to your chat with expression2") | ||
|
||
local CV_GlobalChat = CreateClientConVar("vex_printglobal_enable_cl","1",true,true,"Allows players to print messages to your chat with expression2") | ||
local printf = vex.printf | ||
|
||
local function warnClient(sender) | ||
print(string.format("%s is printing to your chat with printGlobal.\nTo disable printGlobal for yourself, use the convar vex_printglobal_enable_cl and set it to 0",IsValid(sender) and sender:GetName() or "Unknown Player")) | ||
printf("%s is printing to your chat with printGlobal.\nTo disable printGlobal for yourself, use the convar vex_printglobal_enable_cl and set it to 0",IsValid(sender) and sender:GetName() or "Unknown Player") | ||
end | ||
|
||
local readUInt = net.ReadUInt | ||
local readString = net.ReadString | ||
|
||
vex.net_Receive("printglobal", function() | ||
-- We don't check the convar here, the server does that. | ||
local sender = net.ReadEntity() | ||
warnClient(sender) | ||
local args = net.ReadInt(9) | ||
if sender ~= LocalPlayer() then warnClient(sender) end | ||
local result = {} | ||
for I = 1,args do | ||
table.insert(result,net.ReadColor()) | ||
table.insert(result,net.ReadString()) | ||
for I = 1,readUInt(9), 2 do | ||
result[I] = Color( readUInt(8), readUInt(8), readUInt(8) ) | ||
result[I+1] = readString() | ||
end | ||
chat.AddText( unpack( result ) ) | ||
chat.AddText( unpack( result ) ) | ||
end) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.