summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core
diff options
context:
space:
mode:
authornielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-03 17:25:25 +0200
committernielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-03 17:25:25 +0200
commitf78a29a9b1fb3a77834d523d1b9043ff5be71568 (patch)
treec6e0138408ed4d7d9fd2cf2d283fb2601671018a /MCServer/Plugins/Core
parentFixed bug with Rotation not getting properly wrapped after being set. (diff)
downloadcuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar.gz
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar.bz2
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar.lz
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar.xz
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.tar.zst
cuberite-f78a29a9b1fb3a77834d523d1b9043ff5be71568.zip
Diffstat (limited to 'MCServer/Plugins/Core')
-rw-r--r--MCServer/Plugins/Core/console.lua27
-rw-r--r--MCServer/Plugins/Core/main.lua1
2 files changed, 28 insertions, 0 deletions
diff --git a/MCServer/Plugins/Core/console.lua b/MCServer/Plugins/Core/console.lua
index 5a1ce8ef2..efdf5c39e 100644
--- a/MCServer/Plugins/Core/console.lua
+++ b/MCServer/Plugins/Core/console.lua
@@ -18,6 +18,7 @@ function InitConsoleCommands()
PluginMgr:BindConsoleCommand("say", HandleConsoleSay, "Sends a chat message to all players");
PluginMgr:BindConsoleCommand("unload", HandleConsoleUnload, "Unloads all unused chunks");
PluginMgr:BindConsoleCommand("rank", HandleConsoleRank, " [Player] [Rank] - to add someone to a group");
+ PluginMgr:BindConsoleCommand("listgroups", HandleConsoleListGroups, "Shows a list of all the groups");
end
@@ -167,6 +168,11 @@ function HandleConsoleUnload(Split)
return true;
end
+
+
+
+
+
function HandleConsoleRank(Split)
if Split[2] == nil or Split[3] == nil then
LOG("Usage: /rank [Player] [Group]")
@@ -202,6 +208,27 @@ function HandleConsoleRank(Split)
end
+
+
+
+
+function HandleConsoleListGroups(Split)
+ local GroupsIni = cIniFile("groups.ini")
+ if GroupsIni:ReadFile() == false then
+ LOG( "No groups found" )
+ end
+ Number = GroupsIni:NumKeys()
+ Groups = {}
+ for i=0, Number do
+ table.insert( Groups, GroupsIni:KeyName(i) )
+ end
+ LOGINFO( "Groups:" )
+ LOGINFO( table.concat( Groups, ", " ) )
+ return true
+end
+
+
+
function HandleConsole(Split)
return true;
end
diff --git a/MCServer/Plugins/Core/main.lua b/MCServer/Plugins/Core/main.lua
index 2eb07b6fd..8f83a2989 100644
--- a/MCServer/Plugins/Core/main.lua
+++ b/MCServer/Plugins/Core/main.lua
@@ -32,6 +32,7 @@ function Initialize(Plugin)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING)
+ PluginManager:BindCommand("/listgroups", "core.listgroups", HandleListGroupsCommand, " - Shows a list of all the groups");
PluginManager:BindCommand("/toggledownfall", "core.toggledownfall", HandleToggleDownfallCommand, " - Toggles the weather");
PluginManager:BindCommand("/back", "core.back", HandleBackCommand, " - Return to your last position");
PluginManager:BindCommand("/save-all", "core.save-all", HandleSaveAllCommand, " - Saves all your worlds");