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();
|
||||
|
||||
//database stuff
|
||||
//TODO: rename Get* to GetIs*
|
||||
bool GetBlackListed();
|
||||
bool GetWhiteListed();
|
||||
bool GetModerator();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#config
|
||||
INCLUDES+=. ../server_utilities ../../common/utilities
|
||||
INCLUDES+=. .. ../../common/utilities
|
||||
LIBS+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#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+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <chrono>
|
||||
|
||||
std::list<int> ClientManager::CheckConnections() {
|
||||
//list of clients to disconnect
|
||||
//return a list of clients to disconnect
|
||||
std::list<int> returnList;
|
||||
|
||||
for (auto& it : elementMap) {
|
||||
@@ -60,6 +60,7 @@ void ClientManager::HandlePong(ServerPacket* const argPacket) {
|
||||
}
|
||||
|
||||
int ClientManager::Create(IPaddress add) {
|
||||
//return the client's index
|
||||
ClientData& client = elementMap[counter];
|
||||
client.SetAddress(add);
|
||||
return counter++;
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
//DOCS: The heartbeat system is built into ClientManager
|
||||
|
||||
class ClientManager: public Singleton<ClientManager> {
|
||||
public:
|
||||
//methods
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#config
|
||||
INCLUDES+=. ../server_utilities ../../common/network ../../common/network/packet_types ../../common/utilities
|
||||
INCLUDES+=. .. ../../common/network ../../common/network/packet_types ../../common/utilities
|
||||
LIBS+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
+1
-2
@@ -1,5 +1,5 @@
|
||||
#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
|
||||
#the order of the $(LIBS) is important, at least for MinGW
|
||||
@@ -35,7 +35,6 @@ all: $(OBJ) $(OUT)
|
||||
$(MAKE) -C entities
|
||||
# $(MAKE) -C monsters
|
||||
$(MAKE) -C rooms
|
||||
$(MAKE) -C server_utilities
|
||||
$(MAKE) -C triggers
|
||||
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#config
|
||||
INCLUDES+=. ../entities ../server_utilities ../../common/gameplay ../../common/utilities
|
||||
INCLUDES+=. .. ../entities ../../common/gameplay ../../common/utilities
|
||||
LIBS+=
|
||||
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: pump entity update
|
||||
//TODO: save?
|
||||
|
||||
static const luaL_Reg networkLib[] = {
|
||||
{"PumpCharacterUpdate", pumpCharacterUpdate},
|
||||
{"PumpMonsterUpdate", pumpMonsterUpdate},
|
||||
@@ -1,5 +1,5 @@
|
||||
#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+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
@@ -29,6 +29,16 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
/*DOCS: each of these calls the next (diagram)
|
||||
fullClientUnload()
|
||||
-> fullAccountUnload()
|
||||
-> fullCharacterUnload()
|
||||
-> pumpPacketProximity()
|
||||
|
||||
copyCharacterToPacket() v1
|
||||
-> copyCharacterToPacket() v2
|
||||
*/
|
||||
|
||||
//-------------------------
|
||||
//manager unload functions
|
||||
//-------------------------
|
||||
@@ -112,12 +122,14 @@ void fullCharacterUnload(int index) {
|
||||
//-------------------------
|
||||
|
||||
void pumpPacket(SerialPacket* const argPacket) {
|
||||
//send a message to all clients
|
||||
for (auto& it : *ClientManager::GetSingleton().GetContainer()) {
|
||||
UDPNetworkUtility::GetSingleton().SendTo(it.second.GetAddress(), argPacket);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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
|
||||
INCLUDES+=. ../entities ../server_utilities ../../common/utilities
|
||||
INCLUDES+=. .. ../entities ../../common/utilities
|
||||
LIBS+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user