summaryrefslogtreecommitdiffstats
path: root/source/PluginLua.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-11-24Moved source to srcAlexander Harkness1-202/+0
2013-10-12Fix: Wrong arg nameSamuel Barney1-1/+1
2013-10-12Fixed and exported cWorld:QueueTask().madmaxoft1-0/+37
This implements #220.
2013-08-22Fixed AddHook() wanting old-style function names.madmaxoft1-1/+2
Error reported by STR_Warrior in the forum http://forum.mc-server.org/showthread.php?tid=1227&pid=9620#pid9620
2013-08-21Hook adding uses the new API.madmaxoft1-7/+24
Multiple hooks per plugin can be added. The cPluginManager.AddHook() has four available signatures, the recommended one is cPluginManager.AddHook(HOOK_TYPE, CallbackFunction)
2013-08-19Finished renaming cPlugin_NewLua to cPluginLua.madmaxoft1-3/+3
2013-08-19Implemented the OnWorldTick hook.madmaxoft1-0/+1
Triggerred for each world every time it ticks, parameters are the cWorld and the previous tick length (a_Dt)
2013-08-11Added the OnHopperPullingItem and OnHopperPushingItem hooks.madmaxoft1-0/+2
Requested in FS 412, slightly modified the params.
2013-08-11Added OnPlayerAnimation() hook.madmaxoft1-0/+1
Initial patch by @STR_Warrior, updated to account for different animation packets.
2013-08-10Renamed Plugin_NewLua to PluginLua.madmaxoft1-0/+8
2013-08-09Renamed Plugin_NewLua to PluginLua.madmaxoft1-135/+0
2013-08-09Added OnExploding() and OnExploded() hooks.madmaxoft1-0/+2
As requested in FS 413, with extra parameters: World, BlockX, BlockY, BlockZ, Size, CanCauseFire, Source, SourceData OnExploding() can return 3 values: StopHook, CanCauseFire, ExplosionSize
2013-08-08Addeed OnSpawningEntity, OnSpawnedEntity, OnSpawningMonster, OnSpawnedMonster hooks.madmaxoft1-0/+4
As requested in FS 418.
2013-08-04LuaState refactoring: initial part.madmaxoft1-8/+3
The cLuaState class is a wrapper for the lua_State * and for the common functions on it. The cPlugin_NewLua has been rewritten to use it instead of the raw pointer. Part of #33
2013-08-02Implemented OnPlayerRightClickingEntity() hookmadmaxoft1-37/+38
Fixes FS 425
2013-07-29WebAdmin templates can use LuaFakeTruth1-2/+2
New WebAdmin templates can use Lua to completely compose the pages themselves. This should allow infinite WebAdmin design possibilities.
2013-07-01Rewritten entity-on-fire management ("forever on fire" bugs)madmaxoft@gmail.com1-2/+2
Fixes FS #297 and part of FS #403. Added sizes to all entities. Moved all damage-related functions from cPawn to cEntity API change: renamed cPawn:TeleportTo() to cEntity:TeleportToCoords() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1635 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-29Advanced RCON: Command output is sent to the RCON client.madmaxoft@gmail.com1-1/+1
RCON authentication is now required before executing commands. Console command handlers now return two values, bool (IsHandled) and string (CommandOutput). API change: removed cRoot:ExecuteConsoleCommand(), added cRoot:QueueExecuteConsoleCommand(). API change: removed cPluginManager:ExecuteConsoleCommand(), use cRoot:QueueExecuteConsoleCommand() instead git-svn-id: http://mc-server.googlecode.com/svn/trunk@1631 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-22Plugins can modify message in the OnChat() hook handler.madmaxoft@gmail.com1-1/+1
FS #376 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1622 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-02LuaWindow: Fixed memory leaks with unclosed windowsmadmaxoft@gmail.com1-1/+1
A player disconnecting will now force all windows to close, not respecting any plugin's overrides. http://forum.mc-server.org/showthread.php?tid=1146&pid=8350#pid8350 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1543 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-31Added cLuaWindow:SetOnSlotChanged(); the callback is called only for non-inventory slotsmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1535 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-30Added the OnClosing callback to cLuaWindow APImadmaxoft@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1534 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-30LuaWindow: Initial code, the window can be opened, but not much manipulatedmadmaxoft@gmail.com1-2/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1532 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-21Added HOOK_EXECUTE_COMMAND for intercepting executed commands and console commands.madmaxoft@gmail.com1-0/+1
Note that built-in console commands are exempt to this hook - they are always performed and the hook is not called. Also note that, for reasons unknown, the HookNotify plugin doesn't list the callback arguments. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1221 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-15Plugins can now bind console commandsmadmaxoft@gmail.com1-0/+8
FS #300 Most console commands are now implemented in the Core plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1214 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-13Added HOOK_WEATHER_CHANGING.madmaxoft@gmail.com1-1/+2
http://www.mc-server.org/support/index.php?do=details&task_id=299 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1210 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-05Added new hooks: OnChunkAvailable(), OnChunkUnloaded() and OnChunkUnloading(). Modified OnChunkGenerated() signature.madmaxoft@gmail.com1-2/+5
http://forum.mc-server.org/showthread.php?tid=464&pid=6312#pid6312 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1193 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-01Moved command API into cPluginManager.madmaxoft@gmail.com1-4/+18
As specified in http://forum.mc-server.org/showthread.php?tid=765 , commands are now bound using a single function, cPluginManager:BindCommand(). git-svn-id: http://mc-server.googlecode.com/svn/trunk@1183 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-28Renamed HOOK_KILLED to HOOK_KILLING to match naming conventions.madmaxoft@gmail.com1-1/+1
Also tweaked the mechanics so that plugins may revive without dropping other plugins out of the picture. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1182 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-28Renamed HOOK_COLLECT_PICKUP to HOOK_COLLECTING_PICKUP to match other hooks' naming.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1180 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-27Added the HOOK_BLOCK_TO_PICKUPS hook that fires when a block is dug up and should be converted to pickups.madmaxoft@gmail.com1-1/+1
Note that cItems is used in the function signature but not yet exported in the API, TODO! git-svn-id: http://mc-server.googlecode.com/svn/trunk@1176 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-25Merged the usable portion of the "gens" branch.madmaxoft@gmail.com1-1/+1
Splitting off the Composable generator and fiddling with LuaChunk / ChunkDesc is good, other generators not good yet. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1171 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-33/+51
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Refactored the TakeDamage API to take equipped weapon and armor into consideration (PvP untested)madmaxoft@gmail.com1-4/+9
http://forum.mc-server.org/showthread.php?tid=625 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1087 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-11Cleanup: Removed deprecated functions from Lua APImadmaxoft@gmail.com1-2/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1033 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-14Completely removed support for old style Lua plugins (can use both Plugin and NewPlugin in settings.ini for now)faketruth1-5/+1
Removed cPlugin_Lua, obviously cPluginManager stores plugins by their (folder)name cPluginManager now scans the Plugins folder for potential plugins and adds them as non-loaded plugins Added a DisablePlugin and LoadPlugin to disable and load plugins on a per-plugin basis instead of all at once cPluginManager::FindPlugins refreshes the plugin list by removing non-existing plugins and adding new plugins Made it incredibly easy to use new plugins from the WebAdmin Exposed some food/hunger related functions in cPlayer to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@959 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-08Added cPlugin_NewLua::GetLocalDirectory() and exported it to Lua so plugins can store their settings in their own folder.faketruth1-0/+1
Core now stores banned players and whitelist data in its own directory git-svn-id: http://mc-server.googlecode.com/svn/trunk@850 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-05Added the possibility of reserved player slots by implementing the HandleHandshake hook!faketruth1-5/+6
More info: http://forum.mc-server.org/showthread.php?tid=555 git-svn-id: http://mc-server.googlecode.com/svn/trunk@836 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-01Added a Player parameter to OnUpdatedSign and OnUpdatingSign Lua callbacks and to the cWorld:UpdateSign method (http://forum.mc-server.org/showthread.php?tid=464&pid=4393#pid4393)madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@814 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24cPickup doesn't use cPackets.madmaxoft@gmail.com1-1/+1
Also, Lua API change, OnCollectItem -> OnCollectPickup; first param is cPlayer to match other callbacks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@786 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Added plugin name to deprecation messagesmadmaxoft@gmail.com1-4/+9
Removed duplicate inheritance of m_Name in cPlugin_NewLua by making cWebPlugin interface-only git-svn-id: http://mc-server.googlecode.com/svn/trunk@782 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Added a documentation for block and item handlerslapayo94@gmail.com1-1/+0
Probably fixed dependencies on cWebPlugin_Lua Fixed VC2010 Project file git-svn-id: http://mc-server.googlecode.com/svn/trunk@778 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22WebAdmin should not cause crashes anymorefaketruth1-5/+10
Got rid of cWebPlugin_Lua cPlugin_Lua is also a cWebPlugin now, so plugins don't need a separate cWebPlugin object Changed some stuff to use AString instead of char* git-svn-id: http://mc-server.googlecode.com/svn/trunk@777 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Fixed cWebPlugin_Lua being not thread safe. And I don't know why, but it still crashes in Lua sometimes o_Ofaketruth1-0/+2
WebAdmin chat now supports infinite number of chat messages (only client side). The client requests only NEW chat messages from the server. git-svn-id: http://mc-server.googlecode.com/svn/trunk@776 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Chat packet handled in the new way; fixed missing packet sending for inventory slot.madmaxoft@gmail.com1-13/+13
Again, API change! cPlugin:OnChat() has had its parameters swapped, to match all the other callbacks - Player first, Message second git-svn-id: http://mc-server.googlecode.com/svn/trunk@751 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Packet refactoring, phase two, partial. Rewritten a few packet handling functions not to use cPacket-descendant objects.madmaxoft@gmail.com1-3/+3
This breaks plugin API! Plugins need to modify their hook functions to match those used in the Core plugin git-svn-id: http://mc-server.googlecode.com/svn/trunk@750 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Added new hooks: UPDATING_SIGN and UPDATED_SIGN. The first one is capable of changing the sign text by returning the new four lines along with the bool valuemadmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@622 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Renamed HOOK_WEATHER_CHANGE to HOOK_WEATHER_CHANGED, added the glue code for it to actually workmadmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@610 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Added a world parameter to HOOK_CHUNK_GENERATING.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@609 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-59/+59
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-13Added a BlockToPickup hook for modifying pickups when a player breaks a block.madmaxoft@gmail.com1-15/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@602 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-12Added working crafting hooks HOOK_PRE_CRAFTING, HOOK_CRAFTING_NO_RECIPE and HOOK_POST_CRAFTINGmadmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@598 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-11Added implementation of E_PLUGIN_CHUNK_GENERATING lua hookfaketruth1-0/+1
It crashes the server when a plugin actually overrides default behavior though... git-svn-id: http://mc-server.googlecode.com/svn/trunk@594 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-05New hook, E_PLUGIN_CHUNK_GENERATED, called after each chunk is generated (the chunk is already present in cWorld)madmaxoft@gmail.com1-13/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@558 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-2/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-22Added a CriticalSection to cPlugin_NewLua. Lua plugins are not threadsafe but they ARE accessed by multiple threads, this can create some hard to find errors, but I fixed it now :Pfaketruth1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@311 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Added all current hooks to the new plugin structure.faketruth1-7/+19
Converted MagicCarpet to the new plugin structure When you fall of the MagicCarpet you teleport back up :D git-svn-id: http://mc-server.googlecode.com/svn/trunk@220 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-28Converted entire Core plugin including WebAdmin interface to new plugin method/system/thingy and sexyfied it.faketruth1-0/+8
Made some changes to WebAdmin to make the new plugins work Old plugins still work like they're supposed to Not all hooks have been programmed for the new plugins yet, this still needs to be done git-svn-id: http://mc-server.googlecode.com/svn/trunk@182 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-27Converted all of the Core plugin to the new plugin structure, except for the WebAdmin partfaketruth1-5/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@175 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-26Working on a new plugin design with Lua. While retaining backwards compatibility of course...faketruth1-0/+20
In this new design a plugin consists of a folder with Lua files, this should enable plugin developers to keep things separate and have more overview. git-svn-id: http://mc-server.googlecode.com/svn/trunk@172 0a769ca7-a7f5-676a-18bf-c427514a06d6