Commit graph

57 commits

Author SHA1 Message Date
turleypol
08bd3c7ce5
Savefile rewrite (#601)
* rewrite of saving, replaced operator way with a generic add method, thus
not everywhere the formating of the savefiles is hardcoded.
since its the last spot which uses the old formating lib, remobed the
lib

* removed cmake of old format lib

* testscripts for load/save of UObject,Item,Armor,Weapon

* fixed: member faster_cast_recovery and faster_cast_recovery_mod getter returned
a wrong value

* wrong/missing docs

* test containers, lockable, map, spellbooks
fixed save bug in map and spellbook
removed ancient savestrategy experiments

* added corpse test
splitted testfiles

* fixed loading (ancient bug) and saving (PR bug) of Reportables
added tests for houses, boats, accounts and chars

* fixed include

* fix shutdown leak

* added npc tests
upload complete coretest folder also on failure

* do not write and load RegisteredHouse for NPCs two times
readded extra newline between accounts

* tests for guild, party, realm
added resource cfgs, but a test is not really possible since nothing of
interest is stored

* added datafile, storage test

* activated resource loading, 25year old bug, but since the stored values
are senseless it makes no real difference.
added a few wtf comments
catch all exceptions during formatting of log lines

* replaced .write with explixit .begin, .end and .comment.
for leftovers.txt the StreamSaver was also used, since the format is
different use directly ofstream

* added corechanges
2024-01-24 18:49:06 +01:00
turleypol
43b776b94d
New format lib version (#592)
* renamed include guard to be able to use both format lib versions in
parallel

* build Fmt lib and link it into clib

* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib

* use new logging variant for two logs

* always add \n to flush log, lets see if the assumption holds

* use new lib for tostring

* replaced all INFO_PRINTS in clib

* formatter for Token, BObject and BObjectImp

* started with bsccript

* use function instead of actual object for logging

* remaining bscript, started plib

* logvariant without newline added, more template magic

* format support for base types, added test for format padding
new version for fdump

* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE

* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool

* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE

* gitignore for fmt lib

* cleanup vim leftovers
2024-01-10 18:29:10 +01:00
turleypol
ec91d7cc3c
Codecleanup from #581 (#583)
* is_visible_to_me checks now also in_visual_range
added obj::distance_to
fixed warnings

* no magic numbers for snprintf
2023-12-26 17:47:40 +01:00
turleypol
d873551c25
removed pol_distance/inrange* functions (#556)
* removed pol_distance/inrange* functions
replaced lastxyz with Pos4d

* replaced WorldIterator::InVisualRange with InMaxVisualRange returning
all objects in maximum update range. Adapted each caller, they now have
to check in_visual_range
Multis should now be send to clients with its footprint in mind.
added testscript for boat moving in/out of range

* removed non pos InRange/InBox functions
gamestate.update_range doesnt need to be a Vector, renamed

* corrected send_action_to_inrange

* replaced clip methods with general numeric type clamp function

* added Range2d constructor with radius

* splitted update_range. chr has now a los_size (how far can it see) and
an object has a visible_size (0 for objects 1/2 footprint for multis)

* use in_range instead of pol_distance

* corrected order of checks

* fixed warnings

* fixed visual size of multis
testclient added wornitems pkt support
added tests for los

* corechanges
2023-12-25 22:02:52 +01:00
turleypol
7ee1b64e19
replaced baseclass x,y,z,realm members with Pos4d. (#420)
* replaced baseclass x,y,z,realm members with Pos4d.
Adapted the code, no changes except making the compiler happy

* review changes

* Fixed gotten_item

* fixed copy&waste
2021-09-10 20:17:25 +02:00
turleypol
ec9cd8026b
Descriptorbugs (#406)
* tests for several descriptor loading related problems

* fixed copy of cprops from descriptor to intrinsic items
fixed container test

* added shield npcdesc entry

* fixed nodrop/exception loading from itemdesc

* fixed compilation error

* attackdelay should later also trigger creation of npc weapon, added test for it

* intrinsic weapon gets created when AttackSpeed or AttackDelay is set.

* added docs

* changed doc entry

* fixed typo
2021-08-03 14:58:50 +02:00
turleypol
dc8913b485 moved min/max damage calculation where it belongs, removed unused
weapontmpl member
2019-10-03 15:16:54 +02:00
turleypol
983c6a3c73 first round for scripted object class methods 2018-10-13 00:03:40 +02:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +02:00
esdete
349ea7f4b8 CfgElem: passing sink parameters by value 2018-07-31 12:29:25 +02:00
Gabriele Tozzi
b72f725e02 Whitespace fixes 2018-04-03 04:13:03 +02:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turleypol
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +01:00
turley
6c772dcffc Fixed unreachable code warnings. 2016-12-19 17:22:09 +01:00
turley
c855a27815 Added new baseclass for uobject
contains only minimum data and can be created with arbritary data.
This reduces memory overhead for each los-check.
Plus minor cleanup
2016-12-12 22:21:59 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
Gabriele Tozzi
24eee9ecf4 Merge branch 'master' of https://github.com/polserver/polserver into cmake
Conflicts solved, still need to test and review it before merging into master.
2015-11-27 06:26:46 +01:00
Gabriele Tozzi
6a39ba6fe5 Added: Intrinsic Shield support, works just like intrinsic weapons
Implemented by moving the "intrinsic" concept from Weapon to Equipment
2015-10-02 21:30:14 +02:00
Gabriele Tozzi
7fbcc1677e Added: New keyword AttackCProp on npcdesc.cfg
allows defining CProps for intrinsic weapons
2015-09-24 12:33:44 +02:00
turley
dfd65e30cd Moved plib realm to pol 2015-09-18 19:11:46 +02:00
Thomas Volkert
1dd2200c6b Renamed endian.h to clib_endian.h to avoid redefinition problems in
system files and the general hiding of the endian.h from the system
2015-08-31 20:01:31 +02:00
turley
188b2797ed Replaced old dynprop_map with new dynproperties.
Moved also extended_statbar,skillcap, movementcost_mod infos into the dynprops
2015-05-09 13:00:12 +02:00
turley
79dff37246 Splitted gamestate external. 2015-01-02 14:46:44 +01:00
turley
88ec380941 Moved globals into separate directory. 2014-12-30 15:20:59 +01:00
turley
2737393f2a Tried to put all global vars into centralized structures.
Currently plib/systemstate, pol/uvars, pol/ucfg, pol/multi/multidef

Next step should be to split them based on usage, since its currently a bit of include hell...
2014-12-30 14:14:41 +01:00
frozenblit
f57f0f6f0f Encapsulated calls to getmember<> and setmember<> 2014-11-09 23:45:08 +01:00
frozenblit
1f0f7581dd Some more cleanups 2014-11-03 01:29:21 +01:00
frozenblit
c9756a8210 Added more NULL checks
For weapons and armor, we always assumed that the member variable templ
!= NULL. I added a few passerts to be sure.

A few other NULL checks were added.
2014-08-27 00:21:45 +02:00
turley
b8d22e290b more flyweight usage (names, scripts, template), made resistance and damage types optional. 2014-08-02 17:53:33 +00:00
turley
b2572d69f7 fixed size estimation. MoveObjectToLocation on a boat now unregisteres the boat first thus small changes are also possible. 2014-07-05 09:40:15 +00:00
turley
331792c755 added more memoryusage estimation 2014-06-07 09:00:37 +00:00
turley
fb873de803 decoupled headers to optimize a bit the build time 2014-05-03 09:06:19 +00:00
turley
9acf8fa43c added StackWalker lib for complete backtraces under windows
simplified some loops
fixed a crash on char death with non moveable robe layer items
2014-04-25 09:30:50 +00:00
turley
f58b3badbd Fixed a pointer override placed more const modifiers so this hopefully never happens again. 2014-01-24 18:58:29 +00:00
turley
31ee263a45 activated new logging facility 2014-01-18 13:29:38 +00:00
turley
99d7dc3037 namespaces...finally :)
Hard part is finished every file is touched. Namespaces are currently rough named by directory name.
Maybe we could split it more
2013-12-21 09:10:46 +00:00
turley
10f6277683 msg_queue: new method to move the msg directly into the queue
streamsaver: changed the writer to unique_ptr and move directly into queue
clienttransmit: move transmitdata directly into the queue
itemdesc: removed several external maps, added save_on_exit member
items: added pointer to itemdesc and use it directly
2013-10-12 15:06:43 +00:00
turley
7085a8470f new StreamSaver class used for saving 2013-10-06 14:45:10 +00:00
turley
efdeecbbc7 more c++11 cleanup 2013-10-04 09:11:56 +00:00
frozenblit
eca7477429 Fixed duplicated items being saved. Changed the wrapper to call its own class, avoiding confusion because of the virtuals. 2013-09-22 19:58:22 +00:00
frozenblit
6b06496a62 Changed Weapon, Armor and Equipment to use new library. 2013-09-22 11:44:41 +00:00
dsourc
4b9d4e9ec2 Moved Equipment members .hp .maxhp .maxhp_mod and .quality to Item 2013-09-03 19:14:57 +00:00
dsourc
b8a0cdfadd Added Weapon RW member .speed_mod
Changed Weapon RW member .dmg_mod to dynamic
Fixed in UContainer set_script_member functions the new members to cast correctly the values to short from int
2013-09-03 11:14:56 +00:00
dsourc
68f8a94180 Fixed: When changing graphic of a lightsource item, it now changes correctly the facing too.
Fixed:      Status bar now shows for weapon mindamage ( id.mindamage + dmg_mod ) and for maxdamage ( id.maxdamage + dmg_mod )
2013-02-20 15:23:00 +00:00
turley
269f6e9069 secured: executor_instances, gameclock and logfile
added LEAK_DEBUG define:
disables the fixed allocs and uses direct new/delete, useful in conjunction with define of _STLP_USE_NEWALLOC in stlport/stl/config/host.h (rebuild of STLPORT required) to see real leaks
fixed leak of intrinsic weapons
small speedup for map packet
2012-08-27 17:47:15 +00:00
turley
7e885816fc removed Intrinsic Itemdescriptor 2012-03-10 09:51:42 +00:00
frozenblit
5faf1dfcfb Weapon load errors are now handled through elem.throw_error() instead of cerr. 2011-12-18 12:53:36 +00:00
frozenblit
6539c5457f During itemdesc cleanup, check for empty_itemdesc.
Intrinsic weapon (i.e., wrestling) is now set to intrinsic by core, no need to set this in itemdesc.cfg. 
Better handling of weapon unload, deleting only the npc weapon templates. Removed some WTFs...
2011-12-18 11:33:42 +00:00