core: cmdr

This commit is contained in:
2026-01-07 18:42:01 +02:00
parent 64c91b344a
commit 85516558e4
11 changed files with 186 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
Packages/

View File

@@ -5,7 +5,16 @@
"ReplicatedStorage": { "ReplicatedStorage": {
"$className": "ReplicatedStorage", "$className": "ReplicatedStorage",
"$ignoreUnknownInstances": true, "$ignoreUnknownInstances": true,
"$path": "src/ReplicatedStorage" "$path": "src/ReplicatedStorage",
"Packages": {
"$className": "Folder",
"$path": "Packages"
}
},
"ReplicatedFirst": {
"$className": "ReplicatedFirst",
"$ignoreUnknownInstances": true,
"$path": "src/ReplicatedFirst"
}, },
"ServerScriptService": { "ServerScriptService": {
"$className": "ServerScriptService", "$className": "ServerScriptService",

View File

@@ -0,0 +1,23 @@
return {
Name = "chunkdump",
Aliases = {"dumpchunk"},
Description = "Show server-side block count for a chunk.",
Group = "Debug",
Args = {
{
Type = "integer",
Name = "cx",
Description = "Chunk X"
},
{
Type = "integer",
Name = "cy",
Description = "Chunk Y"
},
{
Type = "integer",
Name = "cz",
Description = "Chunk Z"
}
}
}

View File

@@ -0,0 +1,15 @@
return function(context, cx, cy, cz)
local terrainGen = require(
game:GetService("ServerScriptService")
:WaitForChild("Actor")
:WaitForChild("ServerChunkManager")
:WaitForChild("TerrainGen")
)
local chunk = terrainGen:GetChunk(cx, cy, cz)
local count = 0
for _ in pairs(chunk.data) do
count += 1
end
return ("Chunk %d,%d,%d has %d blocks"):format(cx, cy, cz, count)
end

View File

@@ -0,0 +1,49 @@
return {
Name = "resyncchunk",
Aliases = {"resyncc"},
Description = "Resync a chunk (and optional radius) for a player.",
Group = "Debug",
Args = {
{
Type = "player",
Name = "player",
Description = "Player to resync"
},
{
Type = "integer",
Name = "cx",
Description = "Chunk X"
},
{
Type = "integer",
Name = "cy",
Description = "Chunk Y"
},
{
Type = "integer",
Name = "cz",
Description = "Chunk Z"
},
{
Type = "integer",
Name = "radius",
Description = "Radius around the chunk",
Optional = true,
Default = 0
}
},
Run = function(context, player, cx, cy, cz, radius)
local tickRemote = game:GetService("ReplicatedStorage"):WaitForChild("Tick")
local r = radius or 0
local count = 0
for y = -r, r do
for x = -r, r do
for z = -r, r do
tickRemote:FireClient(player, "C_R", cx + x, cy + y, cz + z, 0, 0, 0, 0)
count += 1
end
end
end
return ("Resync sent to %s (%d chunks)"):format(player.Name, count)
end
}

View File

@@ -0,0 +1,48 @@
return {
Name = "resyncnear",
Aliases = {"resyncnearby"},
Description = "Resync chunks around a player's current chunk.",
Group = "Debug",
Args = {
{
Type = "player",
Name = "player",
Description = "Player to resync"
},
{
Type = "integer",
Name = "radius",
Description = "Radius around the player chunk",
Optional = true,
Default = 1
}
},
Run = function(context, player, radius)
local character = player.Character
if not character then
return "Player has no character"
end
local root = character:FindFirstChild("HumanoidRootPart")
if not root then
return "Player has no HumanoidRootPart"
end
local pos = root.Position
local cx = math.round(pos.X / 32)
local cy = math.round(pos.Y / 32)
local cz = math.round(pos.Z / 32)
local tickRemote = game:GetService("ReplicatedStorage"):WaitForChild("Tick")
local r = radius or 1
local count = 0
for y = -r, r do
for x = -r, r do
for z = -r, r do
tickRemote:FireClient(player, "C_R", cx + x, cy + y, cz + z, 0, 0, 0, 0)
count += 1
end
end
end
return ("Resync sent to %s (%d chunks around %d,%d,%d)"):format(player.Name, count, cx, cy, cz)
end
}

View File

@@ -0,0 +1,7 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local Cmdr = require(ReplicatedStorage.Packages.cmdr)
Cmdr:RegisterDefaultCommands()
Cmdr.Registry:RegisterCommandsIn(ServerScriptService.CmdrCommands)

View File

@@ -7,13 +7,16 @@ end
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService") local UIS = game:GetService("UserInputService")
local TXTS = game:GetService("TextChatService")
local TXTS_CIF = TXTS:FindFirstChildOfClass("ChatInputBarConfiguration")
ReplicatedStorage:WaitForChild("Objects"):WaitForChild("MLLoaded") ReplicatedStorage:WaitForChild("Objects"):WaitForChild("MLLoaded")
game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
UIS.MouseIconEnabled = false UIS.MouseIconEnabled = false
UIS.InputEnded:Connect(function(k) UIS.InputEnded:Connect(function(k)
if k.KeyCode == Enum.KeyCode.M then if k.KeyCode == Enum.KeyCode.M and UIS:GetFocusedTextBox() == nil and not TXTS_CIF.IsFocused then
local v = not script.Parent.DummyButton.Modal local v = not script.Parent.DummyButton.Modal
UIS.MouseIconEnabled = v UIS.MouseIconEnabled = v
script.Parent.CrosshairLabel.Visible = not v script.Parent.CrosshairLabel.Visible = not v

View File

@@ -0,0 +1,8 @@
repeat
wait(0.1)
until game:IsLoaded() == true
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cmdr = require(ReplicatedStorage:WaitForChild("CmdrClient"))
Cmdr:SetActivationKeys({ Enum.KeyCode.F2 })

13
wally.lock Normal file
View File

@@ -0,0 +1,13 @@
# This file is automatically @generated by Wally.
# It is not intended for manual editing.
registry = "test"
[[package]]
name = "evaera/cmdr"
version = "1.12.0"
dependencies = []
[[package]]
name = "ocbwoy3-development-studios/minecraft-roblox"
version = "0.1.0"
dependencies = [["cmdr", "evaera/cmdr@1.12.0"]]

8
wally.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "ocbwoy3-development-studios/minecraft-roblox"
version = "0.1.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
[dependencies]
cmdr = "evaera/cmdr@1.12.0"