Commit Graph

96 Commits

Author SHA1 Message Date
Kargatum
ce3cbd4482 Platform: added new platform define for AC 2019-11-11 01:58:12 +07:00
Rochet2
8697e932ae Fix mangos two build 2018-10-18 20:42:44 +03:00
ayase
9b5499db9c AZEROTHCORE compatibility (#271)
* Done Compatible AZEROTHCORE.

* Fix TC build

* Try fix whitespace (trailing and tabs2spaces)

* Remove undefs and TC_LOG defines

* Revert indentation change

* Indentation and style change

* Add more possible SQL types to query

* change bg hooks OnBGEnd parameter type.
2018-06-06 18:42:46 +03:00
Rochet2
00ba8e518c Fix inefficient InvalidateObjects 2018-04-25 21:54:18 +03:00
Rochet2
8ecd5c6254 Try fix crash - upon reload you must respawn creatures to make AI apply 2017-09-28 23:50:42 +03:00
Rochet2
0f4f2c35db Disable calling require with file extension for lua_scripts folder 2017-08-03 17:13:04 +03:00
Rochet2
481a605c5c Throw lua error instead of assert 2017-07-19 20:25:10 +03:00
Rochet2
9939cb3834 Fix TC build 2017-05-29 20:59:04 +03:00
Rochet2
b7c379a42c Change Eluna to a global variable
Remove Eluna* from being passed. You can now get it through Eluna::GetEluna(L)
Change function call cleanup to lua_settop instead of manual loop
Explicitly delete the copy constructor and copy assignment operators
2017-03-19 15:48:48 +02:00
Rochet2
924b1baab3 Remove ACE and boost RW mutex requirements 2017-01-23 17:52:45 +02:00
Rochet2
4aba0d6da2 Fix mangos linux build 2016-11-26 22:29:52 +02:00
Rochet2
f0b1b3499b Fix crash when eluna disabled. ~Natrist 2016-10-06 22:36:48 +03:00
Rochet2
0541cebfb1 Fix unix ignore hidden files 2016-09-21 22:48:33 +03:00
Rochet2
d162ae4105 Move objects from global table to internal registery 2016-02-24 23:01:11 +02:00
Rochet2
2fce645b7e new year 2016-01-05 20:19:47 +02:00
Rochet2
972ff3d010 Some performance and warning fixes 2016-01-05 14:57:29 +02:00
Rochet2
77e09b4390 change char print to int print 2015-10-07 21:25:29 +03:00
Rochet2
64a442a887 Fix error message
The error is using hhu and u and other unsupported format characters.
See http://www.lua.org/manual/5.2/manual.html#lua_pushfstring for more
2015-09-29 23:08:10 +03:00
Rochet2
8daaf04994 Fix TC build 2015-09-24 11:48:07 +03:00
Tommy
9d9e72e598 Updated method documentation and cleaned up
Method documentation should be completed. Only thing left now is polishing up (fixing typos, update wording, add enumerator data to method documentation that doesn't have it, etc)..

Cleaned whitespaces

Corrected/Fixed up some comments

Removed all known documented method comments in LuaFunctions.cpp. Commented out methods are now marked as undocumented until they are uncommented & documented in their respective header files.

Removed 'Getter, Setter, Boolean, Other' comments in method files

Documented VehicleMethods, the rest of PlayerMethods, UnitMethods, CreatureMethods and GuildMethods.

Refer to #101 for more information
2015-09-16 04:14:32 -04:00
Rochet2
1bc22faa7f Add some bug and warning fixes as well as some enchantment from mthread branch 2015-08-08 15:37:22 +03:00
Patman64
31470c2cf7 Allow scripting of instances w/ persistent data
Some fixes for TC and changes overall

Pass map object to hook via function arguments

The map object is no longer stored inside the instance data table.

Fix mistake in base64 decoder

It was failing whenever it encountered a '=' character, which is
completely valid.

Make ElunaInstanceAI::Load always load something

When it failed to load data, it was leaving nothing on the stack. Since
subsequent code expected Load to always load something, this was causing
issues.

Now, when Load fails to load anything, it just leaves a new empty table on
the stack.

Also: the error messages for Load have been improved.

Modify lua-marshal to allow saving of functions/userdata.

Some additional code was needed to save functions due to the inclusion of
a reference to _ENV within their upvalues (since Lua 5.2).

During encoding, a placeholder is left where the _ENV reference would be.
During decoding, a reference to the current _G is swapped with the
placeholder.

Make ElunaInstanceAI::Load re-initialize if data failed to load.

Also improve error messages by not including the raw data.

Improve storage format of upvalues

Instead of storing the upvalues by name, store by index. A wrapper is
still used in case the upvalue is nil, to prevent holes in the upvalues table.

A special field in the upvalues table, "E", is used to store the index of
the _ENV reference (if there was one). A reference to the current globals
table is set as the upvalue upon decoding.

Remove wrapping from upvalue storing, instead save amount of upvalues
2015-08-01 00:35:41 +03:00
Patman64
7397c98a61 Merge new_bindings, closes #151
Refer to 6194ddb43c for new C++11 required changes for mangos based cores
2015-06-01 20:37:32 +03:00
Patman64
3490d21bcd Make the register functions optionally return a cancel callback.
It's now possible to have complete flexibility with cancelling bindings,
i.e. it's possible to re-implement all of the other ways to cancel bindings
using the callback.

This sytem has been designed with complete safety in mind:
 - It is safe to call the callback more than once (does nothing after the
   first call).
 - The callback does not expire, and can be stored for as long as
   necessary.
 - If a callback is returned, there is no other way to cancel the binding
   (again, due to safety).
2015-05-01 20:29:48 -04:00
Rochet2
e7019de059 Eluna fix problem with reloading timed events 2015-02-15 02:09:16 +02:00
Rochet2
0701980561 Eluna fix cppcheck warnings and errors 2015-02-13 21:29:02 +02:00
Rochet2
e6e4ecdab1 Fix push and taxi crashes and add new taxi changes 2015-01-24 02:29:11 +02:00
Rochet2
22e2195d00 Fix build 2015-01-20 18:36:35 +02:00
Rochet2
3d645d8048 Add StackTracePlus, Rewrite not to recreate eluna on reload 2015-01-20 17:05:41 +02:00
Patman64
9575a970f3 Move hooks to separate files. 2015-01-19 00:32:52 -05:00
Patman64
dd39592ddd Allow binding event handlers to individual Creatures.
Because GUIDs are, in fact, not globally unique on mangos, the actual
unique identifier is the GUID/instance ID pair of the Creature.

On Trinity Creatures in instances are assigned new GUIDs. This means that
the instance ID part is redundant but must be used anyway for consistency.
2015-01-11 18:48:38 -05:00
Rochet2
5e7b0ee0f7 Fix TC build, analysis warnings and triggering addon message hooks 2015-01-06 12:43:53 +02:00
Patman64
e2f81b7336 Make the Eluna mutex static.
It was previously unsafe to reload Eluna because it had to be reloaded
with the mutex unlocked. This is because the mutex's lifespan was shorter
than the Eluna instance it was guarding.
2015-01-05 22:50:51 -05:00
Rochet2
0e7367e23d Fix hookmgr rewrite
Fix:
 - crash on reload
 - crash on error in call
 - a warning from type change
2015-01-05 16:38:19 +02:00
Patman64
717d1b698d Re-write HookMgr macros into functions and clean-up HookMgr.cpp. 2015-01-04 20:30:31 -05:00
Tommy
803a835668 Happy New Year 2015 2015-01-01 13:59:33 -05:00
Rochet2
07d25f5031 Eluna Fix static analysis noted warnings and errors 2014-12-23 23:21:13 +02:00
Rochet2
dcd0a0e89c Fix linux build and warnings 2014-12-20 18:24:54 +02:00
Rochet2
631e220b31 Eluna changes
* Attempt fix VS 2010 pow error
* Tweak the doc parser a little to work with variable arugments ... and show
enum names and similar.
* Change push and check to work with more types like size and time (fix osx)
* Add errors to using not implemented operations on eluna objects
* Change some SQL comments to work with documentation better
* Add functions to create uint64 and int64 values (may need rename)
* Change doc generation documentation a little to make it clearer how proto is used
2014-12-20 18:24:53 +02:00
Rochet2
809a0ac2bc Fixes #130 2014-12-20 18:15:59 +02:00
Patman64
8c40dd1692 Allow temporary event handlers for all events.
This allows you to register a handler to only fire N times.

Dynamic event handler binding/unbinding is now possible.

For backwards compatibility, if the number of shots is missing, the event
handler will never be removed from the event.
2014-12-18 22:09:34 -05:00
Rochet2
662babc806 Eluna Fix checking of objects with varying types 2014-12-16 01:21:42 +02:00
Rochet2
cb7f9d5145 Eluna add int64 datatype, rename functions for osx, enhance object checking code 2014-12-15 23:29:49 +02:00
Rochet2
7671054425 Eluna fix TC errors from previous commits, fix merge and fix a crash on osx 2014-12-15 23:25:09 +02:00
Rochet2
6268216a64 Eluna implement changes from new_mthread to master ~ Does not add multithread support 2014-11-30 01:37:45 +02:00
Rochet2
a7f4954fbe Eluna implement functions from #121, implement hidden file ignoring closes #122, enhance documentation in places, change requiring some now only allowing unique filenames 2014-11-22 17:16:41 +02:00
Rochet2
93982a16c1 Correct error messages to be clearer 2014-11-10 14:17:52 +02:00
Rochet2
02316cd182 Revert changes to extension from 2343f1b2d6 2014-11-09 23:03:57 +02:00
Rochet2
2343f1b2d6 Eluna fix require path to lua script folder structure. Implement .ext.lua and comment them in the ext files that exist. 2014-11-09 17:16:47 +02:00
Rochet2
d7920b4bb7 Fix loading debug messages to avoid confusion 2014-10-23 14:54:57 +03:00