polserver/pol-core/pol/module/sqlmod.h
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

68 lines
1.8 KiB
C++

/** @file
*
* @par History
*/
#ifndef SQLMOD_H
#define SQLMOD_H
#include <string>
#include "../polmodl.h"
#include "../uoexec.h"
namespace Pol
{
namespace Bscript
{
class BObjectImp;
class Executor;
class ObjArray;
} // namespace Bscript
namespace Core
{
class UOExecutor;
} // namespace Core
} // namespace Pol
template <class T>
class weak_ptr;
namespace Pol
{
namespace Core
{
class BSQLConnection;
}
namespace Module
{
class SQLExecutorModule : public Bscript::TmplExecutorModule<SQLExecutorModule, Core::PolModule>
{
public:
SQLExecutorModule( Bscript::Executor& exec );
Bscript::BObjectImp* mf_mysql_connect();
Bscript::BObjectImp* mf_mysql_query();
Bscript::BObjectImp* mf_mysql_close();
Bscript::BObjectImp* mf_mysql_num_fields();
Bscript::BObjectImp* mf_mysql_affected_rows();
Bscript::BObjectImp* mf_mysql_fetch_row();
Bscript::BObjectImp* mf_mysql_num_rows();
Bscript::BObjectImp* mf_mysql_select_db();
Bscript::BObjectImp* mf_mysql_field_name();
static Bscript::BObjectImp* background_connect( weak_ptr<Core::UOExecutor> uoexec,
const std::string host,
const std::string username,
const std::string password );
static Bscript::BObjectImp* background_select( weak_ptr<Core::UOExecutor> uoexec,
Core::BSQLConnection* sql, const std::string db );
static Bscript::BObjectImp* background_query( weak_ptr<Core::UOExecutor> uoexec,
Core::BSQLConnection* sql, const std::string query,
const Bscript::ObjArray* params );
virtual size_t sizeEstimate() const override;
};
} // namespace Module
} // namespace Pol
#endif