mirror of
https://github.com/Novetus/Novetus_src.git
synced 2025-01-31 09:41:33 +02:00
add whitelist addon
This commit is contained in:
parent
3040917d5a
commit
6c39820272
@ -1,6 +1,6 @@
|
||||
-- put script names here
|
||||
|
||||
Addons = {"ClientNamePrinter", "ShadersCompatibility", "ServerClock"}
|
||||
Addons = {"ClientNamePrinter", "ShadersCompatibility", "ServerClock", "ServerWhitelist"}
|
||||
|
||||
-- DONT EDIT ANYTHING ELSE BELOW
|
||||
|
||||
|
69
ServerWhitelist.lua
Normal file
69
ServerWhitelist.lua
Normal file
@ -0,0 +1,69 @@
|
||||
local this = {}
|
||||
|
||||
--https://www.tutorialspoint.com/how-to-search-for-an-item-in-a-lua-list
|
||||
function Set(list)
|
||||
local set = {}
|
||||
for _, l in ipairs(list) do set[l] = true end
|
||||
return set
|
||||
end
|
||||
|
||||
-- DONT EDIT ANYTHING ELSE ABOVE
|
||||
|
||||
-- add player tripcodes here in quotes sepertaed by commas
|
||||
local tripcodeList = Set {}
|
||||
-- enable this to trigger the whitelist
|
||||
local enabled = false
|
||||
|
||||
-- DONT EDIT ANYTHING ELSE BELOW
|
||||
|
||||
function this:Name()
|
||||
return "Server Whitelist"
|
||||
end
|
||||
|
||||
-- executes before the game starts (server, solo, studio)
|
||||
-- arguments: Script - returns the script type name (Server, Solo, Studio), Client - returns the Client name.
|
||||
function this:PreInit(Script, Client)
|
||||
if (Script ~= "Server") then
|
||||
enabled = false
|
||||
end
|
||||
end
|
||||
|
||||
-- executes after a player joins (server)
|
||||
-- arguments: Player - the Player joining
|
||||
function this:OnPlayerAdded(Player)
|
||||
if (enabled == true) then
|
||||
local hasTripcode = false
|
||||
|
||||
for _,newVal in pairs(Player:children()) do
|
||||
if (newVal.Name == "Tripcode") then
|
||||
if (newVal.Value ~= "") then
|
||||
hasTripcode = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (hasTripcode and tripcodeList[Player.Tripcode.Value]) then
|
||||
print("Player '" .. Player.Name .. "' is in whitelist!")
|
||||
else
|
||||
print("Player '" .. Player.Name .. "' not in whitelist. Kicking.")
|
||||
|
||||
Server = game:GetService("NetworkServer")
|
||||
for _,Child in pairs(Server:children()) do
|
||||
name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value
|
||||
if (Server:findFirstChild(name) ~= nil and Child.Name == name) then
|
||||
Child:CloseConnection()
|
||||
print("Player '" .. Player.Name .. "' Kicked. Reason: Not in whitelist")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- DO NOT REMOVE THIS. this is required to load this addon into the game.
|
||||
|
||||
function AddModule(t)
|
||||
print("AddonLoader: Adding " .. this:Name())
|
||||
table.insert(t, this)
|
||||
end
|
||||
|
||||
_G.CSScript_AddModule=AddModule
|
@ -1,4 +1,14 @@
|
||||
1.3 Snapshot v22.8245.30338.1
|
||||
Enhancements:
|
||||
- The initial file list for the Mod Package Creator now checks if all lines are created on the file.
|
||||
- The initial file list now generates when launching the SDK if one is not generated already.
|
||||
- Added the -nofilelist command line option to disable the launcher's file list creation on slower computers (will make the Mod Package Creator basically unusable on first load)
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
1.3 Snapshot v22.8245.27180.1
|
||||
Note:
|
||||
- If you want to use the new Mod Package Creator for the first time, make sure to use a clean, unmodified Novetus install. Any installed mods before this update will not show up in the Mod Package Creator if you install this update on a previous Novetus version.
|
||||
|
||||
Enhancements:
|
||||
- Re-implemented the progress bar/status text to the Asset Fixer.
|
||||
- The Asset Fixer and Legacy Place Converter will now show errors when loading a binary format place/model.
|
||||
|
@ -145,5 +145,6 @@ XCOPY "%cd%\Novetus\addons\Addon_Template.lua" "%dest%" /y
|
||||
XCOPY "%cd%\Novetus\addons\ClientNamePrinter.lua" "%dest%" /y
|
||||
XCOPY "%cd%\Novetus\addons\ShadersCompatibility.lua" "%dest%" /y
|
||||
XCOPY "%cd%\Novetus\addons\ServerClock.lua" "%dest%" /y
|
||||
XCOPY "%cd%\Novetus\addons\ServerWhitelist.lua" "%dest%" /y
|
||||
XCOPY "%cd%\Novetus\addons\core\AddonLoader.lua" "%dest%" /y
|
||||
if %debug%==1 pause
|
@ -13,4 +13,5 @@ Adventure Awaits...|The first trailer used to promote Roblox to the public was%n
|
||||
Welcome to %version%!|Hi!|11/11
|
||||
Merry Christmas!|...and a happy new year!|12/24-12/25
|
||||
Happy New Year!|Have a happy %nextyear%!|12/31
|
||||
Happy Out-of-Touch Thursday!|You're out of touch, I'm out of time.%newline%But I'm out of my head when you're not around!|Thursday
|
||||
Happy Out-of-Touch Thursday!|You're out of touch, I'm out of time.%newline%But I'm out of my head when you're not around!|Thursday
|
||||
Today is Friday in California.|HUH?%newline%%newline%SHOOT!|Friday
|
Loading…
Reference in New Issue
Block a user