tinymux/mux/modules/sqlproxy/sqlproxy.cpp
Stephen Dennis 4ff1398de1 Restructure mux/ directory: component-based layout with proper build root
Move from flat mux/src/ layout to clean component hierarchy:
- mux/ is now the autoconf/automake build root (configure.ac lives here)
- mux/include/ — shared headers used by multiple components
- mux/lib/ — libmux.so (core utilities, no game state)
- mux/src/ — netmux driver only (thin networking shell)
- mux/modules/engine/ — engine.so (game logic)
- mux/modules/{comsys,mail,exp3,sqlproxy,sqlslave}/ — external modules
- mux/ganl/ — GANL networking library
- mux/sqlite/ — SQLite amalgamation (builds libsqlite3.a)
- mux/announce/ — announce tool (was mux/src/tools/)

Build changes:
- SUBDIRS ordering: ganl sqlite lib src modules announce
- libmux.so gets -Wl,-soname,libmux.so; netmux links via -L -lmux
- engine.so links libsqlite3.a and libmux.so with -Wl,--no-undefined
- RPATH uses $ORIGIN for portable .so resolution
- Install hooks use absolute paths for game/bin symlinks

Bug fixes:
- engine.so mux_Register() now passes nullptr to mux_RegisterClassObjects
  (matches all other modules; libmux already has the factory via dlsym)
- DbConvert() now calls pcache_init() before db_write, fixing a latent
  crash (free(): invalid pointer) when exporting from SQLite databases

411/411 smoke tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:38:37 -06:00

47 lines
1,000 B
C++

/*! \file sqlproxy.cpp
* \brief SQLProxy Module
*
* With standard marshaling, the IQueryControl proxy/stub lives in libmux.
* This module is retained as an empty shell for backward compatibility
* with configurations that load it.
*/
#include "autoconf.h"
#include "config.h"
#include "libmux.h"
#include "modules.h"
static int32_t g_cServerLocks = 0;
// The following four functions are for access by dlopen.
//
extern "C" MUX_RESULT DCL_EXPORT DCL_API mux_CanUnloadNow(void)
{
if (0 == g_cServerLocks)
{
return MUX_S_OK;
}
else
{
return MUX_S_FALSE;
}
}
extern "C" MUX_RESULT DCL_EXPORT DCL_API mux_GetClassObject(MUX_CID cid, MUX_IID iid, void **ppv)
{
UNUSED_PARAMETER(cid);
UNUSED_PARAMETER(iid);
UNUSED_PARAMETER(ppv);
return MUX_E_CLASSNOTAVAILABLE;
}
extern "C" MUX_RESULT DCL_EXPORT DCL_API mux_Register(void)
{
return MUX_S_OK;
}
extern "C" MUX_RESULT DCL_EXPORT DCL_API mux_Unregister(void)
{
return MUX_S_OK;
}