Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 35 additions & 36 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,58 +1,57 @@
noinst_PROGRAMS = theforgottenserver

CXXFLAGS = -g -O1
CXXFLAGS = -pipe -g
AM_CXXFLAGS = $(XML_CPPFLAGS) $(OTSERV_FLAGS) $(LUA_CFLAGS) $(DEBUG_FLAGS)\
$(MYSQL_FLAGS) $(SQLITE_FLAGS) $(ODBC_FLAGS) $(PGSQL_FLAGS)\
$(PROFILER_FLAGS) $(OPTIONAL_FLAGS) -D_THREAD_SAFE -D_REENTRANT -Wall
$(MYSQL_FLAGS) $(MYSQLPP_FLAGS) $(SQLITE_FLAGS) $(PGSQL_FLAGS) $(PROFILER_FLAGS)\
$(OPTIONAL_FLAGS) -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing

theforgottenserver_LDADD = $(LUA_LIBS)

if USE_MYSQL
MAYBE_MYSQL = databasemysql.cpp databasemysql.h
endif
if USE_MYSQLPP
MAYBE_MYSQLPP = databasemysqlpp.cpp databasemysqlpp.h
endif
if USE_SQLITE
MAYBE_SQLITE = databasesqlite.cpp databasesqlite.h
endif
if USE_PGSQL
MAYBE_PGSQL = databasepgsql.cpp databasepgsql.h
endif
if USE_ODBC
MAYBE_ODBC = databaseodbc.cpp databaseodbc.h
endif
if LOGIN_SERVER
MAYBE_LOGIN = gameservers.cpp gameservers.h
endif
if REMOTE_CONTROL
MAYBE_REMOTE = admin.cpp admin.h
if OT_ADMIN
MAYBE_OTADMIN = admin.cpp admin.h
endif

theforgottenserver_SOURCES = account.h actions.cpp actions.h $(MAYBE_REMOTE) \
theforgottenserver_SOURCES = account.h actions.cpp actions.h $(MAYBE_OTADMIN) \
allocator.cpp allocator.h baseevents.cpp baseevents.h beds.cpp \
beds.h chat.cpp chat.h combat.cpp combat.h condition.cpp condition.h \
config.h configmanager.cpp configmanager.h connection.cpp \
connection.h const.h container.cpp container.h creature.cpp \
creature.h creatureevent.cpp creatureevent.h cylinder.cpp cylinder.h \
database.cpp database.h databasemanager.cpp databasemanager.h \
$(MAYBE_MYSQL) $(MAYBE_SQLITE) $(MAYBE_PGSQL) $(MAYBE_ODBC) \
depot.cpp depot.h exception.cpp exception.h fileloader.cpp \
fileloader.h game.cpp game.h $(MAYBE_LOGIN) globalevent.cpp \
globalevent.h group.cpp group.h gui.cpp gui.h house.cpp house.h \
housetile.cpp housetile.h inputbox.cpp inputbox.h ioban.cpp ioban.h \
ioguild.cpp ioguild.h iologindata.cpp iologindata.h iomap.cpp \
iomapserialize.cpp iomapserialize.h item.cpp item.h itemattributes.cpp \
itemattributes.h items.cpp items.h luascript.cpp luascript.h \
mailbox.cpp mailbox.h map.cpp map.h md5.cpp md5.h monster.cpp \
monster.h monsters.cpp monsters.h movement.cpp movement.h \
networkmessage.cpp networkmessage.h npc.cpp npc.h otpch.h \
otserv.cpp otsystem.h outfit.cpp outfit.h outputmessage.cpp \
outputmessage.h party.cpp party.h playerbox.cpp playerbox.h \
player.cpp player.h position.cpp position.h protocol.cpp protocol.h \
protocolgame.cpp protocolgame.h protocollogin.cpp protocollogin.h \
protocolold.cpp protocolold.h quests.cpp quests.h raids.cpp raids.h \
resources.h rsa.cpp rsa.h scheduler.cpp scheduler.h scriptmanager.cpp \
scriptmanager.h server.cpp server.h sha1.cpp sha1.h spawn.cpp spawn.h \
spells.cpp spells.h status.cpp status.h talkaction.cpp talkaction.h \
tasks.cpp tasks.h teleport.cpp teleport.h templates.h textlogger.cpp \
textlogger.h thing.cpp thing.h tile.cpp tile.h tools.cpp tools.h \
town.h trashholder.cpp trashholder.h waitlist.cpp waitlist.h \
waypoints.h weapons.cpp weapons.h vocation.cpp vocation.h
config.h configmanager.cpp configmanager.h connection.cpp connection.h \
const.h container.cpp container.h creature.cpp creature.h \
creatureevent.cpp creatureevent.h cylinder.cpp cylinder.h database.cpp \
database.h databasemanager.cpp databasemanager.h $(MAYBE_MYSQL) \
$(MAYBE_MYSQLPP) $(MAYBE_SQLITE) $(MAYBE_PGSQL) depot.cpp depot.h \
dispatcher.cpp dispatcher.h exception.cpp exception.h fileloader.cpp \
fileloader.h game.cpp game.h $(MAYBE_LOGIN) globalevent.cpp globalevent.h \
group.cpp group.h house.cpp house.h housetile.cpp housetile.h ioban.cpp \
ioban.h ioguild.cpp ioguild.h iologindata.cpp iologindata.h iomap.cpp \
iomap.h iomapserialize.cpp iomapserialize.h iomarket.cpp iomarket.h \
item.cpp item.h itemattributes.cpp itemattributes.h items.cpp items.h \
luascript.cpp luascript.h mailbox.cpp mailbox.h manager.cpp manager.h \
map.cpp map.h monster.cpp monster.h monsters.cpp monsters.h mounts.cpp \
mounts.h movement.cpp movement.h networkmessage.cpp networkmessage.h \
npc.cpp npc.h otpch.h otserv.cpp otsystem.h outfit.cpp outfit.h \
outputmessage.cpp outputmessage.h party.cpp party.h player.cpp player.h \
position.cpp position.h protocol.cpp protocol.h protocolgame.cpp \
protocolgame.h protocolhttp.cpp protocolhttp.h protocollogin.cpp \
protocollogin.h protocolold.cpp protocolold.h quests.cpp quests.h \
raids.cpp raids.h scheduler.cpp scheduler.h scriptmanager.cpp \
scriptmanager.h server.cpp server.h spawn.cpp spawn.h spells.cpp \
spells.h status.cpp status.h talkaction.cpp talkaction.h teleport.cpp \
teleport.h templates.h textlogger.cpp textlogger.h thing.cpp thing.h \
tile.cpp tile.h tools.cpp tools.h town.h trashholder.cpp trashholder.h \
waitlist.cpp waitlist.h waypoints.h weapons.cpp weapons.h vocation.cpp \
vocation.h
69 changes: 69 additions & 0 deletions Makefile.mingw
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Makefile for Windows (MinGW)
# Copyright (C) 2011 Fallen <janneangeselva@hotmail.com>
CXX = @echo Compiling $< && g++

