1
0
Commit Graph

656 Commits

Author SHA1 Message Date
madmaxoft
9cebc9157c Rewritten Lua ChunkStay API into a single function, cWorld:ChunkStay().
This fixes problems with indeterminate class object lifespan (Lua-GC) and forgetting to disable it or keep it until ready.
2014-02-10 22:47:10 +01:00
madmaxoft
589a4839df cLuaState: Stack traces don't include ghost 0-th element. 2014-02-10 22:44:56 +01:00
madmaxoft
5aa1123f70 Added cPluginLua::cOperation.
This class should be used to lock-and-access the plugin's LuaState. cPluginLua::GetLuaState() is unsafe and by this commit obsolete.
2014-02-10 20:38:02 +01:00
madmaxoft
47a497fa89 First working version of cLuaChunkStay.
It works, but has random failures, probably due to threading issues.
2014-02-09 20:39:45 +01:00
madmaxoft
9455f59b11 Initial Lua cChunkStay export. 2014-02-09 18:56:16 +01:00
madmaxoft
310a25c456 cLuaState::cRef can be unbound and re-bound.
This will allow us to store Lua references as member variables in classes and initialize those later than in the constructor.
2014-02-09 18:39:22 +01:00
Tiger Wang
9d1c9097e3 Merge remote-tracking branch 'origin/master' into playerimprovements
Conflicts:
	src/Root.cpp
	src/Root.h
	src/World.cpp
2014-02-09 00:14:42 +00:00
Tiger Wang
f86f066615 Merge branch 'master' into playerimprovements
Conflicts:
	MCServer/Plugins/APIDump/APIDesc.lua
2014-02-09 00:04:42 +00:00
madmaxoft
cfd6875c86 Fixed cWorld:TryGetHeight() API. 2014-02-08 13:35:08 +01:00
Tiger Wang
aa8b46e947 Server internally uses new functions 2014-02-05 23:24:16 +00:00
madmaxoft
e5dce265ae Added cPluginManager:LogStackTrace() to the Lua API.
Fixes #637.
2014-02-05 00:16:33 +01:00
madmaxoft
82173db9bf Fixed a gcc warning in ManualBindings.
Constructor member order...
2014-02-04 22:26:35 +01:00
madmaxoft
010e64be11 Removed a useless check in cLuaState. 2014-02-04 22:24:03 +01:00
madmaxoft
3dc1452790 Fixed calling plugins with userdata params. 2014-02-04 14:26:36 +01:00
madmaxoft
1dbfd7eb76 Removed a leftover debug message. 2014-02-04 11:37:34 +01:00
madmaxoft
69c85e5169 Fixed error handling in cPluginManager:CallPlugin() API.
Fixed: When the called function malfunctioned, the entire plugin's call was aborted.
2014-02-04 10:29:10 +01:00
madmaxoft
aa19f4fd04 Improved error resistance in cPluginManager:CallPlugin().
Fixed: If the call failed, all the next plugin calls would fail as well.
2014-02-04 09:18:32 +01:00
Mattes D
33759197e9 Merge pull request #585 from daniel0916/hooks
Added "player destroying" and "player destroyed" hooks
2014-02-01 05:08:08 -08:00
daniel0916
dbbd47b96d Removed "player destroying" hook 2014-02-01 13:27:44 +01:00
madmaxoft
882d108622 Fixed cLineBlockTracer:Trace() signature. 2014-01-31 16:01:16 +01:00
madmaxoft
5092ae5266 Added cPluginManager:BindCommand() form to the API.
That's the canonical way to call static functions.
2014-01-31 16:01:15 +01:00
madmaxoft
b61a74d6a2 Lua: Fixed an error in table-functions callbacks. 2014-01-29 22:56:38 +01:00
madmaxoft
e40c5a20c8 Plugin files are loaded in alphabetical order.
Except for the Info.lua file which gets loaded always last. Implements #597.
2014-01-29 17:48:04 +01:00
Mattes D
09ee8a1bb6 Merge pull request #589 from mc-server/minecartimprovements
Minecart improvements
2014-01-26 05:13:54 -08:00
Tiger Wang
52f7467fe1 Reduced unnecessary echoes (thanks xoft) 2014-01-25 23:48:48 +00:00
Mattes D
f78a62a5e3 Merge pull request #575 from worktycho/GeneratingBenchmark
More Interfaces to decouple Generator from the rest of the code
2014-01-25 13:55:33 -08:00
Tiger Wang
1d0e1bdcb1 Improved AllToLua UI experience 2014-01-25 19:36:20 +00:00
Tycho
2a18feb015 Stupid Mistake fixed 2014-01-25 10:13:54 -08:00
Tycho
2806b48afa Fixed exports 2014-01-25 06:06:30 -08:00
daniel0916
bac750b24e Added "player destroying" and "player destroyed" hooks
Hooks:
HOOK_PLAYER_DESTROYING
HOOK_PLAYER_DESTROYED

