summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-07-31 18:10:59 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-07-31 18:10:59 +0200
commit8ced99994bb654b935e5f858e1f13327ea7381fc (patch)
treeea716c9304b59a1dc37963f9e04f3081605f3daf /MCServer/Plugins
parentMerge branch 'master' of github.com:tigerw/MCServer into tigerw-master (diff)
downloadcuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar.gz
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar.bz2
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar.lz
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar.xz
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.tar.zst
cuberite-8ced99994bb654b935e5f858e1f13327ea7381fc.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Core/back.lua4
-rw-r--r--MCServer/Plugins/Core/ban-unban.lua8
-rw-r--r--MCServer/Plugins/Core/give.lua10
-rw-r--r--MCServer/Plugins/Core/gm.lua2
-rw-r--r--MCServer/Plugins/Core/kick.lua4
-rw-r--r--MCServer/Plugins/Core/locate.lua2
-rw-r--r--MCServer/Plugins/Core/main.lua35
-rw-r--r--MCServer/Plugins/Core/me.lua4
-rw-r--r--MCServer/Plugins/Core/motd.lua9
-rw-r--r--MCServer/Plugins/Core/onchunkgenerating.lua16
-rw-r--r--MCServer/Plugins/Core/ondeath.lua38
-rw-r--r--MCServer/Plugins/Core/onjoinleave.lua11
-rw-r--r--MCServer/Plugins/Core/playerjoin.lua5
-rw-r--r--MCServer/Plugins/Core/playerlist.lua14
-rw-r--r--MCServer/Plugins/Core/plugins.lua4
-rw-r--r--MCServer/Plugins/Core/portal-worlds.lua12
-rw-r--r--MCServer/Plugins/Core/rank-groups.lua16
-rw-r--r--MCServer/Plugins/Core/regen.lua4
-rw-r--r--MCServer/Plugins/Core/save-reload-stop.lua9
-rw-r--r--MCServer/Plugins/Core/spawn.lua2
-rw-r--r--MCServer/Plugins/Core/teleport.lua24
-rw-r--r--MCServer/Plugins/Core/time.lua12
-rw-r--r--MCServer/Plugins/Core/top.lua2
-rw-r--r--MCServer/Plugins/Core/viewdistance.lua4
-rw-r--r--MCServer/Plugins/Core/weather.lua4
-rw-r--r--MCServer/Plugins/Core/web_serversettings.lua22
-rw-r--r--MCServer/Plugins/Core/worldlimiter.lua3
27 files changed, 120 insertions, 160 deletions
diff --git a/MCServer/Plugins/Core/back.lua b/MCServer/Plugins/Core/back.lua
index cc215ba11..7afd5436f 100644
--- a/MCServer/Plugins/Core/back.lua
+++ b/MCServer/Plugins/Core/back.lua
@@ -1,9 +1,9 @@
function HandleBackCommand( Split, Player )
if BackCoords[Player:GetName()] == nil then
- Player:SendMessage(cChatColor.Green .. "There is no last position known")
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "No known last position")
else
Player:TeleportToCoords(BackCoords[Player:GetName()].x, BackCoords[Player:GetName()].y, BackCoords[Player:GetName()].z)
- Player:SendMessage(cChatColor.Green .. "You teleported back to your last known position")
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Teleported back to your last known position")
end
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/ban-unban.lua b/MCServer/Plugins/Core/ban-unban.lua
index cee511e37..da9ee2d6c 100644
--- a/MCServer/Plugins/Core/ban-unban.lua
+++ b/MCServer/Plugins/Core/ban-unban.lua
@@ -1,6 +1,6 @@
function HandleBanCommand( Split, Player )
if( #Split < 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /ban [Player] <Reason>" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /ban [Player] <Reason>" )
return true
end
@@ -10,7 +10,7 @@ function HandleBanCommand( Split, Player )
end
if( BanPlayer(Split[2], Reason) == false ) then
- Player:SendMessage( cChatColor.Green .. "Could not find player " .. Split[2] )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Could not find player " .. Split[2] )
return true
end
@@ -40,12 +40,12 @@ end
function HandleUnbanCommand( Split, Player )
if( #Split < 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /unban [Player]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /unban [Player]" )
return true
end
if( BannedPlayersIni:GetValueB("Banned", Split[2], false) == false ) then
- Player:SendMessage( cChatColor.Green .. Split[2] .. " is not banned!" )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. " is not banned!" )
return true
end
diff --git a/MCServer/Plugins/Core/give.lua b/MCServer/Plugins/Core/give.lua
index d0fc026a6..d1c7ae59f 100644
--- a/MCServer/Plugins/Core/give.lua
+++ b/MCServer/Plugins/Core/give.lua
@@ -1,6 +1,6 @@
function HandleGiveCommand(Split, Player)
if ((#Split ~= 2) and (#Split ~=3)) then
- Player:SendMessage(cChatColor.Green .. "Usage: /give [ItemType/Name:Dmg] <Amount>");
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /give [ItemType/Name:Dmg] <Amount>" );
return true;
end
@@ -12,7 +12,7 @@ function HandleGiveCommand(Split, Player)
end
if not(FoundItem) then
- Player:SendMessage( cChatColor.Green .. "Invalid item id or name!" )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Invalid item id or name!" )
return true
end
@@ -20,7 +20,7 @@ function HandleGiveCommand(Split, Player)
if (#Split == 3) then
ItemAmount = tonumber(Split[3]);
if ((ItemAmount == nil) or (ItemAmount < 1) or (ItemAmount > 512)) then
- Player:SendMessage(cChatColor.Green .. "Invalid amount!");
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Invalid amount!" );
return true;
end
end
@@ -29,10 +29,10 @@ function HandleGiveCommand(Split, Player)
local ItemsGiven = Player:GetInventory():AddItem(Item);
if (ItemsGiven == ItemAmount) then
- Player:SendMessage( cChatColor.Green .. "There you go!");
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "There you go!" );
LOG("Gave " .. Player:GetName() .. " " .. Item.m_ItemCount .. " times " .. Item.m_ItemType .. ":" .. Item.m_ItemDamage);
else
- Player:SendMessage(cChatColor.Green .. "Not enough space in inventory, only gave " .. ItemsGiven);
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Not enough space in inventory, only gave " .. ItemsGiven);
LOG("Player " .. Player:GetName() .. " asked for " .. Item.m_ItemCount .. " times " .. Item.m_ItemType .. ":" .. Item.m_ItemDamage ..", but only could fit " .. ItemsGiven);
end
return true;
diff --git a/MCServer/Plugins/Core/gm.lua b/MCServer/Plugins/Core/gm.lua
index 85bcf984b..5aa6cb2f3 100644
--- a/MCServer/Plugins/Core/gm.lua
+++ b/MCServer/Plugins/Core/gm.lua
@@ -1,6 +1,6 @@
function HandleChangeGMCommand( Split, Player )
if( #Split ~= 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /gm [GameMode (0|1)]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /gm [GameMode (0|1)]" )
return true
end
Player:SetGameMode(Split[2])
diff --git a/MCServer/Plugins/Core/kick.lua b/MCServer/Plugins/Core/kick.lua
index be6215df4..c396f9232 100644
--- a/MCServer/Plugins/Core/kick.lua
+++ b/MCServer/Plugins/Core/kick.lua
@@ -1,6 +1,6 @@
function HandleKickCommand( Split, Player )
if( #Split < 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /kick [Player] <Reason>" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /kick [Player] <Reason>" )
return true
end
@@ -10,7 +10,7 @@ function HandleKickCommand( Split, Player )
end
if( KickPlayer( Split[2], Reason ) == false ) then
- Player:SendMessage( cChatColor.Green .. "Could not find player " .. Split[2] )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Could not find player " .. Split[2] )
end
return true
diff --git a/MCServer/Plugins/Core/locate.lua b/MCServer/Plugins/Core/locate.lua
index 27fcad229..9e0b50d8b 100644
--- a/MCServer/Plugins/Core/locate.lua
+++ b/MCServer/Plugins/Core/locate.lua
@@ -1,4 +1,4 @@
function HandleLocateCommand( Split, Player )
- Player:SendMessage(cChatColor.Green .. string.format("[X:%0.2f] [Y:%0.2f] [Z:%0.2f]", Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() ) )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. string.format("You are at [X:%0.2f Y:%0.2f Z:%0.2f] in world %s", Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), Player:GetWorld():GetName()) )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/main.lua b/MCServer/Plugins/Core/main.lua
index 75f8a028b..755ec4db8 100644
--- a/MCServer/Plugins/Core/main.lua
+++ b/MCServer/Plugins/Core/main.lua
@@ -4,7 +4,6 @@ BannedPlayersIni = {}
WhiteListIni = {}
BackCoords = {}
Messages = {}
-LimitWorldsCuboid = {}
--END VARIABLES
--COMMENCE AWESOMENESS!
@@ -17,13 +16,13 @@ function Initialize(Plugin)
--ADD HOOKS
PluginManager = cRoot:Get():GetPluginManager()
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED)
+ PluginManager:AddHook(Plugin, cPluginManager.HOOK_DISCONNECT)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_BREAKING_BLOCK)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACING_BLOCK)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_LOGIN)
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)
--PLEASE ALPHA SORT http://elmosaukko.com/sort-alphabetically/ THIS LIST
@@ -34,11 +33,9 @@ function Initialize(Plugin)
PluginManager:BindCommand("/gm", "core.changegm", HandleChangeGMCommand, " ~ Change your gamemode");
PluginManager:BindCommand("/help", "core.help", HandleHelpCommand, " ~ Show available commands");
PluginManager:BindCommand("/kick", "core.kick", HandleKickCommand, " ~ Kick a player");
- PluginManager:BindCommand("/list", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players");
- PluginManager:BindCommand("/listgroups", "core.listgroups", HandleListGroupsCommand, " - Shows a list of all the groups");
+ PluginManager:BindCommand("/groups", "core.groups", HandleGroupsCommand, " - Shows a list of all the groups");
PluginManager:BindCommand("/locate", "core.locate", HandleLocateCommand, " - Show your current server coordinates");
PluginManager:BindCommand("/motd", "core.motd", HandleMOTDCommand, " - Show message of the day");
- PluginManager:BindCommand("/playerlist", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players");
PluginManager:BindCommand("/plugins", "core.plugins", HandlePluginsCommand, " - Show list of plugins");
PluginManager:BindCommand("/portal", "core.portal", HandlePortalCommand, " ~ Move to a different world");
PluginManager:BindCommand("/rank", "core.rank", HandleRankCommand, " ~ Add someone to a group");
@@ -48,7 +45,7 @@ function Initialize(Plugin)
PluginManager:BindCommand("/spawn", "core.spawn", HandleSpawnCommand, " - Return to the spawn");
PluginManager:BindCommand("/stop", "core.stop", HandleStopCommand, " - Stops the server");
PluginManager:BindCommand("/time", "core.time", HandleTimeCommand, " ~ Sets the time of day");
- PluginManager:BindCommand("/toggledownfall", "core.toggledownfall", HandleToggleDownfallCommand, " - Toggles the weather");
+ PluginManager:BindCommand("/downfall", "core.downfall", HandleDownfallCommand, " - Toggles the weather");
PluginManager:BindCommand("/me", "core.me", HandleMeCommand, " ~ Tell what you are doing");
PluginManager:BindCommand("/top", "core.top", HandleTopCommand, " - Teleport yourself to the top most block");
PluginManager:BindCommand("/tp", "core.teleport", HandleTPCommand, " ~ Teleport yourself to a player");
@@ -56,7 +53,6 @@ function Initialize(Plugin)
PluginManager:BindCommand("/tpaccept", "core.teleport", HandleTPAcceptCommand, " ~ Accept a teleportation request");
PluginManager:BindCommand("/unban", "core.unban", HandleUnbanCommand, " ~ Unban a player");
PluginManager:BindCommand("/viewdistance", "core.viewdistance", HandleViewDistanceCommand, " [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."] - Change your view distance")
- PluginManager:BindCommand("/who", "core.playerlist", HandlePlayerListCommand, " - Shows list of connected players");
PluginManager:BindCommand("/worlds", "core.worlds", HandleWorldsCommand, " - Shows a list of all the worlds");
InitConsoleCommands();
@@ -65,14 +61,12 @@ function Initialize(Plugin)
IniFile = cIniFile("settings.ini")
if ( IniFile:ReadFile() == true ) then
HardCore = IniFile:GetValueSet("GameMode", "Hardcore", "false")
- LimitWorld = IniFile:GetValueSetB("Worlds", "LimitWorld", false)
- LimitWorldWidth = IniFile:GetValueSetI("Worlds", "LimitWorldWidth", 10)
IniFile:WriteFile()
end
WorldsSpawnProtect = {}
local KeyIdx = IniFile:FindKey("Worlds") --(FIND WHERE 'WORLDS' KEY IS LOCATED)
- local NumValues = (IniFile:GetNumValues( KeyIdx ) - 2) --(TAKE AWAY TWO OPTIONS FOR WORLD LIMITER)
+ local NumValues = (IniFile:GetNumValues( KeyIdx )) --(HOW MANY VALUES ARE THERE?)
for i = 0, NumValues - 1 do --(FOR EVERY WORLD KEY, TAKING ACCOUNT OF OFF BY ONE ERRORS)
WorldIni = cIniFile(IniFile:GetValue(KeyIdx, i) .. "/world.ini")
if WorldIni:ReadFile() == true then
@@ -80,16 +74,15 @@ function Initialize(Plugin)
WorldIni:WriteFile()
end
end
-
- if LimitWorld == true then
- cRoot:Get():ForEachWorld(
- function( World )
- LimitWorldsCuboid[World:GetName()] = cCuboid()
- LimitWorldsCuboid[World:GetName()].p1 = Vector3i( math.floor(World:GetSpawnX() / 16) + LimitWorldWidth, 0, math.floor(World:GetSpawnZ() / 16) + LimitWorldWidth)
- LimitWorldsCuboid[World:GetName()].p2 = Vector3i( math.floor(World:GetSpawnX() / 16) - LimitWorldWidth, 256, math.floor(World:GetSpawnZ() / 16) - LimitWorldWidth)
- LimitWorldsCuboid[World:GetName()]:Sort()
- end
- )
+ WorldsWorldLimit = {}
+ local KeyIdx = IniFile:FindKey("Worlds") --(FIND WHERE 'WORLDS' KEY IS LOCATED)
+ local NumValues = (IniFile:GetNumValues( KeyIdx )) --(HOW MANY VALUES ARE THERE?)
+ for i = 0, NumValues - 1 do --(FOR EVERY WORLD KEY, TAKING ACCOUNT OF OFF BY ONE ERRORS)
+ WorldIni = cIniFile(IniFile:GetValue(KeyIdx, i) .. "/world.ini")
+ if WorldIni:ReadFile() == true then
+ WorldsWorldLimit[IniFile:GetValue(KeyIdx, i)] = WorldIni:GetValueSetI("WorldLimit", "LimitRadius", 0)
+ WorldIni:WriteFile()
+ end
end
--LOAD WHITELIST
@@ -178,7 +171,7 @@ function WriteLog(breakPlace, X, Y, Z, player, id, meta)
end
function WarnPlayer(Player)
- Player:SendMessage("Go further from spawn to build")
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Go further from spawn to build")
return
end
diff --git a/MCServer/Plugins/Core/me.lua b/MCServer/Plugins/Core/me.lua
index 8717a097e..5ae15b97d 100644
--- a/MCServer/Plugins/Core/me.lua
+++ b/MCServer/Plugins/Core/me.lua
@@ -5,11 +5,11 @@ function HandleMeCommand( Split, Player )
Message = Message .. " " .. Text;
end
if (Split[1] == nil) then
- Player:SendMessage("Usage: /me <action>")
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /me <action>")
return true
end
if (Split[1] ~= nil) then
- cRoot:Get():GetServer():BroadcastChat(Player:GetName().. ""..Message);
+ cRoot:Get():GetServer():BroadcastChat(Player:GetName() .. "" .. Message);
return true
end
end
diff --git a/MCServer/Plugins/Core/motd.lua b/MCServer/Plugins/Core/motd.lua
index 2a42c80af..cbcad2b98 100644
--- a/MCServer/Plugins/Core/motd.lua
+++ b/MCServer/Plugins/Core/motd.lua
@@ -3,9 +3,6 @@ function HandleMOTDCommand( Split, Player )
return true
end
-
-
-
function LoadMotd()
local File = io.open("motd.txt", "r")
-- Check if the file 'motd.txt' exists, else create it.
@@ -35,18 +32,12 @@ function LoadMotd()
end
end
-
-
-
function ShowMOTDTo( Player )
for I=1, #Messages do
Player:SendMessage(Messages[I])
end
end
-
-
-
function ReturnColorFromChar( Split, char )
-- Check if the char represents a color. Else return nil.
if char == "0" then
diff --git a/MCServer/Plugins/Core/onchunkgenerating.lua b/MCServer/Plugins/Core/onchunkgenerating.lua
deleted file mode 100644
index 44a6cf298..000000000
--- a/MCServer/Plugins/Core/onchunkgenerating.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-function OnChunkGenerating(World, ChunkX, ChunkZ, ChunkDesc)
- if (LimitWorld == true) then
- if not LimitWorldsCuboid[World:GetName()]:IsInside( Vector3i(ChunkX, 128, ChunkZ) ) then
- FillBlocks(ChunkDesc)
- end
- end
-end
-
-function FillBlocks(ChunkDesc)
- ChunkDesc:FillBlocks(0,0)
- ChunkDesc:SetUseDefaultBiomes(false)
- ChunkDesc:SetUseDefaultHeight(false)
- ChunkDesc:SetUseDefaultComposition(false)
- ChunkDesc:SetUseDefaultStructures(false)
- ChunkDesc:SetUseDefaultFinish(false)
-end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/ondeath.lua b/MCServer/Plugins/Core/ondeath.lua
index 47a7532a6..463890751 100644
--- a/MCServer/Plugins/Core/ondeath.lua
+++ b/MCServer/Plugins/Core/ondeath.lua
@@ -3,54 +3,54 @@ function OnKilling(Victim, Killer)
SetBackCoordinates( Victim )
Server = cRoot:Get():GetServer()
if Killer == nil then
- if Victim:IsOnFire() then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was burnt to a cinder" )
+ if Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 10 or Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 11 then
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " tried to swim in lava (and failed)" )
CheckHardcore(Victim)
return false
end
- if Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 10 or Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 11 then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " tried to swim in lava (and failed)" )
+ if Victim:IsOnFire() then
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was burnt to a cinder" )
CheckHardcore(Victim)
return false
end
else
if Killer:IsPlayer() then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was terminated by " .. Killer:GetName() )
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was terminated by " .. Killer:GetName() )
CheckHardcore(Victim)
return false
elseif Killer:IsMob() then
if Killer:IsA("cZombie") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was eaten by a Zombie")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was eaten by a zombie")
elseif Killer:IsA("cSkeleton") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was shot by a Skeleton" )
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was shot by a skeleton" )
elseif Killer:IsA("cCreeper") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was blown up by a Creeper")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was blown up by a creeper")
elseif Killer:IsA("cSpider") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was ripped apart by a giant Spider")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was ripped apart by a giant spider")
elseif Killer:IsA("cCaveSpider") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was poisoned by a giant Cave Spider")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was poisoned by a giant cave spider")
elseif Killer:IsA("cBlaze") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was flamed by a Blaze")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was flamed by a blaze")
elseif Killer:IsA("cEnderman") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was " .. cChatColor.Random .. " by an Enderman")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was " .. cChatColor.Random .. " by an enderman")
elseif Killer:IsA("cSilverfish") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was... DERPED by a Silverfish!")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " encountered an unexpectedly fatal silverfish attack")
elseif Killer:IsA("cSlime") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was stuck fast and killed by a Slime")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was absorbed and digested by a slime")
elseif Killer:IsA("cWitch") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was enchanted (to death) by a Witch")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was enchanted (to death) by a witch")
elseif Killer:IsA("cZombiepigman") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was slain by a Zombie Pigman")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was slain by a zombie pigman")
elseif Killer:IsA("cMagmacube") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was incinerated by a Magmacube")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was incinerated by a magmacube")
elseif Killer:IsA("cWolf") then
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " was savaged by a Wolf")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was savaged by a wolf")
end
CheckHardcore(Victim)
return false
end
end
- Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " died of mysterious circumstances")
+ Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " died of mysterious circumstances")
CheckHardcore(Victim)
end
end
diff --git a/MCServer/Plugins/Core/onjoinleave.lua b/MCServer/Plugins/Core/onjoinleave.lua
new file mode 100644
index 000000000..34b1a29ae
--- /dev/null
+++ b/MCServer/Plugins/Core/onjoinleave.lua
@@ -0,0 +1,11 @@
+function OnPlayerJoined(Player)
+ ShowMOTDTo( Player )
+ local Server = cRoot:Get():GetServer()
+ Server:SendMessage(cChatColor.Yellow .. "[JOIN] " .. cChatColor.White .. Player:GetName() .. " has joined the game" )
+ return false
+end
+
+function OnDisconnect(Player, Reason)
+ local Server = cRoot:Get():GetServer()
+ Server:SendMessage(cChatColor.Yellow .. "[LEAVE] " .. cChatColor.White .. Player:GetName() .. " has left the game" )
+end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/playerjoin.lua b/MCServer/Plugins/Core/playerjoin.lua
deleted file mode 100644
index 884acb66a..000000000
--- a/MCServer/Plugins/Core/playerjoin.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-function OnPlayerJoined(Player)
- ShowMOTDTo( Player )
- AddMessage( Player:GetName() .. " has joined the game", " " )
- return false
-end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/playerlist.lua b/MCServer/Plugins/Core/playerlist.lua
deleted file mode 100644
index 73d9e5b24..000000000
--- a/MCServer/Plugins/Core/playerlist.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-function HandlePlayerListCommand( Split, Player )
-
- local PlayerTable = {}
- local AppendToTable = function( Player )
- table.insert(PlayerTable, Player:GetName() )
- end
- Player:GetWorld():ForEachPlayer( AppendToTable )
-
- local Message = cChatColor.Green .. "Connected players: (".. cChatColor.White.. #PlayerTable .. cChatColor.Green .. ")"
- Player:SendMessage( Message )
-
- Player:SendMessage( table.concat(PlayerTable, " ") )
- return true
-end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/plugins.lua b/MCServer/Plugins/Core/plugins.lua
index 6d74cf29e..66b6b4d90 100644
--- a/MCServer/Plugins/Core/plugins.lua
+++ b/MCServer/Plugins/Core/plugins.lua
@@ -9,7 +9,7 @@ function HandlePluginsCommand( Split, Player )
end
end
- Player:SendMessage( cChatColor.Green .. "Loaded plugins: (" .. #PluginTable .. ")" )
- Player:SendMessage( cChatColor.Gold .. table.concat(PluginTable, cChatColor.Gold.." ") )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "There are " .. #PluginTable .. " loaded plugins")
+ Player:SendMessage(cChatColor.Gold .. table.concat(PluginTable, cChatColor.Gold.." ") )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/portal-worlds.lua b/MCServer/Plugins/Core/portal-worlds.lua
index 136edb82e..e0de77c85 100644
--- a/MCServer/Plugins/Core/portal-worlds.lua
+++ b/MCServer/Plugins/Core/portal-worlds.lua
@@ -1,23 +1,23 @@
function HandlePortalCommand( Split, Player )
if( #Split ~= 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /gotoworld [WorldName]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /portal [WorldName]" )
return true
end
if( Player:MoveToWorld(Split[2]) == false ) then
- Player:SendMessage( cChatColor.Green .. "Could not move to world '" .. Split[2] .. "'!" )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Could not move to world " .. Split[2] .. "!" )
return true
end
- Player:SendMessage( cChatColor.Green .. "Moved successfully to '" .. Split[2] .. "'! :D" )
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Moved successfully to '" .. Split[2] .. "'! :D" )
return true
end
function HandleWorldsCommand( Split, Player )
local SettingsIni = cIniFile("settings.ini")
if SettingsIni:ReadFile() == false then
- Player:SendMessage( cChatColor.Green .. "No worlds found" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "No worlds found" )
end
Number = SettingsIni:NumValues("Worlds") - 1
Worlds = {}
@@ -30,7 +30,7 @@ function HandleWorldsCommand( Split, Player )
for i=0, Number do
table.insert( Worlds, SettingsIni:GetValue( Key, i) )
end
- Player:SendMessage( cChatColor.Green .. "Worlds:" )
- Player:SendMessage( cChatColor.Green .. table.concat( Worlds, ", " ) )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Found " .. #Worlds .. " worlds" )
+ Player:SendMessage(cChatColor.Gold .. table.concat( Worlds, ", " ) )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/rank-groups.lua b/MCServer/Plugins/Core/rank-groups.lua
index 157d91744..04050fc80 100644
--- a/MCServer/Plugins/Core/rank-groups.lua
+++ b/MCServer/Plugins/Core/rank-groups.lua
@@ -1,6 +1,6 @@
function HandleRankCommand( Split, Player )
if Split[2] == nil or Split[3] == nil then
- Player:SendMessage(cChatColor.Rose .. "Usage: /rank [Player] [Group]")
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /rank [Player] [Group]")
return true
end
local GroupsIni = cIniFile("groups.ini")
@@ -8,7 +8,7 @@ function HandleRankCommand( Split, Player )
LOG("Could not read groups.ini!")
end
if GroupsIni:FindKey(Split[3]) == -1 then
- Player:SendMessage(cChatColor.Rose .. "Group does not exist")
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Group does not exist")
return true
end
local UsersIni = cIniFile("users.ini")
@@ -20,7 +20,7 @@ function HandleRankCommand( Split, Player )
UsersIni:WriteFile()
local loopPlayers = function( Player )
if Player:GetName() == Split[2] then
- Player:SendMessage( cChatColor.Green .. "You were moved to group " .. Split[3] )
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You were moved to group " .. Split[3] )
Player:LoadPermissionsFromDisk()
end
end
@@ -28,21 +28,21 @@ function HandleRankCommand( Split, Player )
World:ForEachPlayer( loopPlayers )
end
cRoot:Get():ForEachWorld( loopWorlds )
- Player:SendMessage(cChatColor.Green .. "Player " .. Split[2] .. " Was moved to " .. Split[3])
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Player " .. Split[2] .. " Was moved to " .. Split[3])
return true
end
-function HandleListGroupsCommand( Split, Player )
+function HandleGroupsCommand( Split, Player )
local GroupsIni = cIniFile("groups.ini")
if GroupsIni:ReadFile() == false then
- Player:SendMessage( cChatColor.Green .. "No groups found" )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "No groups found" )
end
Number = GroupsIni:NumKeys() - 1
Groups = {}
for i=0, Number do
table.insert( Groups, GroupsIni:KeyName(i) )
end
- Player:SendMessage( cChatColor.Green .. "Groups:" )
- Player:SendMessage( cChatColor.Green .. table.concat( Groups, ", " ) )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Found " .. #Groups .. " groups" )
+ Player:SendMessage(cChatColor.Gold .. table.concat( Groups, " " ) )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/regen.lua b/MCServer/Plugins/Core/regen.lua
index f1dd4e118..176396734 100644
--- a/MCServer/Plugins/Core/regen.lua
+++ b/MCServer/Plugins/Core/regen.lua
@@ -1,6 +1,6 @@
function HandleRegenCommand(Split, Player)
if ((#Split == 2) or (#Split > 3)) then
- Player:SendMessage( cChatColor.Green .. "Usage: '/regeneratechunk' or '/regeneratechunk [X] [Z]'");
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: '/regeneratechunk' or '/regeneratechunk [X] [Z]'");
return true;
end
@@ -12,7 +12,7 @@ function HandleRegenCommand(Split, Player)
Z = Split[3];
end
- Player:SendMessage(cChatColor.Green .. "Regenerating chunk ["..X..", "..Z.."]");
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Regenerating chunk ["..X..", "..Z.."]");
Player:GetWorld():RegenerateChunk(X, Z);
return true;
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/save-reload-stop.lua b/MCServer/Plugins/Core/save-reload-stop.lua
index 57744b088..c4aa030cb 100644
--- a/MCServer/Plugins/Core/save-reload-stop.lua
+++ b/MCServer/Plugins/Core/save-reload-stop.lua
@@ -1,19 +1,22 @@
function HandleSaveAllCommand( Split, Player )
cRoot:Get():SaveAllChunks();
- Player:SendMessage(cChatColor.Green .. "All the worlds are saved")
+ local Server = cRoot:Get():GetServer()
+ Server:SendMessage(cChatColor.Rose .. "[WARNING] " .. cChatColor.White .. "Saving all worlds!")
return true;
end
function HandleStopCommand( Split, Player )
Server = cRoot:Get():GetServer()
- Server:SendMessage( cChatColor.Green .. "Stopping the server..." )
+ local Server = cRoot:Get():GetServer()
+ Server:SendMessage(cChatColor.Red .. "[WARNING] " .. cChatColor.White .. "Server is terminating!" )
cRoot:Get():QueueExecuteConsoleCommand("stop")
return true
end
function HandleReloadCommand( Split, Player )
Server = cRoot:Get():GetServer()
- Server:SendMessage( cChatColor.Green .. "Reloading all plugins." )
+ local Server = cRoot:Get():GetServer()
+ Server:SendMessage(cChatColor.Rose .. "[WARNING] " .. cChatColor.White .. "Reloading all plugins!" )
cRoot:Get():GetPluginManager():ReloadPlugins()
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/spawn.lua b/MCServer/Plugins/Core/spawn.lua
index 2b07c5767..09ada3ada 100644
--- a/MCServer/Plugins/Core/spawn.lua
+++ b/MCServer/Plugins/Core/spawn.lua
@@ -2,6 +2,6 @@ function HandleSpawnCommand(Split, Player)
World = Player:GetWorld()
SetBackCoordinates(Player)
Player:TeleportToCoords(World:GetSpawnX(), World:GetSpawnY(), World:GetSpawnZ())
- LOGINFO(Player:GetName() .. " returned to spawn.")
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Returned to world spawn" )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/teleport.lua b/MCServer/Plugins/Core/teleport.lua
index 89352408a..3ba5e36ef 100644
--- a/MCServer/Plugins/Core/teleport.lua
+++ b/MCServer/Plugins/Core/teleport.lua
@@ -7,23 +7,23 @@ function HandleTPCommand(a_Split, a_Player)
-- Teleport to XYZ coords specified in a_Split[2, 3, 4]:
SetBackCoordinates(a_Player);
a_Player:TeleportToCoords(a_Split[2], a_Split[3], a_Split[4]);
- a_Player:SendMessage(cChatColor.Green .. "You teleported to {" .. a_Split[2] .. ", " .. a_Split[3] .. ", " .. a_Split[4] .. "}");
+ a_Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You teleported to [X:" .. a_Split[2] .. " Y:" .. a_Split[3] .. " Z:" .. a_Split[4] .. "]");
return true;
else
- a_Player:SendMessage( cChatColor.Green .. "Usage: /tp [PlayerName] (-h) or /tp [X Y Z]" )
+ a_Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /tp [PlayerName] (-h) or /tp [X Y Z]" )
return true
end
end
function HandleTPACommand( Split, Player )
if Split[2] == nil then
- Player:SendMessage( cChatColor.Green .. "Usage: /tpa [Player]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /tpa [Player]" )
return true
end
local loopPlayer = function( OtherPlayer )
if OtherPlayer:GetName() == Split[2] then
- OtherPlayer:SendMessage( cChatColor.Green .. Player:GetName() .. " send a teleport request" )
- Player:SendMessage( cChatColor.Green .. "You send a teleport request to " .. OtherPlayer:GetName() )
+ OtherPlayer:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. Player:GetName() .. " send a teleport request" )
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You send a teleport request to " .. OtherPlayer:GetName() )
Destination[OtherPlayer:GetName()] = Player:GetName()
end
end
@@ -36,7 +36,7 @@ end
function HandleTPAcceptCommand( Split, Player )
if Destination[Player:GetName()] == nil then
- Player:SendMessage( cChatColor.Green .. "Nobody has send you a teleport request" )
+ Player:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Nobody has send you a teleport request" )
return true
end
local loopPlayer = function( OtherPlayer )
@@ -45,8 +45,8 @@ function HandleTPAcceptCommand( Split, Player )
OtherPlayer:MoveToWorld( Player:GetWorld():GetName() )
end
OtherPlayer:TeleportToEntity( Player )
- Player:SendMessage( cChatColor.Green .. OtherPlayer:GetName() .. " teleported to you" )
- OtherPlayer:SendMessage( cChatColor.Green .. "You teleported to " .. Player:GetName() )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. OtherPlayer:GetName() .. " teleported to you" )
+ OtherPlayer:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You teleported to " .. Player:GetName() )
Destination[Player:GetName()] = nil
end
end
@@ -62,19 +62,19 @@ function TeleportToPlayer(a_SrcPlayer, a_DstPlayerName, a_TellDst)
local teleport = function(OtherPlayer)
if (OtherPlayer == a_SrcPlayer) then
-- Asked to teleport to self?
- a_SrcPlayer:SendMessage(cChatColor.Green .. "Y' can't teleport to yerself!");
+ a_SrcPlayer:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Y' can't teleport to yerself!");
else
SetBackCoordinates(a_SrcPlayer);
a_SrcPlayer:TeleportToEntity(OtherPlayer);
- a_SrcPlayer:SendMessage(cChatColor.Green .. "You teleported to " .. OtherPlayer:GetName() .. "!");
+ a_SrcPlayer:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You teleported to " .. OtherPlayer:GetName() .. "!");
if (a_TellDst) then
- OtherPlayer:SendMessage(cChatColor.Green .. Player:GetName().." teleported to you!");
+ OtherPlayer:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. Player:GetName().." teleported to you!");
end
end
end
local World = a_SrcPlayer:GetWorld();
if (not(World:DoWithPlayer(a_DstPlayerName, teleport))) then
- a_SrcPlayer:SendMessage(cChatColor.Green .. "Can't find player " .. a_DstPlayerName);
+ a_SrcPlayer:SendMessage(cChatColor.Rose .. "[INFO] " .. cChatColor.White .. "Can't find player " .. a_DstPlayerName);
end
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/time.lua b/MCServer/Plugins/Core/time.lua
index 85593695a..b5d3c991a 100644
--- a/MCServer/Plugins/Core/time.lua
+++ b/MCServer/Plugins/Core/time.lua
@@ -1,23 +1,23 @@
function HandleTimeCommand( Split, Player )
if Split[2] == nil then
- Player:SendMessage( cChatColor.Green .. "Usage: /time [Day/Night/Set/Add]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /time [Day/Night/Set/Add]" )
return true
end
local Server = cRoot:Get():GetServer()
if( string.upper( Split[2] ) == "DAY") then
Player:GetWorld():SetTimeOfDay( 0 )
- Server:SendMessage( cChatColor.Green .. Player:GetName() .. " set the time to Day.")
+ Server:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Time was set to daytime" )
elseif( string.upper( Split[2] ) == "NIGHT") then
Player:GetWorld():SetTimeOfDay( 12000 + 1000 )
- Server:SendMessage( cChatColor.Green .. Player:GetName() .. " set the time to Night.")
+ Server:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Time was set to nighttime" )
elseif( string.upper(Split[2]) == "SET" ) and ( tonumber(Split[3]) ~= nil) then
Player:GetWorld():SetTimeOfDay( tonumber(Split[3]) )
- Server:SendMessage( cChatColor.Green .. Player:GetName() .. " set the time to " .. Split[3] )
+ Server:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Time was set to " .. Split[3] )
elseif( string.upper(Split[2]) == "ADD" ) and ( tonumber(Split[3]) ~= nil) then
Player:GetWorld():SetTimeOfDay( Player:GetWorld():GetTimeOfDay() + Split[3] )
- Server:SendMessage( cChatColor.Green .. Player:GetName() .. " Added " .. Split[3] .. " to the time" )
+ Server:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. Split[3] .. "Was added to the time" )
else
- Player:SendMessage( cChatColor.Green .. "Usage: /time [Day/Night/Set/Add]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /time [Day/Night/Set/Add]" )
end
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/top.lua b/MCServer/Plugins/Core/top.lua
index bc2343f7f..916582543 100644
--- a/MCServer/Plugins/Core/top.lua
+++ b/MCServer/Plugins/Core/top.lua
@@ -5,7 +5,7 @@ function HandleTopCommand( Split, Player )
local Height = World:GetHeight( math.floor(PlayerPos.x), math.floor(PlayerPos.z) )
SetBackCoordinates( Player )
Player:TeleportToCoords( PlayerPos.x, Height+1, PlayerPos.z )
- Player:SendMessage("Teleported to the top block")
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Teleported to the topmost block")
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/viewdistance.lua b/MCServer/Plugins/Core/viewdistance.lua
index dfd310aa7..2cf96d8bc 100644
--- a/MCServer/Plugins/Core/viewdistance.lua
+++ b/MCServer/Plugins/Core/viewdistance.lua
@@ -1,10 +1,10 @@
function HandleViewDistanceCommand( Split, Player )
if( #Split ~= 2 ) then
- Player:SendMessage( cChatColor.Green .. "Usage: /viewdistance [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."]" )
+ Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /viewdistance [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."]" )
return true
end
Player:GetClientHandle():SetViewDistance( Split[2] )
- Player:SendMessage(cChatColor.Green .. "Your viewdistance has been set to " .. Player:GetClientHandle():GetViewDistance() )
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Your view distance has been set to " .. Player:GetClientHandle():GetViewDistance() )
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/weather.lua b/MCServer/Plugins/Core/weather.lua
index 7176e544e..a03cad3ab 100644
--- a/MCServer/Plugins/Core/weather.lua
+++ b/MCServer/Plugins/Core/weather.lua
@@ -1,10 +1,10 @@
-function HandleToggleDownfallCommand( Split, Player )
+function HandleDownfallCommand( Split, Player )
World = Player:GetWorld()
if World:GetWeather() == 0 then
World:SetWeather(1)
else
World:SetWeather(0)
end
- Player:SendMessage( cChatColor.Green .. "Weather toggled")
+ Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Downfall toggled")
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/web_serversettings.lua b/MCServer/Plugins/Core/web_serversettings.lua
index 700d84ae1..75f9b46c2 100644
--- a/MCServer/Plugins/Core/web_serversettings.lua
+++ b/MCServer/Plugins/Core/web_serversettings.lua
@@ -56,12 +56,6 @@ local function ShowGeneralSettings( Request )
if( tonumber( Request.PostParams["Authentication_Authenticate"] ) ~= nil ) then
SettingsIni:SetValue("Authentication", "Authenticate", Request.PostParams["Authentication_Authenticate"], false )
end
- if( tonumber( Request.PostParams["Limit_World"] ) ~= nil ) then
- SettingsIni:SetValue("Worlds", "LimitWorld", Request.PostParams["Limit_World"], false )
- end
- if( tonumber( Request.PostParams["LimitWorldWidth"] ) ~= nil ) then
- SettingsIni:SetValue("Worlds", "LimitWorldWidth", Request.PostParams["LimitWorldWidth"], false )
- end
if( SettingsIni:WriteFile() == false ) then
InfoMsg = [[<b style="color: red;">ERROR: Could not write to settings.ini!</b>]]
@@ -99,13 +93,6 @@ local function ShowGeneralSettings( Request )
<td>]] .. HTML_Select_On_Off("Authentication_Authenticate", SettingsIni:GetValueI("Authentication", "Authenticate") ) .. [[</td></tr>
</table><br />
- <table>
- <th colspan="2">LimitWorld</th>
- <tr><td style="width: 50%;">Limit World:</td>
- <td>]] .. HTML_Select_On_Off("Limit_World", SettingsIni:GetValueI("Worlds", "LimitWorld") ) .. [[</td></tr>
- <tr><td>Max Chunks from spawn:</td>
- <td><input type="text" name="LimitWorldWidth" value="]] .. SettingsIni:GetValue("Worlds", "LimitWorldWidth") .. [["></td></tr>
- </table><br />
<input type="submit" value="Save Settings" name="general_submit"> WARNING: Any changes made here might require a server restart in order to be applied!
</form>]]
@@ -376,6 +363,10 @@ function ShowWorldSettings( Request )
WorldIni:DeleteValue( "SpawnPosition", "Z" )
WorldIni:SetValue( "SpawnPosition", "Z", Request.PostParams["World_SpawnZ"] )
end
+ if( tonumber( Request.PostParams["LimitWorldWidth"] ) ~= nil ) then
+ WorldIni:DeleteValue( "WorldLimit", "LimitRadius" )
+ WorldIni:SetValue( "WorldLimit", "LimitRadius", Request.PostParams["LimitWorldWidth"] )
+ end
if( tonumber( Request.PostParams["World_Seed"] ) ~= nil ) then
WorldIni:DeleteValue( "Seed", "Seed" )
WorldIni:SetValue( "Seed", "Seed", Request.PostParams["World_Seed"] )
@@ -678,6 +669,11 @@ function ShowWorldSettings( Request )
<td><input type="text" name="World_SpawnZ" value="]] .. WorldIni:GetValue("SpawnPosition", "Z") .. [["></td></tr>
</table>
<br />
+ <table>
+ <th colspan="2">LimitWorld</th>
+ <tr><td>Max chunks from spawn (0 to disable):</td>
+ <td><input type="text" name="LimitWorldWidth" value="]] .. WorldIni:GetValue("WorldLimit", "LimitRadius") .. [["></td></tr>
+ </table><br />
<table>
<th colspan="2">Seed</th>
<tr><td>Seed:</td>
diff --git a/MCServer/Plugins/Core/worldlimiter.lua b/MCServer/Plugins/Core/worldlimiter.lua
index 8bd9b5509..8fd3287b2 100644
--- a/MCServer/Plugins/Core/worldlimiter.lua
+++ b/MCServer/Plugins/Core/worldlimiter.lua
@@ -1,5 +1,6 @@
function OnPlayerMoving( Player )
- if LimitWorld == true then
+ LimitWorldWidth = WorldsWorldLimit[Player:GetWorld():GetName()]
+ if LimitWorldWidth > 0 then
local World = Player:GetWorld()
local SpawnX = math.floor(World:GetSpawnX() / 16)
local SpawnZ = math.floor(World:GetSpawnZ() / 16)