Forgotten files for previous merge commit (rev 1139)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1140 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
43e6840719
commit
752057fb1b
@ -1,14 +1,29 @@
|
|||||||
|
|
||||||
|
-- plugin.lua
|
||||||
|
|
||||||
|
-- Implements the main entrypoint for the plugin, as well as all the handling needed
|
||||||
|
|
||||||
|
-- ChatLog plugin logs all chat messages into the server log
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Initialize(Plugin)
|
function Initialize(Plugin)
|
||||||
Plugin:SetName("ChatLog")
|
Plugin:SetName("ChatLog")
|
||||||
Plugin:SetVersion( 2 )
|
Plugin:SetVersion(3)
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager()
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_CHAT )
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT)
|
||||||
|
|
||||||
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
|
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function OnChat(Player, Message)
|
function OnChat(Player, Message)
|
||||||
-- Lets get loggin'
|
-- Lets get loggin'
|
||||||
LOGINFO("[" .. Player:GetName() .. "]: " .. Message);
|
LOGINFO("[" .. Player:GetName() .. "]: " .. Message);
|
||||||
|
@ -27,7 +27,7 @@ function Initialize(Plugin)
|
|||||||
PLUGIN:SetVersion(6)
|
PLUGIN:SetVersion(6)
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager()
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
PluginManager:AddHook(PLUGIN, cPluginManager.E_PLUGIN_TICK)
|
PluginManager:AddHook(PLUGIN, cPluginManager.HOOK_TICK)
|
||||||
|
|
||||||
Plugin:AddWebTab("(Re)Generation", HandleRequest_Generation)
|
Plugin:AddWebTab("(Re)Generation", HandleRequest_Generation)
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ function OnDisable()
|
|||||||
LOG(PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. " is shutting down...")
|
LOG(PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. " is shutting down...")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Tick( DeltaTime )
|
function OnTick( DeltaTime )
|
||||||
if (GENERATION_STATE == 1 or GENERATION_STATE == 3) then
|
if (GENERATION_STATE == 1 or GENERATION_STATE == 3) then
|
||||||
LOGINFO("" .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. ": works STARTED!")
|
LOGINFO("" .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. ": works STARTED!")
|
||||||
LOGINFO("" .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. ": At world: " .. WORK_WORLD)
|
LOGINFO("" .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. ": At world: " .. WORK_WORLD)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
function HandleItemCommand( Split, Player )
|
function HandleItemCommand( Split, Player )
|
||||||
if( #Split ~= 2 and #Split ~=3 ) then
|
if( #Split ~= 2 and #Split ~=3 ) then
|
||||||
Player:SendMessage( cChatColor.Green .. "Usage: /item [ItemID/Name:Dmg] <Amount>" )
|
Player:SendMessage( cChatColor.Green .. "Usage: /item [ItemType/Name:Dmg] <Amount>" )
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ function HandleItemCommand( Split, Player )
|
|||||||
end
|
end
|
||||||
|
|
||||||
if( FoundItem == false ) then
|
if( FoundItem == false ) then
|
||||||
Player:SendMessage( cChatColor.Green .. "Invalid Item ID / Name !" )
|
Player:SendMessage( cChatColor.Green .. "Invalid Item type / name !" )
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@ function Initialize( Plugin )
|
|||||||
PLUGIN = Plugin
|
PLUGIN = Plugin
|
||||||
|
|
||||||
Plugin:SetName( "Core" )
|
Plugin:SetName( "Core" )
|
||||||
Plugin:SetVersion( 8 )
|
Plugin:SetVersion(9)
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager()
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOIN)
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED)
|
||||||
|
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_LOGIN)
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_BLOCK_PLACE)
|
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_BLOCK_DIG)
|
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLED)
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLED)
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CRAFTING_NO_RECIPE)
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CRAFTING_NO_RECIPE)
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT) -- used in web_chat.lua
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT) -- used in web_chat.lua
|
||||||
@ -26,7 +26,7 @@ function Initialize( Plugin )
|
|||||||
Plugin:AddCommand("/help", " - [Page] Show this message", "core.help")
|
Plugin:AddCommand("/help", " - [Page] Show this message", "core.help")
|
||||||
Plugin:AddCommand("/pluginlist", " - Show list of plugins", "core.pluginlist")
|
Plugin:AddCommand("/pluginlist", " - Show list of plugins", "core.pluginlist")
|
||||||
Plugin:AddCommand("/tp", " - [Player] - Teleport yourself to a player", "core.teleport")
|
Plugin:AddCommand("/tp", " - [Player] - Teleport yourself to a player", "core.teleport")
|
||||||
Plugin:AddCommand("/item", " - [ItemID/Name] <Amount> - Spawn an item for yourself", "core.item")
|
Plugin:AddCommand("/item", " - [ItemType/Name] <Amount> - Give yourself an item", "core.item")
|
||||||
Plugin:AddCommand("/list", " - Shows list of connected players", "core.playerlist")
|
Plugin:AddCommand("/list", " - Shows list of connected players", "core.playerlist")
|
||||||
Plugin:AddCommand("/motd", " - Show message of the day", "core.motd")
|
Plugin:AddCommand("/motd", " - Show message of the day", "core.motd")
|
||||||
Plugin:AddCommand("/reload", " - Reload all plugins", "core.reload")
|
Plugin:AddCommand("/reload", " - Reload all plugins", "core.reload")
|
||||||
|
@ -16,7 +16,7 @@ function OnCraftingNoRecipe(Player, Grid, Recipe)
|
|||||||
for x = 0, Grid:GetWidth() - 1 do
|
for x = 0, Grid:GetWidth() - 1 do
|
||||||
for y = 0, Grid:GetHeight() - 1 do
|
for y = 0, Grid:GetHeight() - 1 do
|
||||||
local Item = Grid:GetItem(x, y)
|
local Item = Grid:GetItem(x, y)
|
||||||
if (Item.m_ItemID ~= E_ITEM_EMPTY) then
|
if (Item.m_ItemType ~= E_ITEM_EMPTY) then
|
||||||
table.insert(Items, Item)
|
table.insert(Items, Item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -27,23 +27,23 @@ function OnCraftingNoRecipe(Player, Grid, Recipe)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if (Items[1].m_ItemID ~= Items[2].m_ItemID) then
|
if (Items[1].m_ItemType ~= Items[2].m_ItemType) then
|
||||||
-- Only items of the same type may be fixed
|
-- Only items of the same type may be fixed
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(Items[1].m_ItemHealth == 0) or
|
(Items[1].m_ItemDamage == 0) or
|
||||||
(Items[2].m_ItemHealth == 0)
|
(Items[2].m_ItemDamage == 0)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
-- Only damaged items may be fixed
|
-- Only damaged items may be fixed
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local _ID = Items[1].m_ItemID
|
local _ID = Items[1].m_ItemType
|
||||||
local _least_hp = math.max(Items[1].m_ItemHealth, Items[2].m_ItemHealth)
|
local _least_hp = math.max(Items[1].m_ItemDamage, Items[2].m_ItemDamage)
|
||||||
local _most_hp = math.min(Items[1].m_ItemHealth, Items[2].m_ItemHealth)
|
local _most_hp = math.min(Items[1].m_ItemDamage, Items[2].m_ItemDamage)
|
||||||
local _item_hp = 0
|
local _item_hp = 0
|
||||||
|
|
||||||
-- TODO: This could be refactored into better code, using an _ID-indexed table for _item_hp
|
-- TODO: This could be refactored into better code, using an _ID-indexed table for _item_hp
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function OnBlockDig(Player, BlockX, BlockY, BlockZ, BlockFace, Status, OldBlockType, OldBlockMeta)
|
function OnPlayerBreakingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, Status, OldBlockType, OldBlockMeta)
|
||||||
-- dont check if the direction is in the air
|
-- dont check if the direction is in the air
|
||||||
if (BlockFace ~= -1) then
|
if (BlockFace ~= -1) then
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
function OnPlayerJoin( Player )
|
|
||||||
ShowMOTDTo( Player )
|
|
||||||
return false
|
|
||||||
end
|
|
4
MCServer/Plugins/Core/onplayerjoined.lua
Normal file
4
MCServer/Plugins/Core/onplayerjoined.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
function OnPlayerJoined(Player)
|
||||||
|
ShowMOTDTo( Player )
|
||||||
|
return false
|
||||||
|
end
|
@ -1,4 +1,4 @@
|
|||||||
function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
function OnPlayerPlacingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType)
|
||||||
|
|
||||||
-- dont check if the direction is in the air
|
-- dont check if the direction is in the air
|
||||||
if (BlockFace == -1) then
|
if (BlockFace == -1) then
|
||||||
@ -14,7 +14,7 @@ function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
|||||||
local X = BlockX
|
local X = BlockX
|
||||||
local Y = BlockY
|
local Y = BlockY
|
||||||
local Z = BlockZ
|
local Z = BlockZ
|
||||||
X, Y, Z = AddDirection(X, Y, Z, BlockFace)
|
X, Y, Z = AddFaceDirection(X, Y, Z, BlockFace)
|
||||||
if (Y >= 256 or Y < 0) then
|
if (Y >= 256 or Y < 0) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
@ -13,7 +13,7 @@ function Initialize(Plugin)
|
|||||||
Plugin:SetVersion(1)
|
Plugin:SetVersion(1)
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager()
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE)
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_ITEM)
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE)
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE)
|
||||||
|
|
||||||
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
|
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
|
||||||
@ -24,13 +24,15 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ)
|
||||||
|
|
||||||
-- dont check if the direction is in the air
|
-- dont check if the direction is in the air
|
||||||
if BlockFace == BLOCK_FACE_NONE then
|
if (BlockFace == BLOCK_FACE_NONE) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local HeldItem = Player:GetEquippedItem();
|
||||||
|
|
||||||
if (HeldItem.m_ItemType == E_ITEM_STICK) then
|
if (HeldItem.m_ItemType == E_ITEM_STICK) then
|
||||||
-- Magic sTick of ticking: set the pointed block for ticking at the next tick
|
-- Magic sTick of ticking: set the pointed block for ticking at the next tick
|
||||||
Player:SendMessage(cChatColor.LightGray .. "Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}")
|
Player:SendMessage(cChatColor.LightGray .. "Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}")
|
||||||
@ -42,7 +44,9 @@ function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
|||||||
-- Magic rod of query: show block types and metas for both neighbors of the pointed face
|
-- Magic rod of query: show block types and metas for both neighbors of the pointed face
|
||||||
local Type = 0;
|
local Type = 0;
|
||||||
local Meta = 0;
|
local Meta = 0;
|
||||||
Type, Meta = Player:GetWorld():GetBlockTypeMeta(BlockX, BlockY, BlockZ, Type, Meta);
|
local Valid = false;
|
||||||
|
Valid, Type, Meta = Player:GetWorld():GetBlockTypeMeta(BlockX, BlockY, BlockZ, Type, Meta);
|
||||||
|
|
||||||
if (Type == E_BLOCK_AIR) then
|
if (Type == E_BLOCK_AIR) then
|
||||||
Player:SendMessage(cChatColor.LightGray .. "Block {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}: air:" .. Meta);
|
Player:SendMessage(cChatColor.LightGray .. "Block {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}: air:" .. Meta);
|
||||||
else
|
else
|
||||||
@ -53,8 +57,8 @@ function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
|||||||
local X = BlockX;
|
local X = BlockX;
|
||||||
local Y = BlockY;
|
local Y = BlockY;
|
||||||
local Z = BlockZ;
|
local Z = BlockZ;
|
||||||
X, Y, Z = AddDirection(BlockX, BlockY, BlockZ, BlockFace);
|
X, Y, Z = AddFaceDirection(BlockX, BlockY, BlockZ, BlockFace);
|
||||||
Type, Meta = Player:GetWorld():GetBlockTypeMeta(X, Y, Z, Type, Meta);
|
Valid, Type, Meta = Player:GetWorld():GetBlockTypeMeta(X, Y, Z, Type, Meta);
|
||||||
if (Type == E_BLOCK_AIR) then
|
if (Type == E_BLOCK_AIR) then
|
||||||
Player:SendMessage(cChatColor.LightGray .. "Block {" .. X .. ", " .. Y .. ", " .. Z .. "}: air:" .. Meta);
|
Player:SendMessage(cChatColor.LightGray .. "Block {" .. X .. ", " .. Y .. ", " .. Z .. "}: air:" .. Meta);
|
||||||
else
|
else
|
||||||
|
@ -25,7 +25,7 @@ function Initialize(Plugin)
|
|||||||
Plugin:SetVersion(1);
|
Plugin:SetVersion(1);
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager();
|
PluginManager = cRoot:Get():GetPluginManager();
|
||||||
PluginManager:AddHook(Plugin, cPluginManager.HOOK_BLOCK_PLACE);
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_ITEM);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ)
|
||||||
|
|
||||||
-- Don't check if the direction is in the air
|
-- Don't check if the direction is in the air
|
||||||
if (BlockFace == -1) then
|
if (BlockFace == -1) then
|
||||||
|
333
MCServer/Plugins/HookNotify/HookNotify.lua
Normal file
333
MCServer/Plugins/HookNotify/HookNotify.lua
Normal file
@ -0,0 +1,333 @@
|
|||||||
|
|
||||||
|
-- Global variables
|
||||||
|
PLUGIN = {} -- Reference to own plugin object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Initialize(Plugin)
|
||||||
|
PLUGIN = Plugin
|
||||||
|
|
||||||
|
Plugin:SetName("HookNotify")
|
||||||
|
Plugin:SetVersion(1)
|
||||||
|
|
||||||
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_COLLECT_PICKUP);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CRAFTING_NO_RECIPE);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_DISCONNECT);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_HANDSHAKE);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLED);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_LOGIN);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_BREAKING_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_BROKEN_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_EATING);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_LEFT_CLICK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVED);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACED_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACING_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_RIGHTCLICK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_SHOOTING);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_SPAWNED);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_TOSSING_ITEM);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_ITEM);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_BLOCK);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_ITEM);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_POST_CRAFTING);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PRE_CRAFTING);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_UPDATED_SIGN);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_UPDATING_SIGN);
|
||||||
|
PluginManager:AddHook(Plugin, cPluginManager.HOOK_WEATHER_CHANGED);
|
||||||
|
|
||||||
|
LOGINFO("HookNotify plugin is installed, beware, the log output may be quite large!");
|
||||||
|
LOGINFO("You want this plugin enabled only when developing another plugin, not for regular gameplay.");
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function LogHook(FnName, ...)
|
||||||
|
LOG(FnName .. "(");
|
||||||
|
for i, v in ipairs(arg) do
|
||||||
|
local vt = tostring(v);
|
||||||
|
local TypeString = type(v);
|
||||||
|
if (type(v) == "userdata") then
|
||||||
|
TypeString = tolua.type(v);
|
||||||
|
end;
|
||||||
|
LOG(" " .. tostring(i) .. ": " .. TypeString .. ": " .. tostring(v));
|
||||||
|
end
|
||||||
|
LOG(")");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnChat(...)
|
||||||
|
LogHook("OnChat", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnChunkGenerated(...)
|
||||||
|
LogHook("OnChunkGenerated", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnChunkGenerating(...)
|
||||||
|
LogHook("OnChunkGenerating", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerUsingItem(...)
|
||||||
|
LogHook("OnPlayerUsingItem", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnCollectPickup(...)
|
||||||
|
LogHook("OnCollectPickup", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnCraftingNoRecipe(...)
|
||||||
|
LogHook("OnCraftingNoRecipe", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnDisconnect(...)
|
||||||
|
LogHook("OnDisconnect", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnHandshake(...)
|
||||||
|
LogHook("OnHandshake", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnKilled(...)
|
||||||
|
LogHook("OnKilled", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnLogin(...)
|
||||||
|
LogHook("OnLogin", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerBreakingBlock(...)
|
||||||
|
LogHook("OnPlayerBreakingBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerBrokenBlock(...)
|
||||||
|
LogHook("OnPlayerBrokenBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerEating(...)
|
||||||
|
LogHook("OnPlayerEating", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerJoined(...)
|
||||||
|
LogHook("OnPlayerJoined", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerLeftClick(...)
|
||||||
|
LogHook("OnPlayerLeftClick", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerMoved(...)
|
||||||
|
LogHook("OnPlayerMoved", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerPlacedBlock(...)
|
||||||
|
LogHook("OnPlayerPlacedBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerPlacingBlock(...)
|
||||||
|
LogHook("OnPlayerPlacingBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerRightClick(...)
|
||||||
|
LogHook("OnPlayerRightClick", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerShooting(...)
|
||||||
|
LogHook("OnPlayerShooting", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerSpawned(...)
|
||||||
|
LogHook("OnPlayerSpawned", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerTossingItem(...)
|
||||||
|
LogHook("OnPlayerTossingItem", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerUsedBlock(...)
|
||||||
|
LogHook("OnPlayerUsedBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerUsedItem(...)
|
||||||
|
LogHook("OnPlayerUsedItem", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerUsingBlock(...)
|
||||||
|
LogHook("OnPlayerUsingBlock", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPlayerUsingItem(...)
|
||||||
|
LogHook("OnPlayerUsingItem", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPostCrafting(...)
|
||||||
|
LogHook("OnPostCrafting", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnPreCrafting(...)
|
||||||
|
LogHook("OnPreCrafting", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnUpdatedSign(...)
|
||||||
|
LogHook("OnUpdatedSign", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnUpdatingSign(...)
|
||||||
|
LogHook("OnUpdatingSign", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function OnWeatherChanged(...)
|
||||||
|
LogHook("OnWeatherChanged", unpack(arg));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
-- Special handling for OnTakeDamage to print the contents of TDI:
|
||||||
|
|
||||||
|
function OnTakeDamage(Receiver, TDI)
|
||||||
|
-- Receiver is cPawn
|
||||||
|
-- TDI is TakeDamageInfo
|
||||||
|
|
||||||
|
LOG("OnTakeDamage(): " .. Receiver:GetClass() .. " was dealt RawDamage " .. TDI.RawDamage .. ", FinalDamage " .. TDI.FinalDamage .. " (that is, " .. (TDI.RawDamage - TDI.FinalDamage) .. " HPs covered by armor)");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
|||||||
Port=25565
|
Port=25565
|
||||||
MaxPlayers=100
|
MaxPlayers=100
|
||||||
Description=MCServer - in C++
|
Description=MCServer - in C++
|
||||||
|
DefaultViewDistance=9
|
||||||
|
|
||||||
[Worlds]
|
[Worlds]
|
||||||
DefaultWorld=world
|
DefaultWorld=world
|
||||||
@ -15,6 +16,10 @@ DefaultWorld=world
|
|||||||
; Plugin=DiamondMover
|
; Plugin=DiamondMover
|
||||||
Plugin=Core
|
Plugin=Core
|
||||||
Plugin=ChunkWorx
|
Plugin=ChunkWorx
|
||||||
|
Plugin=Debuggers
|
||||||
|
Plugin=HookNotify
|
||||||
|
Plugin=ChatLog
|
||||||
|
Plugin=DiamondMover
|
||||||
|
|
||||||
[HelpPlugin]
|
[HelpPlugin]
|
||||||
ShowPluginNames=1
|
ShowPluginNames=1
|
||||||
|
@ -699,14 +699,6 @@
|
|||||||
RelativePath="..\source\WebAdmin.h"
|
RelativePath="..\source\WebAdmin.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\source\WebPlugin.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\source\WebPlugin.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\source\World.cpp"
|
RelativePath="..\source\World.cpp"
|
||||||
>
|
>
|
||||||
@ -1551,6 +1543,14 @@
|
|||||||
RelativePath="..\source\tolua_base.h"
|
RelativePath="..\source\tolua_base.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\source\WebPlugin.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\source\WebPlugin.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Squirrel"
|
Name="Squirrel"
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user