Moved server/server_utilities up one directory
Also modified makefiles to account for the change.
This commit is contained in:
@@ -36,6 +36,7 @@ public:
|
|||||||
std::string GetUsername();
|
std::string GetUsername();
|
||||||
|
|
||||||
//database stuff
|
//database stuff
|
||||||
|
//TODO: rename Get* to GetIs*
|
||||||
bool GetBlackListed();
|
bool GetBlackListed();
|
||||||
bool GetWhiteListed();
|
bool GetWhiteListed();
|
||||||
bool GetModerator();
|
bool GetModerator();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../server_utilities ../../common/utilities
|
INCLUDES+=. .. ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../entities ../monsters ../rooms ../server_utilities ../triggers ../../common/gameplay ../../common/map ../../common/network ../../common/network/packet_types ../../common/utilities
|
INCLUDES+=. .. ../entities ../monsters ../rooms ../triggers ../../common/gameplay ../../common/map ../../common/network ../../common/network/packet_types ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
std::list<int> ClientManager::CheckConnections() {
|
std::list<int> ClientManager::CheckConnections() {
|
||||||
//list of clients to disconnect
|
//return a list of clients to disconnect
|
||||||
std::list<int> returnList;
|
std::list<int> returnList;
|
||||||
|
|
||||||
for (auto& it : elementMap) {
|
for (auto& it : elementMap) {
|
||||||
@@ -60,6 +60,7 @@ void ClientManager::HandlePong(ServerPacket* const argPacket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ClientManager::Create(IPaddress add) {
|
int ClientManager::Create(IPaddress add) {
|
||||||
|
//return the client's index
|
||||||
ClientData& client = elementMap[counter];
|
ClientData& client = elementMap[counter];
|
||||||
client.SetAddress(add);
|
client.SetAddress(add);
|
||||||
return counter++;
|
return counter++;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
//DOCS: The heartbeat system is built into ClientManager
|
||||||
|
|
||||||
class ClientManager: public Singleton<ClientManager> {
|
class ClientManager: public Singleton<ClientManager> {
|
||||||
public:
|
public:
|
||||||
//methods
|
//methods
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../server_utilities ../../common/network ../../common/network/packet_types ../../common/utilities
|
INCLUDES+=. .. ../../common/network ../../common/network/packet_types ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,5 @@
|
|||||||
#include directories
|
#include directories
|
||||||
INCLUDES+=. accounts characters clients entities rooms server_utilities triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
INCLUDES+=. accounts characters clients entities rooms triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
||||||
|
|
||||||
#libraries
|
#libraries
|
||||||
#the order of the $(LIBS) is important, at least for MinGW
|
#the order of the $(LIBS) is important, at least for MinGW
|
||||||
@@ -35,7 +35,6 @@ all: $(OBJ) $(OUT)
|
|||||||
$(MAKE) -C entities
|
$(MAKE) -C entities
|
||||||
# $(MAKE) -C monsters
|
# $(MAKE) -C monsters
|
||||||
$(MAKE) -C rooms
|
$(MAKE) -C rooms
|
||||||
$(MAKE) -C server_utilities
|
|
||||||
$(MAKE) -C triggers
|
$(MAKE) -C triggers
|
||||||
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../entities ../server_utilities ../../common/gameplay ../../common/utilities
|
INCLUDES+=. .. ../entities ../../common/gameplay ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ static int pumpMonsterUpdate(lua_State* L) {
|
|||||||
//TODO: (0) send the info about a specific monster instance
|
//TODO: (0) send the info about a specific monster instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: pump entity update
|
||||||
|
//TODO: save?
|
||||||
|
|
||||||
static const luaL_Reg networkLib[] = {
|
static const luaL_Reg networkLib[] = {
|
||||||
{"PumpCharacterUpdate", pumpCharacterUpdate},
|
{"PumpCharacterUpdate", pumpCharacterUpdate},
|
||||||
{"PumpMonsterUpdate", pumpMonsterUpdate},
|
{"PumpMonsterUpdate", pumpMonsterUpdate},
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../characters ../entities ../monsters ../server_utilities ../triggers ../../common/gameplay ../../common/map ../../common/utilities
|
INCLUDES+=. .. ../characters ../entities ../monsters ../triggers ../../common/gameplay ../../common/map ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,16 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
/*DOCS: each of these calls the next (diagram)
|
||||||
|
fullClientUnload()
|
||||||
|
-> fullAccountUnload()
|
||||||
|
-> fullCharacterUnload()
|
||||||
|
-> pumpPacketProximity()
|
||||||
|
|
||||||
|
copyCharacterToPacket() v1
|
||||||
|
-> copyCharacterToPacket() v2
|
||||||
|
*/
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//manager unload functions
|
//manager unload functions
|
||||||
//-------------------------
|
//-------------------------
|
||||||
@@ -112,12 +122,14 @@ void fullCharacterUnload(int index) {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
void pumpPacket(SerialPacket* const argPacket) {
|
void pumpPacket(SerialPacket* const argPacket) {
|
||||||
|
//send a message to all clients
|
||||||
for (auto& it : *ClientManager::GetSingleton().GetContainer()) {
|
for (auto& it : *ClientManager::GetSingleton().GetContainer()) {
|
||||||
UDPNetworkUtility::GetSingleton().SendTo(it.second.GetAddress(), argPacket);
|
UDPNetworkUtility::GetSingleton().SendTo(it.second.GetAddress(), argPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pumpPacketProximity(SerialPacket* const argPacket, int roomIndex, Vector2 position, int distance) {
|
void pumpPacketProximity(SerialPacket* const argPacket, int roomIndex, Vector2 position, int distance) {
|
||||||
|
//send this packet to all characters within a certain distance of a point in a room
|
||||||
RoomData* roomData = RoomManager::GetSingleton().Get(roomIndex);
|
RoomData* roomData = RoomManager::GetSingleton().Get(roomIndex);
|
||||||
|
|
||||||
if (!roomData) {
|
if (!roomData) {
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#config
|
|
||||||
INCLUDES+=. ../accounts ../characters ../clients ../entities ../monsters ../rooms ../triggers ../../common/gameplay ../../common/map ../../common/network ../../common/network/packet_types ../../common/utilities
|
|
||||||
LIBS+=
|
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
|
||||||
|
|
||||||
#source
|
|
||||||
CXXSRC=$(wildcard *.cpp)
|
|
||||||
|
|
||||||
#objects
|
|
||||||
OBJDIR=obj
|
|
||||||
OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o))
|
|
||||||
|
|
||||||
#output
|
|
||||||
OUTDIR=..
|
|
||||||
OUT=$(addprefix $(OUTDIR)/,server.a)
|
|
||||||
|
|
||||||
#targets
|
|
||||||
all: $(OBJ) $(OUT)
|
|
||||||
ar -crs $(OUT) $(OBJ)
|
|
||||||
|
|
||||||
$(OBJ): | $(OBJDIR)
|
|
||||||
|
|
||||||
$(OUT): | $(OUTDIR)
|
|
||||||
|
|
||||||
$(OBJDIR):
|
|
||||||
mkdir $(OBJDIR)
|
|
||||||
|
|
||||||
$(OUTDIR):
|
|
||||||
mkdir $(OUTDIR)
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../entities ../server_utilities ../../common/utilities
|
INCLUDES+=. .. ../entities ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user