Idea from: https://github.com/mc-server/MCServer/issues/473
2014-01-25 11:25:22 +01:00
Tycho
27d1d5d491 Bugfixes 2014-01-23 11:00:36 -08:00
Tycho
e0956be0a7 added dependecies for bindings regen 2014-01-23 10:41:08 -08:00
madmaxoft
435eae3858 Fixed crash while calling disabled plugins. 2014-01-23 16:14:00 +01:00
Tycho
5ef0a00a6c Fixed spelling error 2014-01-22 10:39:09 -08:00
Tycho
571200019d Added manual bindings for moved functions 2014-01-22 10:35:36 -08:00
madmaxoft
2a018cfa49 Implemented cPluginManager:CallPlugin() API.
This function supersedes cPlugin:Call(), is safer to use in regards to multithreading and once again removes the need for the cPlugin class being exported at all.
2014-01-21 23:00:35 +01:00
madmaxoft
41618bf242 Changed the cWorld::ScheduleTask() signature.
Now it takes the delay in ticks as an argument, and a cTask descendant as the task to run. Lua API has been updated similarly.
2014-01-19 23:49:19 +01:00
madmaxoft
4a01879911 cLuaState can now check function params. 2014-01-19 23:45:26 +01:00
STRWarrior
24df625fbd Exported cFloater to the Lua API. 2014-01-19 00:04:46 +01:00
andrew
1ad6469a18 Command blocks: Execute() 2014-01-18 16:59:33 +02:00
madmaxoft
c44ce84497 Fixed whitespace in previous commit. 2014-01-16 20:30:25 +01:00
madmaxoft
343136a2ae Finished exporting cWorld:ScheduleTask() to Lua API. 2014-01-16 19:56:08 +01:00
Mattes D
eb89de4c88 Merge pull request #542 from worktycho/schedular
added cWorld::ScheduleTask Function
2014-01-15 02:45:25 -08:00
Mattes D
457e93f1ed Merge pull request #538 from mc-server/minecarts
Minecarts
2014-01-15 02:42:24 -08:00
Tycho
292ccdc09e added cWorld::ScheduleTask Function
ScheduleTask schedules a SceduledTask object to be run x ticks in the future.
In is exported to lua, fixes #150
2014-01-14 12:17:03 -08:00
madmaxoft
7e59296157 Generating the bindings outputs a message at the end. 2014-01-13 19:57:19 +01:00
madmaxoft
332c1c59eb cCreeper is no longer available in API.
Has been replaced by cMonster.
2014-01-13 17:25:16 +01:00
Tiger Wang
e114008559 Fixed settings plugin generation after IniFile 2014-01-12 14:03:50 +00:00
madmaxoft
328b2db252 Disabled a useless MSVC warning in Bindings.cpp. 2014-01-12 08:43:13 +01:00
Mattes D
751c53ecc6 Merge pull request #532 from mc-server/LuaStateErrorHandler
Lua state error handler
2014-01-11 23:33:29 -08:00
madmaxoft
023ba17688 Lua errors display stack trace.
Fixes #418.
2014-01-11 23:10:40 +01:00
madmaxoft
b2b7e45757 Removed internal methods from public cLuaState interface.
PushFunction(), CallFunction() and GetReturn() are not to be called independently, but rather only by using the Call() templated overrides.
Push() needs to be left in the public part, it is used for pushing results in the ManualBindings.

