This is a bare bones query manager that will respond just enough queries to get the server running. The overall structure of the tables should be almost set but we'd need to handle all queries to get the server running properly. It uses the SQLite3 3.50.2 amalgamation for a database backend so we can completely avoid having to spin up yet another service for a separate database system, effectively turning the query manager into the database itself. This also means that other services such as the login server and website must go through it to access the data but it shouldn't be too difficult to replicate the querying mechanism from the server. This design choice was made with a single game server in mind. The networking protocol is NOT encrypted at all and won't accept remote connections. For a fully multi-world distributed infrastructure, a distributed database system like PostgreSQL and MySQL should be considered.
45 lines
1.0 KiB
Makefile
45 lines
1.0 KiB
Makefile
SRCDIR = src
|
|
BUILDDIR = build
|
|
OUTPUTEXE = querymanager
|
|
|
|
CC = gcc
|
|
CXX = g++
|
|
CFLAGS = -m64 -fno-strict-aliasing -pedantic -Wall -Wextra -pthread
|
|
CXXFLAGS = $(CFLAGS) --std=c++11
|
|
LFLAGS = -Wl,-t
|
|
|
|
DEBUG ?= 0
|
|
ifneq ($(DEBUG), 0)
|
|
CFLAGS += -g -O0
|
|
CXXFLAGS += -g -O0
|
|
else
|
|
CFLAGS += -O2
|
|
CXXFLAGS += -O2
|
|
endif
|
|
|
|
$(BUILDDIR)/$(OUTPUTEXE): $(BUILDDIR)/connections.obj $(BUILDDIR)/database.obj $(BUILDDIR)/querymanager.obj $(BUILDDIR)/sqlite3.obj
|
|
@mkdir -p $(@D)
|
|
$(CXX) $(CXXFLAGS) -o $@ $^ $(LFLAGS)
|
|
|
|
$(BUILDDIR)/connections.obj: $(SRCDIR)/connections.cc $(SRCDIR)/querymanager.hh
|
|
@mkdir -p $(@D)
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
|
|
|
$(BUILDDIR)/database.obj: $(SRCDIR)/database.cc $(SRCDIR)/querymanager.hh
|
|
@mkdir -p $(@D)
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
|
|
|
$(BUILDDIR)/querymanager.obj: $(SRCDIR)/querymanager.cc $(SRCDIR)/querymanager.hh
|
|
@mkdir -p $(@D)
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
|
|
|
$(BUILDDIR)/sqlite3.obj: $(SRCDIR)/sqlite3.c $(SRCDIR)/sqlite3.h
|
|
@mkdir -p $(@D)
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
@rm -rf $(BUILDDIR)
|
|
|