repo stringclasses 254
values | file_path stringlengths 29 241 | code stringlengths 100 233k | tokens int64 14 69.4k |
|---|---|---|---|
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/FastCastVMs/init.luau | -- ******************************* --
-- AX3NX / AXEN --
-- ******************************* --
-- Modded by Mawin_CK
-- Desc : I make it more customizable and more easy to use :P
-- Services
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ServerScriptService = game:GetService("ServerScriptSer... | 1,459 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/ObjectCache.luau | --[[
- Modded By Mawin_CK
Desc : i added __type = "ObjectCache" to letting FastCast Recongize that this is ObjectCache
]]
--[=[
@class ObjectCache
@private
@external ObjectCache https://devforum.roblox.com/t/objectcache-a-modern-blazing-fast-model-and-part-cache/3104112
ObjectCache usage should be derived from the... | 1,587 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/Signal.luau | --!optimize 2
--!nocheck
--!native
export type Connection<U...> = {
Connected: boolean,
Disconnect: (self: Connection<U...>) -> (),
Reconnect: (self: Connection<U...>) -> (),
}
export type Signal<T...> = {
RBXScriptConnection: RBXScriptConnection?,
Connect: <U...>(self: Signal<T...>, fn: (...any) -> (), U...) ... | 1,578 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/.github/workflows/scripts/build-rbxm.luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local placeFile = fs.readFile("place.rbxl")
local gameFile = roblox.deserializePlace(placeFile)
local Packages = gameFile.ReplicatedStorage.Packages
local packageModel = roblox.serializeModel({Packages})
fs.writeFile("Inputter.rbxm", packageModel)... | 80 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Binding.luau | local UserInputService = game:GetService("UserInputService")
local Signal = require(script.Parent.Parent.Signal)
local Types = require(script.Parent.Types)
type Binding = Types.Binding
type BindingInfo = Types.BindingInfo
local Binding = {}
Binding.__index = Binding
local function matchesKeyboardInput(input: any, u... | 708 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Serializer.luau | local TableUtil = require(script.Parent.Parent.TableUtil)
local HttpService = game:GetService("HttpService")
local Serializer = {}
local function serializeEnums(tbl: any): boolean
if type(tbl) ~= "table" then
return false
end
for key, value in pairs(tbl) do
if type(value) == "table" then
if not serializeEnu... | 373 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Triggers/AbstractTrigger.luau | --[=[
@class AbstractTrigger
@ignore
A base class for triggers. This should not be used directly, but rather as a base class for other input triggers.
]=]
local AbstractTrigger = {}
AbstractTrigger.__index = AbstractTrigger
local Signal = require(script.Parent.Parent.Parent.Signal)
local TableUtil = requir... | 422 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Triggers/HOLD.luau | --[[
A form of input handler that triggers when the input is held for a specified duration.
Author: Adam Mills
]]
local AbstractTrigger = require(script.Parent.AbstractTrigger)
local Types = require(script.Parent.Parent.Types)
local Binding = require(script.Parent.Parent.Binding)
type HOLD = Types.HOLD
type Bi... | 654 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Triggers/MULTIPLE_PRESS.luau | local AbstractTrigger = require(script.Parent.AbstractTrigger)
local Types = require(script.Parent.Parent.Types)
local Binding = require(script.Parent.Parent.Binding)
type MULTIPLE_PRESS = Types.MULTIPLE_PRESS
type BindingInfo = Types.BindingInfo
type Trigger = Types.Trigger
local MULTIPLE_PRESS = setmetatable({}, Ab... | 636 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Triggers/PRESS.luau | --[[
Most basic form of input handler. Triggers when the input is pressed.
Author: Adam Mills
]]
local AbstractTrigger = require(script.Parent.AbstractTrigger)
local Types = require(script.Parent.Parent.Types)
local Binding = require(script.Parent.Parent.Binding)
type PRESS = Types.PRESS
type BindingInfo = Typ... | 392 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Triggers/SHORT_PRESS.luau | --[[
Input handler that triggers when the input is pressed and released within a given time frame.
Author: Adam Mills
]]
local AbstractTrigger = require(script.Parent.AbstractTrigger)
local Types = require(script.Parent.Parent.Types)
local Binding = require(script.Parent.Parent.Binding)
type SHORT_PRESS = Type... | 598 |
AdamMillsy/Inputter | AdamMillsy-Inputter-92d6a2c/src/Types.luau | local Signal = require(script.Parent.Parent.Signal)
export type Signal<T...> = Signal.Signal<T...>
--[=[
@class Inputter
The inputter class represents each individual action a player can make. It should be used to abstract away from the different input methods ROBLOX provides.
]=]
export type Inputter = {
Name: st... | 672 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/.lune/build/branch.luau | local process = require("@lune/process")
local stdio = require("@lune/stdio")
local branches = require("./branches")
for _, branch in ipairs(branches) do
if table.find(process.args, branch) then
return branch
end
end
local index = stdio.prompt(
"select",
"What branch to build for? (Pass it in as argument when ... | 94 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/.lune/build/config/init.luau | local fs = require("@lune/fs")
local serde = require("@lune/serde")
local process = require("@lune/process")
local branch = require("./branch")
local defaultConfig = serde.decode("toml", fs.readFile(".lune/build/config/default.toml")) -- ./default.toml would've been nice :sob:
local config = { branch = branch }
local... | 239 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/.lune/build/generateConfig.luau | local MLDSA87 = require("@shared/crypto/MlDSA").ML_DSA_87
local MLKEM1024 = require("@shared/crypto/MlKEM").MLKEM_1024
local CSPRNG = require("@shared/crypto/CSPRNG")
local Base64 = require("@shared/crypto/base64")
return function(config)
local rules = table.clone(config.darkluaRules)
local inject = table.clone(con... | 445 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/CameraInput.luau | --!nonstrict
local ContextActionService = game:GetService("ContextActionService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local VRServic... | 4,112 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/CameraToggleStateController.luau | local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local GameSettings = UserSettings():GetService("UserGameSettings")
local Input = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
local CameraUtils ... | 568 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/CameraUI.luau | --!nonstrict
local StarterGui = game:GetService("StarterGui")
local initialized = false
local CameraUI: any = {}
do
-- Instantaneously disable the toast or enable for opening later on. Used when switching camera modes.
function CameraUI.setCameraModeToastEnabled(enabled: boolean)
if not enabled and not initializ... | 186 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/Invisicam.luau | --!nonstrict
--[[
Invisicam - Occlusion module that makes objects occluding character view semi-transparent
2018 Camera Update - AllYourBlox
--]]
--[[ Top Level Roblox Services ]]--
local PlayersService = game:GetService("Players")
--[[ Constants ]]--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local USE_STACKING_TRANS... | 5,623 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/LegacyCamera.luau | --!nonstrict
--[[
LegacyCamera - Implements legacy controller types: Attach, Fixed, Watch
2018 Camera Update - AllYourBlox
--]]
local ZERO_VECTOR2 = Vector2.new()
local PITCH_LIMIT = math.rad(80)
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local CameraInput = require(script.Parent:WaitForChild("... | 905 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/MouseLockController.luau | --!nonstrict
--[[
MouseLockController - Replacement for ShiftLockController, manages use of mouse-locked mode
2018 Camera Update - AllYourBlox
--]]
--[[ Constants ]]--
local DEFAULT_MOUSE_LOCK_CURSOR = "rbxasset://textures/MouseLockedCursor.png"
local CONTEXT_ACTION_NAME = "MouseLockSwitchAction"
local MOUSELOCK_AC... | 1,603 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/OrbitalCamera.luau | --!nonstrict
--[[
OrbitalCamera - Spherical coordinates control camera for top-down games
2018 Camera Update - AllYourBlox
--]]
-- Local private variables and constants
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
local ZERO_VECTOR... | 3,363 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/TransparencyController.luau | --!nonstrict
--[[
TransparencyController - Manages transparency of player character at close camera-to-subject distances
2018 Camera Update - AllYourBlox
--]]
local MAX_TWEEN_RATE = 2.8 -- per second
local Util = require(script.Parent:WaitForChild("CameraUtils"))
--[[ The Module ]]--
local TransparencyController = ... | 1,403 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/VRCamera.luau | --!nonstrict
--[[
VRCamera - Roblox VR camera control module
2021 Roblox VR
--]]
--[[ Services ]]--
local PlayersService = game:GetService("Players")
local VRService = game:GetService("VRService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
-- Local private variables and constants
local C... | 2,920 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/VRVehicleCamera.luau | --!nonstrict
--[[
VRVehicleCamera - Roblox VR vehicle camera control module
2021 Roblox VR
--]]
local EPSILON = 1e-3
local PITCH_LIMIT = math.rad(80)
local YAW_DEFAULT = math.rad(0)
local ZOOM_MINIMUM = 0.5
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local DEFAULT_CAMERA_DIST = 16
local TP_FOLLOW_DIST = 200
local TP_FOLL... | 1,731 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/CameraModule/ZoomController/Popper.luau | --!nonstrict
--------------------------------------------------------------------------------
-- Popper.lua
-- Prevents your camera from clipping through walls.
--------------------------------------------------------------------------------
local Players = game:GetService("Players")
local camera = game.Workspace.Cur... | 2,326 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/ClickToMoveController.luau | --!nonstrict
--[[
-- Original By Kip Turner, Copyright Roblox 2014
-- Updated by Garnold to utilize the new PathfindingService API, 2017
-- 2018 PlayerScripts Update - AllYourBlox
--]]
--[[ Flags ]]
local FFlagUserExcludeNonCollidableForPathfindingSuccess, FFlagUserExcludeNonCollidableForPathfindingResult =
pca... | 8,970 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/ClickToMoveDisplay.luau | --!nonstrict
local ClickToMoveDisplay = {}
local FAILURE_ANIMATION_ID = "rbxassetid://2874840706"
local TrailDotIcon = "rbxasset://textures/ui/traildot.png"
local EndWaypointIcon = "rbxasset://textures/ui/waypoint.png"
local WaypointsAlwaysOnTop = false
local WAYPOINT_INCLUDE_FACTOR = 2
local LAST_DOT_DISTANCE = 3
... | 4,301 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/PathDisplay.luau | --!nonstrict
local PathDisplay = {}
PathDisplay.spacing = 8
PathDisplay.image = "rbxasset://textures/Cursors/Gamepad/Pointer.png"
PathDisplay.imageSize = Vector2.new(2, 2)
local currentPoints = {}
local renderedPoints = {}
local pointModel = Instance.new("Model")
pointModel.Name = "PathDisplayPoints"
local adornee... | 846 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/TouchJump.luau | --!nonstrict
--[[
// FileName: TouchJump
// Version 1.0
// Written by: jmargh
// Description: Implements jump controls for touch devices. Use with Thumbstick and Thumbpad
--]]
local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
--[[ Constants ]]--
local TOUCH_CONTROL_SHEET ... | 1,499 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/TouchThumbstick.luau | --!nonstrict
--[[
TouchThumbstick
--]]
local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local FFlagUserClampClassicThumbstick do
local succe... | 2,019 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/VRNavigation.luau | --!nonstrict
--!nolint GlobalUsedAsLocal
--[[
VRNavigation
--]]
local VRService = game:GetService("VRService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local PathfindingService = game:GetService("Pathfind... | 3,235 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/PlayerModule/ControlModule/init.luau | --!nonstrict
--[[
ControlModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current character movement controller.
This script binds to RenderStepped at Input priority and calls the Update() methods
on the active controller instances.
The character... | 4,766 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/client/starterScripts/RbxCharacterSounds/init.luau | --!nonstrict
-- Roblox character sound script
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local AtomicBinding = require(script:WaitForChild("AtomicBinding"))
local function loadFlag(flag: string)
local success, result = pcall(function()
return UserSettings():IsUserF... | 2,172 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/assets/server/Health.server.luau | -- Gradually regenerates the Humanoid's Health over time.
local REGEN_RATE = 1 / 100 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 1 -- Wait this long between each regeneration step.
--------------------------------------------------------------------------------
local Character = script.Pa... | 145 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/Template.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
return {
ParameterGenerator = function()
return
end,
BeforeAll = function() end,
AfterAll = function() end,
BeforeEach = function() end,
AfterEach = function() end,
... | 116 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/arrayFindValue.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local N = 1000
return {
ParameterGenerator = function()
local arr = table.freeze({ "a", "b", "c", "d", "e" })
local value = arr[math.random(1, #arr)]
return arr, valu... | 233 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/getArg.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local parameters = 10
local N = 100
return {
ParameterGenerator = function()
return parameters, unpack(table.create(parameters, "value"), 1, parameters)
end,
BeforeAll ... | 684 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/hookArgs.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local N = 100
return {
ParameterGenerator = function()
return function()
return "value1", "value2", "value3"
end
end,
BeforeAll = function() end,
AfterAll = funct... | 371 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/hookVarargs.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
return {
ParameterGenerator = function()
local n = 1000
local t = table.create(n, "value")
return function()
return unpack(t, 1, n)
end
end,
BeforeAll = functio... | 351 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/iterateVarargs.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local N = 100
return {
ParameterGenerator = function()
local parameters = math.random(1, 10)
return unpack(table.create(parameters, "value"), 1, parameters)
end,
Befo... | 366 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/lookupTable.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local N = 1000
local keys = { "A", "B", "C", "D", "E", "F" }
local lookup = {
["A"] = "a",
["C"] = "c",
["E"] = "e",
}
local magic = setmetatable(table.clone(lookup), {
... | 299 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/benchmarks/mutateVarargs.bench.luau | --[[
This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker)
|WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING|
--]]
local N = 100
return {
ParameterGenerator = function()
local parameters = math.random(1, 10)
return unpack(table.create(parameters, 1), 1, parameters)
end,
BeforeAll ... | 358 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/output.luau | local Network = require("@client/network")
local MessageTypes = require("@shared/output/messageTypes")
local Signal = require("@shared/signal")
local Functions = require("@shared/functions")
local Output = {}
Output.MessageType = MessageTypes
Output.MessageOut = Signal.new()
Output.MessageIdDropped = Signal.new()
fun... | 362 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/scriptManager.luau | local Output = require("@client/output")
local Network = require("@client/network")
local UI = require("@client/ui")
local Assets = require("@shared/assets")
local WorkerManagers = require("@shared/workerManagers")
local ScriptTypes = require("@shared/scriptManager/scriptTypes")
local Module = {}
Module.ScriptType = ... | 1,073 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/starterScripts.luau | local Log = require("@shared/log")
local Assets = require("@shared/assets")
local scripts = Assets:get("starterScripts"):GetChildren()
local starterScripts = {}
function starterScripts:Init()
Log.debug("Starting starter scripts...")
for _, starterScript in ipairs(scripts) do
task.defer(require, starterScript:Clon... | 75 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/ui/app.luau | local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
local Commands = require("@client/commands")
local Network = require("@client/network")
local CommandInputContext = require("@shared/commands/inputContexts")
local Ma... | 4,141 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/ui/create.luau | local function applyProperties(instance, properties)
for key, value in properties do
if type(key) == "number" and typeof(value) == "Instance" then
value.Parent = instance
continue
end
if type(value) == "table" then
applyProperties(instance, value)
continue
end
if typeof(instance[key]) == "RBX... | 171 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/ui/init.luau | local Players = game:GetService("Players")
local Output = require("@client/output")
local Log = require("@shared/log")
local Maid = require("@shared/maid")
local Signal = require("@shared/signal")
local Functions = require("@shared/functions")
local App = require("@self/app")
local create = require("@self/create")
l... | 555 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/wm/sandbox/blockedInstances/init.luau | local ipairs = ipairs
local table = table
local lookup = {}
local list = table.freeze(require("@self/list.yaml"))
for _, class in ipairs(list) do
lookup[class] = true
end
return table.freeze(lookup)
| 49 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/client/wm/stackTrace.luau | local table = table
local ipairs = ipairs
local SharedStackTrace = require("@shared/stackTrace")
local Functions = require("@shared/functions")
local VM = require("@client/wm/sandbox/vm")
local vmStart = VM.vmStart
local vmEnd = VM.vmEnd
local getDebugInfo = VM.getDebugInfo
local getRunning = VM.getRunning
local Sta... | 338 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/db/init.luau | -- This doesn't persist between servers and is just an example.
local datas = {}
local function getUserData(userId: number)
local data = datas[userId]
if data then
return data
end
data = {
scripts = {},
}
datas[userId] = data
return data
end
local PlayerList = require("@shared/playerList")
PlayerList.Remo... | 292 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/network.luau | --!strict
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local services = require("@shared/network/services")
local RequestMethods = require("@shared/network/requestMethods")
local ServerRequestMethod = RequestMethods.Server
local ClientRequestMethod = RequestMethods.Clien... | 2,339 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/output.luau | local Players = game:GetService("Players")
local Network = require("@server/network")
local MessageTypes = require("@shared/output/messageTypes")
local Functions = require("@shared/functions")
local Output = {}
Output.MessageType = MessageTypes
function Output:appendTo(player, messageType, message, dateTime)
assert... | 446 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/scriptManager.luau | local Output = require("@server/output")
local Network = require("@server/network")
local compile = require("@server/compile")
local Assets = require("@shared/assets")
local WorkerManagers = require("@shared/workerManagers")
local DB = require("@server/db")
local PlayerList = require("@shared/playerList")
local Script... | 1,536 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/wm/sandbox/wrapper/reflection.luau | local table = table
local setmetatable = setmetatable
local error = error
local coroutine = coroutine
local typeof = typeof
local type = type
local Wrapper
local Rules
local Functions = require("@shared/functions")
local Protection = require("@shared/wm/protection")
local Errors = require("@shared/errors")
local wrap... | 1,212 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/wm/stackTrace.luau | local table = table
local ipairs = ipairs
local SharedStackTrace = require("@shared/stackTrace")
local Functions = require("@shared/functions")
local StackTrace = setmetatable({}, { __index = SharedStackTrace })
export type StackTrace = SharedStackTrace.StackTrace
-- Get the source of the worker manager (to filter ... | 145 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/server/world/init.luau | local Players = game:GetService("Players")
local World = {}
World.Base = nil
function World:RemoveBase()
if not self.Base then
return
end
self.Base:Destroy()
self.Base = nil
end
function World:AddBase()
self:RemoveBase()
local base = Instance.new("Part")
base.Name = "Base"
base.Anchored = true
base.CFra... | 284 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/assets.luau | local Log = require("@shared/log")
local Assets = {}
Assets.assets = {}
function Assets:get(asset)
assert(Assets.assets[asset], `Invalid asset "{asset}".`)
return Assets.assets[asset]
end
function Assets:Init(folderParent, folderName)
Log.debug("Fetching assets...")
-- Set a timeout warning the user if fetching... | 279 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/commands/processResults.luau | return require("@shared/enum")({
"Success", -- No errors occured, successfully processed and ran command.
"Fail", -- Failed to process command.
"Error", -- Command threw an error while validating or running.
})
| 48 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/AEAD/ChaCha.luau | --[=[
Cryptography library: ChaCha20
Sizes:
Nonce: 12/24 bytes
Key: 16/32 bytes
Return type: buffer
Example usage:
local Data = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Nonce = buffer.fromstring(string.rep("n", 12))
--------Usage Case 1--------
l... | 5,712 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/AEAD/Poly1305.luau | --[=[
Cryptography library: Poly1305
Sizes:
Key: 32 bytes
Tag: 16 bytes
Return type: buffer
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Tag = Poly1305(Message, Key)
--]=]
--!strict
--!optimize 2
--!native
local TAG_SIZE ... | 2,501 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/AEAD/init.luau | --[=[
Cryptography library: ChaCha20-Poly1305 AEAD
Sizes:
Key: 16/32 bytes
Nonce: 12/24 bytes
Tag: 16 bytes
Rounds: even positive integer (default: 20)
Return type: buffer, buffer (ciphertext, tag)
Example usage:
local Plaintext = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string... | 2,119 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/CSPRNG/Blake3.luau | --[=[
Cryptography library: Blake3
Sizes:
Key: 32 bytes
Output: variable
Return type: string (hex)
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
--------Standard Hash--------
local Hash = Blake3.Digest(Message, 32)
--------... | 3,436 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/CSPRNG/ChaCha20.luau | --[=[
Cryptography library: ChaCha20
Sizes:
Nonce: 12 bytes
Key: 16/32 bytes
Return type: buffer
Example usage:
local Data = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Nonce = buffer.fromstring(string.rep("n", 12))
--------Usage Case 1--------
loca... | 3,259 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/CSPRNG/Conversions.luau | --[=[
Cryptography library: Conversions
Return type: string / buffer
Example Usage:
local HexString = Conversions.ToHex(buffer.fromstring("Hello World"))
local OriginalBuffer = Conversions.FromHex("48656c6c6f20576f726c64")
--]=]
--!strict
--!optimize 2
--!native
local ENCODE_LOOKUP = buffer.create(256 * 2)
d... | 1,622 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/CSPRNG/init.luau | --[=[
Cryptography library: Cryptographically Secure RNG
Usage:
local RandomFloat = CSPRNG.Random()
local RandomInt = CSPRNG.RandomInt(1, 100)
local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)
local RandomBytes = CSPRNG.RandomBytes(32)
local RandomHex = CSPRNG.RandomHex(16)
local FastString = CSPRNG.R... | 5,293 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/CSPRNG/init.luau | export type EntropyProvider = (BytesLeft: number) -> buffer?
return require("@shared/crypto/CSPRNG")
| 25 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/Field.luau | --[=[
Finite field arithmetic modulo Q = 8380417
Arithmetic operations over the prime field Z_q where q = 2^23 - 2^13 + 1.
All operations maintain elements in canonical form [0, Q).
Example usage:
local Field = require(script)
local A = 12345
local B = 67890
local Sum = Field.Add(A, B)
local Product... | 452 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/NTT.luau | --[=[
Number Theoretic Transform for degree-255 polynomials
Forward and inverse NTT over Z_q for polynomial multiplication.
Uses Cooley-Tukey and Gentleman-Sande algorithms with precomputed roots.
Example usage:
local NTT = require(script)
local Poly = buffer.create(256 * 4) -- 256 coefficients, 4 bytes... | 1,461 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/Pack.luau | --[=[
Bit packing and unpacking utilities
Serializes polynomials to byte arrays with various bit widths.
Supports encoding/decoding of polynomial coefficients and hint bits.
Example usage:
local BitPacking = require(script)
local Poly = buffer.create(256 * 4)
local Encoded = buffer.create(96) -- For 3-... | 7,184 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/Params.luau | --[=[
Parameter validation for ML-DSA algorithms
FIPS 204 specification.
Example usage:
local Params = require(script)
local IsValid = Params.CheckKeygenParams(4, 4, 13, 2) -- ML-DSA-44
local ValidEta = Params.CheckEta(2)
--]=]
--!strict
--!optimize 2
--!native
local Q_BIT_WIDTH = 23
local Q = 8380417... | 1,065 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/PolyVec.luau | --[=[
Vector operations on degree-255 polynomials
Works on vectors of polynomials including matrix multiplication,
NTT transforms, and encoding/decoding for ML-DSA.
Example usage:
local PolyVec = require(script)
local Vec = buffer.create(4 * 256 * 4) -- 4 polynomials
PolyVec.ForwardNTT(Vec, 4)
local ... | 9,568 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/SHA3.luau | --!strict
--!optimize 2
--!native
local SHA3 = {}
local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96)
do
local HighFactorKeccak = 0
local ShiftRegister = 29
local function GetNextBit(): number
local Result = ShiftRegister % 2
ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result... | 6,804 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/Sampling.luau | --[=[
ML-DSA Sampling
Example usage:
local Sampling = require(script)
local Rho = buffer.create(32)
local Matrix = buffer.create(4 * 4 * 256 * 4)
Sampling.ExpandA(Rho, Matrix, 4, 4)
--]=]
--!strict
--!optimize 2
--!native
local XOF = require("./XOF")
local BitPacking = require("./Pack")
local Params = ... | 4,934 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/Utils.luau | --[=[
Utility functions for ML-DSA key and signature sizes
ML-DSA parameters.
Example usage:
local Utils = require(script)
local PubKeySize = Utils.PubKeyLen(4, 13) -- 1312 bytes for ML-DSA-44
local SecKeySize = Utils.SecKeyLen(4, 4, 2, 13) -- 2560 bytes
local SigSize = Utils.SigLen(4, 4, 131072, ... | 450 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/XOF.luau | --[=[
Stateful SHAKE XOF (Extensible Output Function)
Non-OOP implementation with reusable state buffers.
For ML-DSA sampling functions that use rejection sampling.
Example usage:
local XOF = require(script)
XOF.Reset128()
XOF.Absorb128(message)
local Chunk1 = XOF.Squeeze128(168)
local Chunk2 = XOF... | 7,993 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlDSA/init.luau | --[=[
ML-DSA (FIPS 204) Digital Signature Algorithm
Post quantum digital signature scheme based on lattice cryptography.
Has three security levels: ML-DSA-44, ML-DSA-65, ML-DSA-87.
Example usage:
local MLDSA = require("@self/MlDSA")
local PubKey, SecKey = MLDSA.ML_DSA_44.GenerateKeys()
local Message = b... | 6,330 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Compression.luau | --[=[
ML-KEM Compression Module
Polynomial coefficient compression and decompression operations for ML-KEM.
Maps field elements to and from reduced bit representations.
--]=]
--!strict
--!optimize 2
--!native
local Params = require("./Params")
local N = 256
local Q = 3329
local Compression = {}
function Compr... | 1,450 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Field.luau | --[=[
ML-KEM Field Arithmetic Module
Prime field Zq arithmetic operations for ML-KEM.
Modular arithmetic over the field Z_q where q = 3329.
Example usage:
local Field = require(script.Field)
local Sum = Field.Add(1234, 567)
local Product = Field.Multiply(1234, 567)
local Inverse = Field.Invert(1234)
... | 732 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/NTT.luau | --[=[
ML-KEM Number Theoretic Transform Module
Number Theoretic Transform (NTT) operations for polynomial multiplication.
Cooley-Tukey NTT and Gentleman-Sande inverse NTT algorithms
Example usage:
local NTT = require(script.NTT)
local Poly = buffer.create(512) -- 256 coefficients * 2 bytes
NTT.Ntt(Pol... | 3,184 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/PKE.luau | --[=[
ML-KEM Public Key Encryption Module
K-PKE (CPA-secure public key encryption) implementation for ML-KEM.
Provides key generation, encryption, and decryption operations
as specified in NIST FIPS 203.
Example usage:
local PKE = require(script.PKE)
local Seed = buffer.fromstring("32_byte_seed_here..."... | 2,517 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Params.luau | --[=[
ML-KEM Parameters Module
Parameter validation functions for ML-KEM.
NIST FIPS 203 specification.
Example usage:
local Params = require(script.Params)
local IsValid = Params.CheckKeygenParams(4, 2) -- true
local ValidD = Params.CheckD(11) -- true
local ValidEncrypt = Params.CheckEncryptParams(4,... | 758 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/PolyVec.luau | --[=[
ML-KEM Polynomial Vector Module
Polynomial vector and matrix operations for ML-KEM.
Vector arithmetic, matrix multiplication, and encoding/decoding
operations on vectors of degree-255 polynomials.
--]=]
--!strict
--!optimize 2
--!native
local Ntt = require("./NTT")
local MlKemParams = require("./Params")
... | 1,610 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Sampling.luau | --[=[
ML-KEM Sampling Module
Polynomial sampling operations for ML-KEM.
Uniform sampling from Rq and centered binomial distribution sampling.
Example usage:
local Sampling = require(script.Sampling)
local Rho = buffer.create(32)
local Matrix = Sampling.GenerateMatrix(3, Rho, false)
local Sigma = ... | 1,972 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Serialize.luau | --[=[
ML-KEM Serialization Module
Polynomial encoding and decoding operations for ML-KEM.
Converts polynomials to/from byte arrays with different bit lengths.
Example usage:
local Serialize = require(script.Serialize)
local Poly = buffer.create(512) -- 256 coefficients
local Encoded = Serialize.Encode... | 4,899 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/Utils.luau | --[=[
ML-KEM Utilities Module
Utility functions for ML-KEM implementation
Example usage:
local Utils = require(script.Utils)
local IsEqual = Utils.CtMemcmp(Buffer1, Buffer2)
Utils.CtCondMemcpy(Condition, Dest, Src1, Src2)
local PubKeySize = Utils.GetKemPublicKeyLen(4) -- 1568 bytes
local SecKeySi... | 1,082 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/MlKEM/init.luau | --[=[
ML-KEM Main Module (Key Encapsulation Mechanism)
The complete ML-KEM post quantum key encapsulation.
Key generation, encapsulation, and decapsulation operations with
CCA security using the Fujisaki Okamoto transform.
Example usage:
local MlKem = require(script.MlKem)
local CSPRNG = require(script.CSP... | 2,719 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/XXH32.luau | --[=[
Cryptography library: XXHash32
⚠️ WARNING: XXHash32 wasn't designed with cryptographic security in mind!
Only use for non-security purposes. For security, use SHA256 or higher. ⚠️
Return type: number
Example usage:
local Message = buffer.fromstring("Hello World")
--------Usage Case 1--------
local... | 2,053 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/base64.luau | --[=[
Cryptography library: Base64
Return type: buffer
Example usage:
local Input = buffer.fromstring("Hello World")
local Encoded = Base64.Encode(Input)
local Decoded = Base64.Decode(Encoded)
--]=]
--!strict
--!optimize 2
--!native
local PADDING_CHARACTER = 61
local ALPHABET_BYTES = buffer.create(64)
do
... | 3,311 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/blake2b.luau | --[=[
Cryptography library: BLAKE2b
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
-- BLAKE2b-128 (128-bit output)
local Result128 = BLAKE2b(Message, 16)
-- BLAKE2b-256 (256-bit output)
local Result256 = BLAKE2b(Message, 32)
-- BLAKE2b-384 (384-bit output)
... | 7,993 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/crypto/blake3.luau | --[=[
Cryptography library: Blake3
Sizes:
Key: 32 bytes
Output: variable
Return type: string (hex)
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
--------Standard Hash--------
local Hash = Blake3.Digest(Message, 32)
--------... | 5,105 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/enum.luau | local ipairs = ipairs
local table = table
return function(enumItems)
local enum = {}
for index, name in ipairs(enumItems) do
enum[name] = index - 1
enum[index - 1] = name
end
if _G.dev then
setmetatable(enum, {
__index = function(_, index)
return error(`"{index}" is not a valid enum item.`, 2)
end... | 106 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/errors.luau | local Functions = require("@shared/functions")
local getInstanceName = Functions.getInstanceName
local getFunctionName = Functions.getFunctionName
local Errors = {}
function Errors.cannotAccess(instance: Instance, capability: string?): string
if capability then
return `The current thread cannot access '{getInstan... | 367 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/functions.luau | -- Maybe this should be rewritten to have each function in it's own file?
local string = string
local game = game
local coroutine = coroutine
local debug = debug
local table = table
local CSPRNG = require("@shared/crypto/CSPRNG")
local Functions = {}
function Functions.empty() end
function Functions.randomString(le... | 523 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/log.luau | local table = table
local print = print
local warn = warn
local error = error
local TestService = game:GetService("TestService")
local prefix
local Log = {}
function Log:SetPrefix(_prefix)
if prefix then
return error("Prefix is already set.", 2)
end
prefix = _prefix
end
function Log.debug(...: any)
if _G.deb... | 136 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/msgpack.luau | --!native
--!strict
local msgpack = {}
local band = bit32.band
local bor = bit32.bor
local bufferCreate = buffer.create
local bufferLen = buffer.len
local bufferCopy = buffer.copy
local readstring = buffer.readstring
local writestring = buffer.writestring
local readu8 = buffer.readu8
local readi8 = buffer.readi8
local... | 6,929 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/network/encoding.luau | --!strict
local MessagePack = require("@shared/msgpack")
local XXH32 = require("@shared/crypto/XXH32")
-- thank you rojo
local CFRAME_ID_LOOKUP_TABLE = table.freeze({
[0x02] = CFrame.fromEulerAnglesYXZ(0, 0, 0),
[0x03] = CFrame.fromEulerAnglesYXZ(math.rad(90), 0, 0),
[0x05] = CFrame.fromEulerAnglesYXZ(0, math.rad(... | 2,240 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/network/requestMethods.luau | local Enum = require("@shared/enum")
return {
Server = Enum({
"KeyExchange",
"Handshake",
"Event",
"Invoke",
}),
Client = Enum({
"Event",
"InvokeResult",
}),
}
| 57 |
Open-SB/OpenSB | Open-SB-OpenSB-a1f9cc8/modules/shared/network/services.luau | -- A list of possible services that the network remotes can be parented to.
if _G.dev then
-- While in development, it might be helpful to know where the remotes are located at.
return { game:GetService("ReplicatedStorage") }
end
-- Some services are commented out because they either might break some scripts, or th... | 253 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.