Commit graph

46 commits

Author SHA1 Message Date
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
a81879ce7a
AuxConnection transmit race (#585)
* auxclient transmit could run from multiple threads leading to send calls
in wrong order

* core changes

* sync deconstruction for threadsanititer build

* ups..names should be unique
2023-12-29 11:12:37 +01:00
Kevin Eady
6f84b07bc8
Fix uninit member on AuxClientThread ctor (#516) 2023-03-25 22:12:51 +01:00
Kevin Eady
ccc6213c6f
Add ignore_line_breaks option to os::OpenConnection (#512)
* Add use_byte_reader option to OpenConnection

* Fix formatting

* fix incorrect param number

* Do not include on writes CRLF if using byte reader

* Rename to ignore_line_breaks

* Update docs

* Add core-changes
2023-03-20 19:54:39 +01:00
turleypol
8b7ece1c18
Testclient (#390)
* first testclient version
fixed dangling pointer in openconnection
added option to keep connection alive

* movement tests
OpenConnection do not start socketclient on connection error
changed communication pkts between testclient and server
send every event to server from testclient

* add new item event
serialize method
check move position

* added openconnection docs

* test if the ci can fail to find python3

* explicit add python3

* added multiclient support

* debug logs

* more debug

* id out of sync?

* cleanup fixed typo

* transfer client id

* send todos to the correct brain

* addee core changes
2021-03-25 19:26:09 +01:00
Kevin Eady
12d6186d10
Script option enhancements (#118)
* Fix SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES

* Add SCRIPTOPT_SURVIVE_ATTACHED_DISCONNECT

* wip beginning work on templatization

* Use PolModule in pol-specific modules

* wip, creating PolModule with getXYZParam

* wip 1, moving getXYZ to UOExecutor

* compilable with PolObjectImp / PolApplicObj

* add type guard

* wip, change signatures

change signatures of script_method, script_method_id, and
custom_script_method

* compilable (windows)

* linux fixes

* namespace fixes

* remove uoexhelp

* formatting

* compilable

- move can_access_offline_mobiles back to uoexec
- add guildscrobj and partyscrobj sources
- move EGuildRefObjImp and EPartyRefObjImp
- wip, implement asUOExec
- formatting uoexec.cpp,.h

* finish uoexec() helper

* some cleanup
2020-02-08 09:21:35 +01:00
Fernando Rozenblit
001bbc5008 Added SocketLineReader class, which is responsible for reading lines from a socket in a more efficient way. Modified Aux, Debug and WWW to use the new class. 2019-08-25 21:03:40 +02:00
Fernando Rozenblit
bc79dc046e Moved basic network files to clib 2019-03-04 21:41:27 +01:00
turleypol
1ae8963db9 Socket is now a only moveable type (like it always was)
cleanup connect api
2019-02-23 21:30:20 +01:00
Fernando Rozenblit
2b965dbfec Cleanup in preparation for item enteredarea/leftarea events 2018-11-01 22:47:52 +01:00
turleypol
6107184258 only one global config include exists now 2018-06-17 18:31:55 +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
6eb957e2d2 fixed two missing nullptr handlings 2018-01-29 22:09:57 +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
turleypol
09d5da59f1 defer transmit of auxconnection messages to not block the shard 2017-10-21 18:51:45 +02:00
turleypol
37ec763c81 format sources 2017-10-21 18:12:38 +02:00
turleypol
63a3979b2f activated for ingoing auxconnections the threadpool
fixed initialization order of AuxClientThread
do not let members uninitialized in AuxClientThread
some minor tunings
2017-10-21 18:07:46 +02:00
GIB
ffcf169b62 Fixed documentation.
Restructured AuxClientThread to initalize properly.
2017-10-21 23:06:07 +08:00
GIB
56c0695028 Fixing some bool problems. 2017-10-20 23:42:30 +08:00
GIB
488cfd0179 Removed some debug printouts. 2017-10-20 22:29:52 +08:00
GIB
38a4ff7bb5 Added assume_string flag to OpenConnection() 2017-10-20 21:30:35 +08:00
GIB
2402c08632 Changed param for OpenConnection to be optional.
Activated threadpool for OpenConnection similar to how AuxConnections currently work.
Cleared some required PERGON if's out of the globals/network file.
Modified Aux Client to support params.
2017-10-18 21:26:38 +08:00
GIB
6432d07b96 Added params to OS::OpenConnection() to allow you to pass parameters to the script that is run for the connection 2017-10-11 23:38:54 +08:00
turley
65231f9bfd use faster overload for string find with single characters 2016-12-15 13:34:06 +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
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
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
turley
6de0c7e1c0 added define to use boost regex (older gcc has bug in std version)
added define for the git revision and centralized others
2016-01-19 21:04:40 +01:00
turley
7a531357fe Updated Memoryusage profiler 2015-01-19 18:18:21 +01:00
turley
79dff37246 Splitted gamestate external. 2015-01-02 14:46:44 +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
c4cb100279 Some more stl_inc.h cleanups 2014-11-01 19:16:13 +01:00
turley
331792c755 added more memoryusage estimation 2014-06-07 09:00:37 +00:00
turley
05c5b2d60b removed old code
testing a threadpool 
added chr.last_textcolor member which returns the clientside chatcolor
2014-06-01 09:59:12 +00:00
turley
2e1299dd4d first take the lock before creating a new thread in the aux interface (should also be rewritten to not create a new thread everytime) 2014-03-08 07:36:26 +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
4c7f70fc79 first version of a generic message_queue (currently not lockfree, need to test more)
replaced old auto_ptr with unique_ptr
2013-09-13 18:07:19 +00:00
frozenblit
cba6acaaa5 Some more cleanup from code analysis. Added auto_ptr in a few places to avoid
leaks after exceptions.
2012-01-02 23:48:26 +00:00
turley
4e7e400254 64bit compilation.. 2011-12-23 13:28:38 +00:00
KevinEady
25c1b0ccb8 11-22-2011 kevin:
Added:	pol/sqlscrobj.cpp pol/sqlscrobj.h
  Changed:	pol/module/sqlmod.cpp pol/module/sqlmod.h
  			Add preliminary MySQL database support.
  			New eScript objects: BSQLConnection, BSQLResultSet, BSQLRow 
  			Added several new sql module functions:
  				mysql_connect(host,username,password);
				mysql_query(connection,query);
				mysql_fetch_row(result);
				mysql_affected_rows(result);
				mysql_num_fields(result);
				mysql_num_rows(result);
				mysql_select_db(connection,database);
				mysql_field_name(result,column_index);
				mysql_free_result(result);
				mysql_close(connection);
			In order to build with MySQL support, define the HAVE_MYSQL preprocessor directive in your build configuration.
			You must have the MySQL headers and libraries installed. 
			Only really tested with dynamically linking mysql libraries on Linux.
			
	Added:	pol/network/auxclient.h
  Changed:	pol/network/auxclient.cpp pol/module/osmod.cpp pol/module/osmod.h clib/socketsvc.cpp clib/socketsvc.h
  			Moved AuxClient-related classes to its own header file (shared between auxclient.cpp and osmod.cpp)
  			Implemented os::OpenConnection() to create outgoing TCP/IP connections. 
  			
  Changed:	runecl/runecl.cpp
  			Added the sql module to runecl to allow quick testing

  Changed:	pol/uoscrobj.cpp pol/mobile/charactr.cpp pol/mobile/character.h bscript/parser.cpp bscript/objmembers.h
  			Added read/write property "mountedsteps" for mobiles. Represents number of steps taken while character was mounted.

  Changed:	bscript/parser.cpp
  			Declaring an array only using "{}" will show a compiler warning; please explicitly state 'array', 'struct', or 'dictionary' 
  Changed:	pol/pol.cpp
  			If using Linux, remove pol.pid on shutdown of pol.

  Changed:	pol/uoexec.h pol/scrsched.cpp
  			Added script option "AUXSVC_ASSUME_STRING" which will allow aux service connections to send and receive non-packed strings.

  Changed:	ecompile/ecompile.cpp
  			If using Linux, a slash ("/") cannot be used to define ecompile options to allow support for absolute filenames.

  Changed:	bscript/object.cpp bscript/bobject.h
  			Implemented array operation MultiSubscript. Will return a splice of an array, eg:
  				array{"a","b","c","d","e"}[2,4] will return array{"b","c","d"}
2011-11-23 05:49:30 +00:00
frozenblit
eb61009c6e Fixed some possibilities of leaking if an exception was thrown and a few other warnings (all the rest, code analysis) 2010-07-10 20:02:50 +00:00
turley
007adac27e sync: shini: more 64bit stuff 2010-04-11 16:55:51 +00:00
turley
e10cd27cea sync: shini - long to int (prerequisit for 64-bit) 2010-03-29 14:52:03 +00:00
muaddib_pol
5740a51281 + Partial Network and Item code moved 2009-09-08 01:42:26 +00:00
Renamed from pol-core/pol/auxclient.cpp (Browse further)