Commit graph

37 commits

Author SHA1 Message Date
Kevin Eady
d916f86408
Update container OnRemove, CanRemove program parameters (#647)
* Implementation
- Add `amount` to CanRemove script
- Add `split_from` to OnRemove script

* Tests

* Add docs and core-changes

* Fix tests... maybe?

* Restore testing for client events in container event tests
2024-05-16 22:49:51 +02:00
Kevin Eady
c4f6e32e88
Add held_weight_multiplier for containers; Fix missing tooltip updates (for weight) (#646)
* Implementation

* wip testing

* allow setting held weight mod to long value

* more tests

* address github actions warnings
- unary minus operator applied to unsigned type, result still unsigned

* Add docs, core-changes

* fix GetItemDescriptor() for HeldWeightMultiplierMod; update tests

* update docs a bit more

* Remove mod suffix
2024-05-14 08:24:19 +02: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
murderinc
6e9b28e0e0
Add ServSpecOpt UndoGetItemEnableRangeCheck and UndoGetItemDropHere to control get item undo behaviour (#547)
* Add Character member .parrychance_mod, additive modificator of the parry_chance from the defender when it has shield equipped. Add parrychance_mod to parry formula.

* Add repsys.cfg General section PartyHarmFullCountsAsCriminal 1/0 default 1. If 0 OnHarm does not set mobile to criminal when they are in the same party.

* fix settings/party namespace

* fix pointer

* add ServSpecOpt UndoGetItemEnableRangeCheck and UndoGetItemDropHere undo getItem behaviour options

* fix code style len

* add missing comas

* special case for no drop item

* if no drop item and was not able to return to original container try to put to backpack

* fix remove item in range (was still displaying item in container, but was not really present there)

* add first simple test

* remove all tests

* remove all tests

* do not export test function

* ReloadConfiguration add reload servspecopt; Testsuite add fileaccess and servspecopt files; Add test fro undo get item

* check what produce SanitizerBuild fail

* run all test to fail on ThreadSanitizer Build

* Add repsys.cfg General section PartyHarmFullCountsAsCriminal 1/0 default 1. If 0 OnHarm does not set mobile to criminal when they are in the same party.

* add ServSpecOpt UndoGetItemEnableRangeCheck and UndoGetItemDropHere undo getItem behaviour options

* add missing comas

* fix remove item in range (was still displaying item in container, but was not really present there)

* remove all tests

* check what produce SanitizerBuild fail

* run all test to fail on ThreadSanitizer Build

* test new reload conf fix

* double check that build successful

* fix test comments; fix change log

* add DefaultAccessibleRange = 2 for tests

* delete unnecessary servspecopt file

* change check to toplevel_pos; add test for toplevel_pos

* try to update backpacks for client; increase distance to on drop backpack

* add heavy robe for tests; use robe instead flooding client with arrows

* fix test messages

---------

Co-authored-by: Oleksii Rebreniuk <oleksii.rebreniuk@shopit.se>
2023-11-01 19:22:29 +01:00
Kevin Eady
ecec3a2206
reworked get_item and its undo behaviour (#514)
* reworked get_item and its undo behaviour.
old position gets stored and in case of failures restored

* removed ancient container content defines

* Fix some packet oddities
- dropitem: Success sent after rejections
- getitem: Double Delete Item packet due to item->extricate

* Store container serial when creating GottenInfo

* Add tests

* add socket mutex to disconnect checks

* Use mutable socket mutex

* add core changes

---------

Co-authored-by: turleypol <turley@polserver.com>
2023-05-23 17:07:23 +02:00
turleypol
eeb57d489a
Drop/getitem related pos refactoring (#497)
* refactored move_item

* container location methods

* dropitem position refactors

* addressed pr comments.
fixed comment
more readable algo for random location
2023-01-05 00:10:51 +01:00
Kevin Eady
999ca84aea
Add Support for Snooping via Item Descriptor element SnoopScript (#491)
* Initial work on adding SnoopScript

* use message "That doesn't belong to you..." if lifting a snoopable item

* fix configfile changes

* Update core-changes
2022-12-20 21:32:47 +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
9cfb4ec5a5 moved pkt headers into network folder 2018-12-30 21:35:54 +01:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +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
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
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
frozenblit
b3b9bb1fb6 Removing dependence on useless includes.
Preparing to reorganize the uofile code by removing useless includes
from the rest ;)
2015-12-04 00:50:14 +01: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
65fe073971 Gotten by pointer for items and chars made optional 2015-05-16 11:09:26 +02:00
turley
930de5002f merged Item gotten_by pointer with bool flag
moved sell and buyprice into dynamic properties
merged precompiled header
2015-01-24 10:38:29 +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
turley
122f8fd25f Cleanup of Remove Object pkt
Added override and final makro
2014-11-22 12:28:15 +01:00
turley
dd4d4c0f9a Added new WorldIteratorFilter for active client only players
Fixed warning during pkt write of sound effects.
2014-11-21 21:28:09 +01:00
frozenblit
ecb13b694d Never-ending cleanup 2014-11-02 00:20:20 +01:00
frozenblit
ed679dba3d Moved message handling code into its own cpp
Created a new file (msghandl.cpp) and moved the code from pol.cpp there.
Moved related files to the "network" folder, where they belong. Fixed
include names... (we should make this relative to the project root!)
2014-10-01 21:10:32 +02:00
turley
fb873de803 decoupled headers to optimize a bit the build time 2014-05-03 09:06:19 +00:00
turley
261052f48d cleanup of the world iteration methods 2014-01-19 15:25:48 +00:00
turley
31ee263a45 activated new logging facility 2014-01-18 13:29:38 +00:00
turley
47fec4bdf5 splitted world zones into players and npcs, added several helper functions to only interate over the wanted types (player+npcs,player,npc,items,multis) best usable with lambdas. 2013-12-31 14:14:04 +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
frozenblit
f5807fe6bf A few changes to improve static code analysis using Microsoft's PREFAST... 2011-12-30 23:56:51 +00:00
muaddib_pol
631ed68c4a + All projects now using literal paths for includes.
+ Disabled Compiler warning 4244 in VS for str.cpp and strutil.cpp due to fact they are false warnings there.
2009-09-12 23:51:20 +00:00
muaddib_pol
6a73041445 + Network Code organized some. Baby steps, baby steps 2009-09-07 20:37:38 +00:00
muaddib_pol
49072c3c41 + To-Do file updates
+ Beginning of Mobile and Module source file organization
+ Makefile.Gcc updates
2009-09-06 14:11:24 +00:00
muaddib_pol
d5e678bdd6 + Organization updates.
* Account and Multi related pol-2008.vcproj organized.
2009-09-04 06:37:13 +00:00
muaddib_pol
d032ee448f + POL is now, open source. 2009-09-03 19:44:42 +00:00