Commit graph

35 commits

Author SHA1 Message Date
turleypol
41ec375f7a stumbled across pre c++14 code 2020-04-19 13:34:20 +02: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
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
a5e6206164 Added cmake option to run clang-tidy
used everywhere nullptr
2018-10-09 16:36:35 +02: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
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
38829b0d24 minor fix in sql module parameter length check 2017-07-29 19:45:21 +02: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
Gabriele Tozzi
decfa4eee7 Added some documentation over GCC 4.8 compatibility mod 2016-01-20 00:17:35 +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
Gabriele Tozzi
1159d45791 Minor: using unique_ptr instead of raw_ptr+malloc+free 2016-01-10 11:48:59 +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
45dc8c2bf8 Added: mysql_query() now supports a "parameters" (array) argument
It can be used to safely replace "?" placeholders inside the query
with the given array entries.
2015-11-01 21:00:06 +01:00
Thomas Volkert
795e95a01f Fixed compile issue when using mysql 2015-10-31 23:37:38 +01: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
f6be3f99e3 corrected some compiler warnings with eg Wextra 2015-05-24 10:44:00 +02:00
turley
b94b3aa3d5 Moved defines from ucfg.h into uconst.h
more header cleanup
2015-01-02 19:11:57 +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
943b820eba More and more cleanups
Added some missing include guards, corrected wrong include guard names.
Removed more stl_inc.h includes.
2014-11-02 19:40:40 +01:00
turley
e0b722a93b fixed several uninitialized variables 2014-08-30 12:25:08 +02:00
turley
270552eb69 sql functions connect, select and query perform the communication part in background while script itself is stopped (like eg Target()). Which means that these time consuming functions do not block the complete shard. Removed sql module from runecl, since it no more compatible. 2014-03-15 08:45:22 +00:00
turley
91d6765bff missing nullptr check 2014-02-08 11:34:09 +00:00
turley
dc2f993d09 wait for loggingfacility on server crash
made the sql module at least a bit more scriptfriendly: its now save to pass sql objects as parameters, result objects get automatically freed. Thus also removed the mysql_free_result function.
mysql_close is also now senseless, but kept for the guys who want to close the connection direct.
All I could do in half an hour sorry..
Never ever pass a C API directly into a scripting language!
And now the complete class: "Never ever ..."
2014-01-20 19:14:20 +00:00
turley
b3eeb60ff3 mysql module is not really usable... :(
Added a quick&dirty connection wrapper guard, so the connection object can be copied aka given as function parameter.
Result stuff needs to be also wrapped, every 5 minutes my server crashed while playing around with it, since some functions secretly create objects which needs to be destructed in a discrete order...
bool check of the Connection object is now not always true, instead only true if connection is still active.
2014-01-19 12:12:51 +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
KevinEady
98ec1bc528 Fixed: bug in mysql_select_db() returning error on successful calls
Fixed:      adding missing mysql_free_result() entry to sql.em
2013-05-25 19:57:00 +00:00
turley
d53a2a0b4e added sql support for windows, static linking in windows sucks with mysql so additional dll is required 2011-12-29 12:28:48 +00:00
KevinEady
53be40324f removed hard-coded username and password (oopsies); removed debugging output on destructor. 2011-11-23 06:57:34 +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