Preparation for #418.
2014-01-11 22:51:10 +01:00
madmaxoft
acfebab027 Removed an unused file. 2014-01-11 21:22:40 +01:00
Mattes D
498fb5b675 Merge pull request #527 from derouinw/biomessplit
Biomessplit
2014-01-11 12:20:41 -08:00
madmaxoft
2634261a28 Removed unused variables.
The Lua API calls had no side-effects, either.
2014-01-11 20:29:56 +01:00
Bill Derouin
cee76f1ace Move biome definition to separate files 2014-01-09 15:21:46 -06:00
madmaxoft
bb96737f45 Exported cClientHandle::SendPluginMessage() to Lua. 2014-01-09 14:25:37 +01:00
Bill Derouin
154d6b989a A couple touchups 2014-01-08 13:45:16 -06:00
Bill Derouin
e0d94e0f06 Add missing plugin error
Previously, if a plugin was included but the folder had no lua files,
the error given was ambiguous. Now, it explicitly describes lack of lua
files.

See issue #512

P.S. This probably isn't the best way, but this is where the fix can be
made.
2014-01-07 13:47:15 -06:00
madmaxoft
e353f29d4a Plugin messages are received and handed to plugins.
Note that MCS doesn't currently handle any channel registrations, this will come later on.
2014-01-07 17:47:20 +01:00
madmaxoft
8b9b09bf60 Removed a debugging log output in cPluginManager:AddHook(). 2014-01-07 17:07:49 +01:00
madmaxoft
bcd41dc1aa LuaState can push strings with embedded NULs.
This also marginally improves performance, since a strlen() isn't called (inside lua_pushstring()), the string length is stored in the AString object directly.
2014-01-07 17:07:48 +01:00
madmaxoft
84bf32f857 Fixed cPluginManager:AddHook() binding.
Fixes #401. Old formats are still accepted, for compatibility reasons.
2014-01-05 15:46:45 +01:00
Mattes D
d3dc12815b Merge pull request #479 from mc-server/cmake-win
Cmake-win
2014-01-02 09:16:11 -08:00
STRWarrior
db00a36ff8 OnPlayerFishing doesn't have a const cItems anymore 2014-01-01 15:09:53 +01:00
STRWarrior
020a8b457d implemented the recommendations Xoft gave. 2013-12-31 14:53:10 +01:00
STRWarrior
cd435ffca9 Implented OnPlayerFishing and OnPlayerFished. 2013-12-30 22:56:08 +01:00
madmaxoft
a1211bcdff Added support for out-of-source builds. 2013-12-28 14:42:11 +01:00
madmaxoft
1cf6502be2 Made cmake compilation possible on Windows. 2013-12-27 11:51:08 +01:00
madmaxoft
5bbe72bc90 Replaced esCreeper with esMonster.
Any monster will be able to explode, and also this fixes #425.
2013-12-23 22:36:22 +01:00
Tycho Bickerstaff
d724241407 converted commneted paramater names to the unused macro 2013-12-22 13:46:55 +00:00
Tycho Bickerstaff
94ca07cfbf Merge branch 'master' of github.com:mc-server/MCServer 2013-12-22 13:19:27 +00:00
madmaxoft
248ba1ea9f Added HOOK_PLUGINS_LOADED.
This fixes #482.
2013-12-29 12:51:58 +01:00
madmaxoft
abd1ca4fef Bindings regen script updated.
The Bindings.cpp / .h files are no longer stored in the git repo.
2013-12-21 19:30:16 +01:00
Tycho Bickerstaff
9f41761e8e Root is now warnings clean 2013-12-21 15:38:37 +00:00
tycho
f6d5a788aa fixed include of math on windows 2013-12-20 15:37:35 +00:00
Tycho Bickerstaff
e2549dfcb2 added expat as lua bindings dependincy 2013-12-19 00:52:52 +00:00
Tycho Bickerstaff
afa259e530 added all cpp files to bindings 2013-12-19 00:24:47 +00:00
Tycho Bickerstaff
cdca5a3eac Merge branch 'master' into cmake 2013-12-19 00:00:14 +00:00
Tycho Bickerstaff
7dd1561a88 fixed bindings generation 2013-12-18 23:59:07 +00:00
Tycho Bickerstaff
0dbd55614b bindings regenration logic 2013-12-18 23:14:11 +00:00
Tiger Wang
b4ac4a14fa Prettified command error messages
Using the magic of overlords (overloads) and standards compliance.
2013-12-18 22:05:41 +00:00
Tycho Bickerstaff
e627f2f98c Merge branch 'master' into cmake 2013-12-18 19:06:11 +00:00
Tiger Wang
db5d7963e2 Renamed back EntityAnimation to PlayerAnimation
This fixes #411 and partially reverts
30ead79049
2013-12-18 16:11:15 +00:00
madmaxoft
daade8ddee Fixed multiple inheritance in ToLua++.
This fixes #422.
2013-12-16 22:13:46 +01:00
STRWarrior
a2612fa68a Exported to Lua 2013-12-15 20:25:53 +01:00
STRWarrior
0efd74f114 This adds a function that allows you to 'shoot' a player towards a direction. 2013-12-15 18:54:54 +01:00
STRWarrior
9fe06af598 Exported Set and Get functions to Lua. 2013-12-15 14:52:17 +01:00
Mattes D
5e6a4c99a7 Merge pull request #431 from mc-server/Entity_Effects
Entity Effects
2013-12-14 14:40:24 -08:00
madmaxoft
812ea39a5c Added tolua++ redirection include.
This is needed because ToLua++ regenerates the Bindings file with bad #include, and it would be too difficult to fix ToLua++; this is an easier solution.
Should fix PR #431.
2013-12-14 23:34:57 +01:00
STRWarrior
8c04afe18a Exported E_EFFECTS_<Effect> to lua. Forgot to commit Globals.h. 2013-12-14 22:34:49 +01:00
Mattes D
22ee94ffaf Merge pull request #430 from mc-server/redstoneimprovements
Implemented note block playing and fixed wire
2013-12-14 13:00:30 -08:00
Tiger Wang
95be80cdb5 Implemented note block playing and fixed wire
Game of Thrones music in Minecraft, here I come!
2013-12-14 16:52:22 +00:00
STRWarrior
78aca16d58 Exported the cTNTEntity 2013-12-14 16:28:17 +01:00
STRWarrior
12bd5082b8 Added a HOOK_WORLD_STARTED hook and a cRoot::CreateAndInitializeWorld function for plugins. 2013-12-11 12:39:13 +01:00
Tycho Bickerstaff
dd633d5a94 Merge branch 'master' into cmake 2013-12-10 23:01:35 +00:00
Tycho Bickerstaff
712f7d5a23 added tolua++ command and removed stackwalker from build 2013-12-10 22:59:53 +00:00
Tycho Bickerstaff
daccfd9c6e more cmake changes 2013-12-10 22:43:21 +00:00
Tycho Bickerstaff
6cdc990884 more cmake 2013-12-10 21:39:20 +00:00
Tycho Bickerstaff
b91cfb8765 started work on cmake 2013-12-10 18:41:43 +00:00
worktycho
604c8fd9b9 Fix Undefined behavior at Bindings/LuaWindow line 32 2013-12-09 14:17:39 +00:00
madmaxoft
4608beb3c6 Fixed tolua++ compilation.
Duplicate files, wrong includes, const-incorrect code...
2013-12-08 18:24:56 +01:00
madmaxoft
fd68095acc Fixed VS2008 compilation after those huge changes. 2013-12-08 18:13:30 +01:00
Tiger Wang
1d554677b4 Merge branch 'master' of https://github.com/mc-server/MCServer into fixesnfeatures
Conflicts:
	src/Bindings/Bindings.cpp
	src/Bindings/Bindings.h
	src/Blocks/BlockHandler.cpp
2013-12-08 14:02:45 +00:00
madmaxoft
6785bb7c16 Fixed normalizing large angles. 2013-12-08 13:08:56 +01:00
madmaxoft
044fd237b6 Moved bindings-related to a Bindings subfolder.
Ref.: #407
2013-12-08 12:17:54 +01:00