* Refactor IOMarket Extracted into tfs::IOMarket namespace
All credits to @ramon-bernardo, I just used his PR that had been forcibly closed and created this new PR
* Add trailing newline
---------
Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
* Moved everything to NpcScriptInterface
There was an issue with the Revisioned Npc System.
Because it was included in 2 different lua environments it would not correctly work on any of the cmake builds only the msvc builds worked fine (they somehow have shared lua envs)
Now the npcs should correctly work as it's expected
* Use OpenSSL instead of crypto++
Use OpenSSL for SHA1 hashing and RSA encryption, which is more readily
available in all systems than crypto++
* Replace singleton with namespace, add unit tests for load key and decrypt
* Cleanup includes
* Pass PEM bytes instead of filename
* Use private key included in repo for tests
- Use base Google style
- Drop column limit override
- Format all files
- Use tabs for indentation
- Move system headers after project headers
- Avoid breaking string literals
- Reflow usage text
- Match breaks before braces and colons to previous style
- Reduce spaces before trailing comments
- Reflow comments and fix macro usage in luascript.cpp
- Fix invalid code
- Don't align newline escapes
- Reflow comment to make more sense
* cmake is upgraded and related configs modified
* build using cmake on Windows (with vcpkg) is now possible
* cotire is not used when redundant (cmake >= 3.16)
* Lua version shown on startup
* Github Actions
* rework on /reload
- reworked the /reload command, from now on it does reload everything regardless of what you want to reload, because if we don't reload the entire scripts folder alongside it might bug/crash.
You can however still use '/reload global' which will reload global.lua and scripts/lib/
- added 'showScriptsLogInConsole = true' to config.lua.dist. If that option is enabled it also shows on /reload that the scripts are reloaded aswell
- removed all deconstructor (__gc) functions for the events as they where the cause of the crash on reload.
- made raw 'event' pointers to std::unique pointers, so on release it doesn't crash the server.
- fixed a bug which stacked attacks/defenses/loot on reload which could lead to a crash aswell.
* updated reload.lua
- removed all the deprecated reload types.
* trailing line space
- remove a trailing line space
* removed stuff
- removed the unnecessary pointers and pushed them directly into the event type list
* rework on /reload
- reworked the /reload command, from now on it does reload everything regardless of what you want to reload, because if we don't reload the entire scripts folder alongside it might bug/crash.
You can however still use '/reload global' which will reload global.lua and scripts/lib/
- added 'showScriptsLogInConsole = true' to config.lua.dist. If that option is enabled it also shows on /reload that the scripts are reloaded aswell
- removed all deconstructor (__gc) functions for the events as they where the cause of the crash on reload.
- made raw 'event' pointers to std::unique pointers, so on release it doesn't crash the server.
- fixed a bug which stacked attacks/defenses/loot on reload which could lead to a crash aswell.
* another rework
- You can now again reload different types again like usual (/reload actions) etc.
- You can also use /reload scripts and /reload libs now
* forgot to include globalevent.cpp
* another rework
- You can now again reload different types again like usual (/reload actions) etc.
- You can also use /reload scripts and /reload libs now
* another addition
- added removing lua stuff before reloading for /reload all
* ranisalt's change request
- clear() functions are now all override final
- removed get/set for fromLua
- added reInitState function to BaseEvents
- made oldEvent a std::unique_ptr
* another rework
- You can now again reload different types again like usual (/reload actions) etc.
- You can also use /reload scripts and /reload libs now
another addition
- added removing lua stuff before reloading for /reload all
ranisalt's change request
- clear() functions are now all override final
- removed get/set for fromLua
- added reInitState function to BaseEvents
- made oldEvent a std::unique_ptr
* initial revscriptsys
creates a new folder called 'scripts' in the data folder.
lua files placed in the 'scripts' or sub folders will automaticly get registered on load with the right setup ofcourse.
Registering happens in the lua file itself, doesn't require xml settings.
lua files can be deactivated by placing a '#' infront of the filename ex: '#positions.lua' it wont get loaded then.
Currently it supports:
-Actions
-TalkActions
-CreatureEvents
-GlobalEvents
-MoveEvents
There is still stuff on the todo list but they'll get added sooner or later.
Co-Authored-By: Sam <thesumm@users.noreply.github.com>
* compiler fixes
added boost-filesystem to appveyor.yml
fixed a few more compiler errors.
* cleanup on script.cpp
removed using namespace for std / boost filesystem
* some fixes
had to make adjustment so lua callbacks and xml settings work alongside and don't crash the server
* small fixes on movements & function additions
Have to revert the function + callback for stepin/stepout & additem/removeitem as it doesn't make sense on the second look and might cause a stackoverflow
I've also reworked the equip/dequip so it doesn't get double calls.
It'll first check if functions return true if not it won't bother to read the callback
accidently used an old spellbook.lua
added :aid(ids) :uid(ids) functions for MoveEvents
* revert to 'using' functions and suggestion of Djarek
Could revert most of movements.h
made the declaration of the static functions more clear
Co-Authored-By: Damian Jarek <djarek@users.noreply.github.com>
* small fixes
removed commentary from movement.cpp
added newline for position.lua
reworked spellbook.lua with table.concat
* Monster handler & other stuff
- MonsterType's can now be created through lua functions.
- added an interface to create MonsterType's easily through lua files (register_monster_type.lua)
- added #example.lua in 'scripts\monsters\'
- renamed action vector functions for a better standard
- renamed _lib folder to lib, this folder gets now loaded when the other lib folder gets loaded aswell
- moved loading lua scripts out of the scriptfilemanager, we need to load everything after monsters etc. is loaded so MonsterType script manipulation does work
- added Loot() & MonsterSpell() metatables
* fix compiler error
* forgot to remove test code
removed test outfit from MonsterType
* small changes
- added createFunctions(class) it virtually creates the get/set functions for the class passed on
- 'events' folder in monsters is excluded from auto parsing files, as we load callbacks for specific monsters which have an eventFile set to 'true' or 'filename' in this folder.
* compiler error fix
* minor change on createFunctions
* stripping path string
* added Game.createMonsterType(name) and small fixes
- added Game.createMonsterType(name)
- reworked MonsterType(name) to return nil if the MonsterType does not exist, so we don't suddenly create a MonsterType if we do not even want to.
- changed reinterpret_cast to static_cast
* config.lua option for console
- added an option to disable scripts console logging, it can be disabled by placing 'showScriptsLogInConsole = false' into config.lua
* initial revscriptsys
creates a new folder called 'scripts' in the data folder.
lua files placed in the 'scripts' or sub folders will automaticly get registered on load with the right setup ofcourse.
Registering happens in the lua file itself, doesn't require xml settings.
lua files can be deactivated by placing a '#' infront of the filename ex: '#positions.lua' it wont get loaded then.
Currently it supports:
-Actions
-TalkActions
-CreatureEvents
-GlobalEvents
-MoveEvents
There is still stuff on the todo list but they'll get added sooner or later.
Co-Authored-By: Sam <thesumm@users.noreply.github.com>
cleanup on script.cpp
removed using namespace for std / boost filesystem
small fixes on movements & function additions
Have to revert the function + callback for stepin/stepout & additem/removeitem as it doesn't make sense on the second look and might cause a stackoverflow
I've also reworked the equip/dequip so it doesn't get double calls.
It'll first check if functions return true if not it won't bother to read the callback
accidently used an old spellbook.lua
added :aid(ids) :uid(ids) functions for MoveEvents
Monster handler & other stuff
- MonsterType's can now be created through lua functions.
- added an interface to create MonsterType's easily through lua files (register_monster_type.lua)
- added #example.lua in 'scripts\monsters\'
- renamed action vector functions for a better standard
- renamed _lib folder to lib, this folder gets now loaded when the other lib folder gets loaded aswell
- moved loading lua scripts out of the scriptfilemanager, we need to load everything after monsters etc. is loaded so MonsterType script manipulation does work
- added Loot() & MonsterSpell() metatables
small changes
- added createFunctions(class) it virtually creates the get/set functions for the class passed on
- 'events' folder in monsters is excluded from auto parsing files, as we load callbacks for specific monsters which have an eventFile set to 'true' or 'filename' in this folder.
stripping path string
added Game.createMonsterType(name) and small fixes
- added Game.createMonsterType(name)
- reworked MonsterType(name) to return nil if the MonsterType does not exist, so we don't suddenly create a MonsterType if we do not even want to.
- changed reinterpret_cast to static_cast
config.lua option for console
- added an option to disable scripts console logging, it can be disabled by placing 'showScriptsLogInConsole = false' into config.lua
The error information was discarded anyway, so this provided no value.
Removed redundant declarations in OTB::Node.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
* Fix function attributes and visibility
- Replace `protected` visibility with `private` for `final` classes
- Remove `final` attribute from `final` class methods
- Add `override` attribute when applicable
- Add `[[noreturn]]` attribute where applicable
* Remove unused attribute
* Fix visibility (protected to private)
* Added UNIX signal handling for SIGTERM, SIGHUP, SIGINT, SIGUSR1.
Using signal_set allows us to use the same interface for handling
signals on UNIX-likes and console events on Windows.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
* Fix indentation in project file
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>