Moved map and character management to server_data.cpp

This commit is contained in:
Kayne Ruse
2014-12-09 00:41:09 +11:00
parent de4e539449
commit dbd1289ced
5 changed files with 229 additions and 185 deletions
+20 -1
View File
@@ -31,4 +31,23 @@ bool operator==(IPaddress lhs, IPaddress rhs) {
bool operator!=(IPaddress lhs, IPaddress rhs) {
return !(lhs == rhs);
}
}
//-------------------------
//Packet pumps
//-------------------------
void ServerApplication::PumpPacket(SerialPacket* const argPacket) {
for (auto& it : *clientMgr.GetContainer()) {
network.SendTo(it.second.GetAddress(), argPacket);
}
}
void ServerApplication::PumpPacketProximity(SerialPacket* const argPacket, int roomIndex, int x, int y, int radius) {
//TODO: PumpPacketProximity
//for position (roomIndex, x, y), find all characters within that distance
//find that character's owner
//find that account's client
//send the packet to that client
//NOTE: this is perhaps too complex; I write it if I need it
}