CXXFLAGS = -O2 -Wall -Wno-strict-aliasing -D_THREAD_SAFE -D_REENTRANT -D__ENABLE_SERVER_DIAGNOSTIC__ -D__NO_CRYPTOPP__

LIBS = -llua5.1 -lboost_system -lboost_thread -lboost_regex -lboost_filesystem -leay32 -lxml2 -lws2_32 -lwsock32

ifdef USE_MYSQL
MAYBE_MYSQL = databasemysql.cpp
CXXFLAGS += -D__USE_MYSQL__
LIBS += -lmysql
endif
ifdef USE_SQLITE
MAYBE_SQLITE = databasesqlite.cpp
CXXFLAGS += -D__USE_SQLITE__
LIBS += -lsqlite3
endif
ifdef USE_PGSQL
MAYBE_PGSQL = databasepgsql.cpp
endif
ifdef LOGIN_SERVER
MAYBE_LOGIN = gameservers.cpp
endif
ifdef OT_ADMIN
MAYBE_OTADMIN = admin.cpp
endif

SRC = weapons.cpp waitlist.cpp vocation.cpp trashholder.cpp tools.cpp \
tile.cpp thing.cpp textlogger.cpp teleport.cpp talkaction.cpp \
status.cpp spells.cpp spawn.cpp server.cpp scriptmanager.cpp \
scheduler.cpp raids.cpp quests.cpp protocolold.cpp protocollogin.cpp \
protocolhttp.cpp protocolgame.cpp protocol.cpp position.cpp player.cpp \
party.cpp outputmessage.cpp outfit.cpp otserv.cpp npc.cpp \
networkmessage.cpp movement.cpp mounts.cpp monsters.cpp monster.cpp \
map.cpp manager.cpp mailbox.cpp luascript.cpp items.cpp \
itemattributes.cpp item.cpp iomarket.cpp iomapserialize.cpp iomap.cpp \
iologindata.cpp ioguild.cpp ioban.cpp housetile.cpp house.cpp group.cpp \
globalevent.cpp gameservers.cpp game.cpp fileloader.cpp exception.cpp \
dispatcher.cpp depot.cpp databasemanager.cpp database.cpp cylinder.cpp \
creatureevent.cpp creature.cpp container.cpp connection.cpp configmanager.cpp \
condition.cpp combat.cpp chat.cpp beds.cpp baseevents.cpp allocator.cpp admin.cpp \
actions.cpp $(MAYBE_MYSQL) $(MAYBE_SQLITE) $(MAYBE_PGSQL) \
$(MAYBE_LOGIN) $(MAYBE_OTADMIN)

INCPATH = -I"."

LFLAGS = -enable-stdcall-fixup -enable-auto-import -enable-runtime-pseudo-reloc $(CXXFLAGS)

DEL = del

TARGET = theforgottenserver

OBJDIR = obj

OBJ = $(SRC:%.cpp=$(OBJDIR)/%.o)

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJ)
$(CXX) $(LFLAGS) -o $@ $(OBJ) $(LIBS)

$(OBJDIR)/%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

clean:
-$(DEL) $(OBJ) $(TARGET)
23 changes: 17 additions & 6 deletions account.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,30 @@

typedef std::list<std::string> Characters;
#else
#include "gameservers.h"
typedef std::map<std::string, GameServer*> Characters;
class GameServer;
struct Character
{
Character(): server(NULL), status(0) {}
Character(const std::string& _name, GameServer* _server, int8_t _status):
name(_name), server(_server), status(_status) {}

std::string name;
GameServer* server;
int8_t status;
};

typedef std::map<std::string, Character> Characters;
#endif

class Account
{
public:
Account() {number = premiumDays = lastDay = warnings = 0;}
Account() {premiumDays = warnings = number = lastDay = 0;}
virtual ~Account() {charList.clear();}

uint32_t number, premiumDays, lastDay;
int32_t warnings;
std::string name, password, recoveryKey;
uint16_t premiumDays, warnings;
uint32_t number, lastDay;
std::string name, password, recoveryKey, salt;
Characters charList;
};
#endif
Loading