Commit graph

96 commits

Author SHA1 Message Date
Lukáš Novotný
d6bde75dec
Add proxy protocol support (#623)
* Add proxy protocol support

* style fix

* more style changes

* hopefully final style fixes

* Implement AllowProxy instead of UseProxyProtocol

* Style fix

* Fix initialization warning; remove unused header

* Fix boost warning (thanks @KevinEady)
2024-02-21 21:41:17 +01:00
turleypol
d848deae18
POLLOG* macros use the new formatting (#598)
* POLLOG* macros use the new formatting
removed all old logging functions

* removed old fmt lib from everything except StreamWriter
removed unneeded functions

* fixed review comments
2024-01-16 17:55:42 +01:00
turleypol
0e675c516a
use new formatter for ERROR_PRINT, added ERROR_PRINTLN (#595)
* use new formatter for ERROR_PRINT, added ERROR_PRINTLN

* remove old log define

* fix comments
2024-01-12 06:51:44 +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
5e5f405c3d
Packet hook deadlock (#566)
* calling pkthooks does not need to hold the socketmutex

* temporary test for verification via CI

* removed testpkthook

* corechanges
2023-11-19 21:54:55 +01:00
turleypol
5db01e5dec
Client related threading issues (#482)
* busy flag for DynTaskPool needs to be atomic
client SocketMutex is no more static
replaced Client::Delete with a deconstructor
Client::disconnect needs to be atomic
Multiple threads want to know UOClientListener::login_clients size.
CI action which runs with Thread/AddressSanitizer
updated some github actions

* listener client size getter
corrected sanitizer build name

* ubuntu22

* Jobnames

* jobname fix, workaround for ci link error?

* use dos cmd for workaround

* fix also winnopch ci

* more unique job names
2022-11-29 07:02:53 +01:00
Kevin Eady
5c969ede36
Add support for programmatically disabling inactivity timeout on a client (#458)
* Implementation of disable_inactivity_timeout

* Add documentation

* move client idle check

* fix core-changes date
2022-04-24 23:48:26 +02:00
turleypol
3306c5e206
converted multidef (#441)
* converted multidef
added to the testsuite a big multi
ListMultisInBox now uses the update range, but since its the only spot
and the chances are low that someone really has such a big multi
corechanges are not really worth it I would say

* Fixed a few grid bugs, one endless loop and changed the range a chr can move while customhouse is active
2021-11-09 20:01:16 +01:00
turleypol
76d9c5e9d6
not yet active: handle update range of client. (#440)
* not yet active: handle update range of client.

* allow down to 5 as client view range

* try to secure testclient against racecondition
2021-10-28 23:08:38 +02:00
Fernando Rozenblit
eb4eb8b225
Refactor Client to use private inheritance from ThreadedClient (#346)
In summary:
* Make functions in clientthread.cpp depend on ThreadedClient.
* Wrap session, packet logging and cryptengine
* Other small changes to make ThreadedClient private
2021-03-07 14:46:24 +01:00
Fernando Rozenblit
8ffc035c85
Refactor clientio process data (#342)
* Move fpLog up to ThreadedClient
* Extract send_KR_encryption_response() from process_data() into Client
* Change signature of small helper functions to use a ThreadedClient instead:
valid_message_length(), handle_unknown_packet(), handle_undefined_packet(), handle_humongous_packet() and report_weird_packet().
* Change signature of process_data() to take a ThreadedClient
2020-10-26 21:21:34 +01:00
Fernando Rozenblit
eb639587fe
Refactoring: extract client logic from threadedclient-io-step (#335)
- ThreadedClient now takes a non-const reference to its client
- Extracted has_delayed_packets()/process_delayed_packets() from io-step into ThreadedClient. They will handle speedhack prevention's movementqueue. Movementqueue might be moved later into ThreadedClient.
- Extracted should_check_idle()/warn_idle() from io-step into Client.
- Added Client::handle_msg(). It will call the appropriate packet handler. Used by process_delayed_packets() and process_data().
- Removed an old MSVC warning suppression
2020-10-04 11:53:20 +02:00
Fernando Rozenblit
62e8089281
Extract methods from threadedclient_io_finalize into client (#326)
* Extract code from threadclient_io_finalize as Client methods:
 - on_close, called when the connection is over. Returns the wait time for logoff.
 - test_logoff, called by on_close to determine how long chr must wait before logoff
 - on_logoff, called when the logoff timer expires
2020-09-25 16:45:42 +02:00
Fernando Rozenblit
b87ec21689
Split up client_io_thread by extracting functions for the io loop, io step and finalize. (#324)
Those should eventually become methods of ThreadedClient.

Moved member checkpoint up to ThreadedClient.
2020-09-24 19:18:14 +02:00
Fernando Rozenblit
12eb9d8631
Hoist networking members and methods of Client into a new base class (#323)
Hoisted the networking members and methods of Client into a new base. Kept the same access levels so the remaining code doesn't have to change yet.

Co-authored-by: Eric Swanson <eric.the.unicorn@gmail.com>
2020-09-23 22:54:19 +02:00
turleypol
8b085e86ef dont assume a tainted string by default
cfgfiles (which includes savefiles, datafiles) get sanizized on read,
filemod::readfile, xml module, sql handled
old ascii speech packets handled
2019-01-12 17:14:05 +01:00
turleypol
d0b74d6da6 added first docs, cleanup of first todos 2019-01-03 18:58:13 +01:00
turleypol
cc27bb611f removed last usage of convertUCtoArray 2019-01-03 11:00:46 +01:00
turleypol
b541f64c6f more network specific code moved 2018-12-30 21:58:07 +01:00
turleypol
9cfb4ec5a5 moved pkt headers into network folder 2018-12-30 21:35:54 +01:00
turleypol
0d4cca785d cleanup of compilerspecifics, ancient compilers arent supported.
ran tidy to use bools instead of ints
2018-11-03 13:14:53 +01:00
turleypol
4f40aa7997 removed Clib::decint and used Clib::tostring, changed Clib::hexint to
template function for all integers
2018-10-28 09:31:58 +01:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +02:00
Gabriele Tozzi
b72f725e02 Whitespace fixes 2018-04-03 04:13:03 +02:00
turleypol
3afc41241b
CMake on windows (#48)
CMake can now also be used for windows
2018-02-24 22:34:55 +01: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
a983d25e4e removed bool members and replaced them with flags.
Further decrease memory foodprint.
2016-12-07 23:34:16 +01:00
frozenblit
d86cbee187 Fix bug where clients would be stuck at "Verifying account..." 2016-03-04 00:37:43 +01:00
frozenblit
324a877626 Improved ref_ptr and weak_ptr, clients are now deleted by the message queue 2016-02-28 03:51:16 +01:00
turley
d2afa82969 changed clienttransmit thread to hold a weakptr,
in addition only this thread deletes clients. should fix all
dataraces in this area.
2016-02-25 18:29: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
33975f599b Merge tag 'pre-nl-normalize'
This is the last commit prior to newline normalization
2016-02-12 17:29:32 +01:00
turley
92cc1b4d70 Use weakptr to uoexecutor in the threaded sql call
changed client class from ref_counted to also hold like the uoexecutor a weakptr, use it in the ClientObjImp.
Renamed NPCRef to NpcRef like its been told since years in a TODO comment
fixed some warnings from VS2015
2016-02-10 23:09:05 +01:00
Gabriele Tozzi
ff64e3b2b4 Minor: forcing SpinLock to be used only via SpinLockGuard 2016-02-03 06:08:26 +01:00
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
Gabriele Tozzi
b640d81a4d Fixed linux build warnings and a post-merge error 2015-12-05 09:40:59 +01:00
Gabriele Tozzi
66c6200e2a Merge branch 'master' into cmake 2015-11-30 05:49:34 +01:00
Gabriele Tozzi
17c45a8fd2 New Client object properties last_packet_at and last_activity_at 2015-11-28 11:12:52 +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
8077e36a07 Added: new pol.cfg option AllowMultiClientsPerAccount (default: false)
When true, allows multiple characters from the same account to be
logged in at the same time
2015-10-27 16:18:51 +01:00
turley
0d9d13bdb9 moved unicode from clib to pol 2015-09-19 10:55:48 +02:00
turley
dfd65e30cd Moved plib realm to pol 2015-09-18 19:11:46 +02:00
frozenblit
18604c526a Got rid of some more warnings 2015-04-09 22:34:46 +02:00
turley
b77a13073c corrected several data races 2015-03-14 11:45:14 +01:00
turley
b191039ffd protected pktlog identifier by spinlock, fixes racecondition 2015-02-14 12:56:19 +01: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
7935b95fbd Realms can now track offline chars
Improved the tracking of offline chars in realms, so that shadowrealms
can't be destroyed while chars are still inside.

Next step: do the same for multis and add a command to list the offline
chars.
2014-11-04 22:58:12 +01:00