From 03e29802cdde309f3734ab7b6dd17ab60b9a359f Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Sun, 24 Mar 2013 15:44:44 +0000 Subject: Updated core plugin. Added limited world. Configurable through webadmin. Added a Manage server page in webadmin where you can reload/restart/stop the server. You can add players to groups with the webadmin. without the player have to relog first You can change someone's group in-game with a command, without the player have to relog first Hardcore mode Improved death messages git-svn-id: http://mc-server.googlecode.com/svn/trunk@1306 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/main.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'MCServer/Plugins/Core/main.lua') diff --git a/MCServer/Plugins/Core/main.lua b/MCServer/Plugins/Core/main.lua index 579ee4df3..7f595fcdf 100644 --- a/MCServer/Plugins/Core/main.lua +++ b/MCServer/Plugins/Core/main.lua @@ -19,7 +19,7 @@ function Initialize(Plugin) PLUGIN = Plugin Plugin:SetName("Core") - Plugin:SetVersion(10) + Plugin:SetVersion(12) PluginManager = cRoot:Get():GetPluginManager() PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED) @@ -29,13 +29,17 @@ function Initialize(Plugin) PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLING) PluginManager:AddHook(Plugin, cPluginManager.HOOK_CRAFTING_NO_RECIPE) PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT) -- used in web_chat.lua - + PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING) + PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING) + PluginManager:BindCommand("/back", "core.back", HandleBackCommand, " - Return to your last position"); PluginManager:BindCommand("/save-all", "core.save-all", HandleSaveAllCommand, " - Saves all your worlds"); PluginManager:BindCommand("/help", "core.help", HandleHelpCommand, " [Page] - Show available commands"); + PluginManager:BindCommand("/rank", "core.rank", HandleRankCommand, " [Player] [Rank] - to add someone to a group"); PluginManager:BindCommand("/pluginlist", "core.pluginlist", HandlePluginListCommand, " - Show list of plugins"); PluginManager:BindCommand("/tp", "core.teleport", HandleTPCommand, " [Player] - Teleport yourself to a player"); PluginManager:BindCommand("/item", "core.item", HandleItemCommand, " [ItemType/Name] - Give yourself an item"); + PluginManager:BindCommand("/i", "core.item", HandleItemCommand, ""); PluginManager:BindCommand("/list", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players"); PluginManager:BindCommand("/who", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players"); PluginManager:BindCommand("/playerlist", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players"); @@ -55,10 +59,14 @@ function Initialize(Plugin) PluginManager:BindCommand("/viewdistance", "core.viewdistance", HandleViewDistanceCommand, " [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."] - Change your view distance") InitConsoleCommands(); - - local IniFile = cIniFile("settings.ini") + + -- Load the settings + IniFile = cIniFile("Settings.ini") if ( IniFile:ReadFile() == true ) then - SHOW_PLUGIN_NAMES = IniFile:GetValueB("HelpPlugin", "ShowPluginNames", true ) + HardCore = IniFile:GetValueSet("GameMode", "Hardcore", "false") + LimitWorld = IniFile:GetValueSetB("Worlds", "LimitWorld", true) + LimitWorldWidth = IniFile:GetValueSetI("Worlds", "LimitWorldWidth", 200) + SHOW_PLUGIN_NAMES = IniFile:GetValueSetB("HelpPlugin", "ShowPluginNames", true ) end -- Load whitelist, and add default values and stuff @@ -96,6 +104,7 @@ function Initialize(Plugin) end end + Plugin:AddWebTab("Manage Server", HandleRequest_ManageServer); Plugin:AddWebTab("Server Settings", HandleRequest_ServerSettings); Plugin:AddWebTab("Chat", HandleRequest_Chat); Plugin:AddWebTab("Playerlist", HandleRequest_PlayerList); -- cgit v1.2.3