Skip to content

exababy/mysql_mm

Repository files navigation

MySQLMM

MySQLMM is a simple non-blocking MySQL connector for MetaMod.

Features

  • Non-blocking MySQL queries
  • Windows & Linux support
  • Simple API

Interface

MySQLMM will expose an interface in OnMetamodQuery which can then be queried with (IMySQLClient*)g_SMAPI->MetaFactory(MYSQLMM_INTERFACE, &ret, NULL); by other plugins.

struct MySQLConnectionInfo
{
	const char* host;
	const char* user;
	const char* pass;
	const char* database;
	int port = 3306;
	int timeout = 60;
};

class IMySQLConnection
{
public:
	virtual void Connect(ConnectCallbackFunc callback) = 0;
	virtual void Query(char* query, QueryCallbackFunc callback) = 0;
	virtual void Query(const char* query, QueryCallbackFunc callback) = 0;
	virtual void Destroy() = 0;
};

class IMySQLClient
{
public:
	virtual IMySQLConnection* CreateMySQLConnection(MySQLConnectionInfo info) = 0;
};

Compilation

Requirements

Instructions

Follow the instructions below to compile CS2Fixes.

git clone https://github.com/Poggicek/mysql_mm && cd mysql_mm

export MMSOURCE112=/path/to/metamod/
export HL2SDKCS2=/path/to/hl2sdk-cs2

mkdir build && cd build
python3 ../configure.py -s cs2
ambuild

Important

Linux build requires libmysqlclient-dev package to be installed.

About

MySQL Connector for MetaMod

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 52.6%
  • C++ 47.4%