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!
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...
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 ..."
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.
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"}