Merge branch 'bugfix-lambda' into develop
This commit is contained in:
@@ -200,7 +200,7 @@ void AccountManager::UnloadAll() {
|
|||||||
elementMap.clear();
|
elementMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountManager::UnloadIf(std::function<bool(std::pair<const int, AccountData>)> fn) {
|
void AccountManager::UnloadIf(std::function<bool(std::pair<const int, AccountData const&>)> fn) {
|
||||||
//replicate std::remove_if, using custom code
|
//replicate std::remove_if, using custom code
|
||||||
std::map<int, AccountData>::iterator it = elementMap.begin();
|
std::map<int, AccountData>::iterator it = elementMap.begin();
|
||||||
while (it != elementMap.end()) {
|
while (it != elementMap.end()) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
void Delete(int uid);
|
void Delete(int uid);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, AccountData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, AccountData const&>)> fn);
|
||||||
|
|
||||||
//accessors and mutators
|
//accessors and mutators
|
||||||
AccountData* Get(int uid);
|
AccountData* Get(int uid);
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ void CharacterManager::UnloadAll() {
|
|||||||
elementMap.clear();
|
elementMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterManager::UnloadIf(std::function<bool(std::pair<const int, CharacterData>)> fn) {
|
void CharacterManager::UnloadIf(std::function<bool(std::pair<const int, CharacterData const&>)> fn) {
|
||||||
std::map<int, CharacterData>::iterator it = elementMap.begin();
|
std::map<int, CharacterData>::iterator it = elementMap.begin();
|
||||||
while (it != elementMap.end()) {
|
while (it != elementMap.end()) {
|
||||||
if (fn(*it)) {
|
if (fn(*it)) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
void Delete(int uid);
|
void Delete(int uid);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, CharacterData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, CharacterData const&>)> fn);
|
||||||
|
|
||||||
//accessors and mutators
|
//accessors and mutators
|
||||||
CharacterData* Get(int uid);
|
CharacterData* Get(int uid);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void ClientManager::UnloadAll() {
|
|||||||
elementMap.clear();
|
elementMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientManager::UnloadIf(std::function<bool(std::pair<const int, ClientData>)> fn) {
|
void ClientManager::UnloadIf(std::function<bool(std::pair<const int, ClientData const&>)> fn) {
|
||||||
std::map<int, ClientData>::iterator it = elementMap.begin();
|
std::map<int, ClientData>::iterator it = elementMap.begin();
|
||||||
while (it != elementMap.end()) {
|
while (it != elementMap.end()) {
|
||||||
if (fn(*it)) {
|
if (fn(*it)) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
void Unload(int uid);
|
void Unload(int uid);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, ClientData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, ClientData const&>)> fn);
|
||||||
|
|
||||||
//accessors & mutators
|
//accessors & mutators
|
||||||
ClientData* Get(int uid);
|
ClientData* Get(int uid);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void MonsterManager::UnloadAll() {
|
|||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonsterManager::UnloadIf(std::function<bool(std::pair<const int, MonsterData>)> fn) {
|
void MonsterManager::UnloadIf(std::function<bool(std::pair<const int, MonsterData const&>)> fn) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
void Delete(int uid);
|
void Delete(int uid);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, MonsterData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, MonsterData const&>)> fn);
|
||||||
|
|
||||||
//accessors & mutators
|
//accessors & mutators
|
||||||
MonsterData* Get(int uid);
|
MonsterData* Get(int uid);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void RoomManager::UnloadAll() {
|
|||||||
elementMap.clear();
|
elementMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomManager::UnloadIf(std::function<bool(std::pair<const int,RoomData>)> fn) {
|
void RoomManager::UnloadIf(std::function<bool(std::pair<const int, RoomData const&>)> fn) {
|
||||||
std::map<int, RoomData>::iterator it = elementMap.begin();
|
std::map<int, RoomData>::iterator it = elementMap.begin();
|
||||||
while (it != elementMap.end()) {
|
while (it != elementMap.end()) {
|
||||||
if (fn(*it)) {
|
if (fn(*it)) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
int Create(std::string name, std::string tileset);
|
int Create(std::string name, std::string tileset);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int,RoomData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, RoomData const&>)> fn);
|
||||||
|
|
||||||
//accessors and mutators
|
//accessors and mutators
|
||||||
RoomData* Get(int uid);
|
RoomData* Get(int uid);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void ServerApplication::HandleShutdownRequest(ClientPacket* const argPacket) {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
void ServerApplication::FullClientUnload(int index) {
|
void ServerApplication::FullClientUnload(int index) {
|
||||||
clientMgr.UnloadIf([&](std::pair<const int, ClientData> client) -> bool {
|
clientMgr.UnloadIf([&](std::pair<const int, ClientData const&> client) -> bool {
|
||||||
//skip the wrong clients
|
//skip the wrong clients
|
||||||
if (client.first != index) {
|
if (client.first != index) {
|
||||||
return false;
|
return false;
|
||||||
@@ -120,7 +120,7 @@ void ServerApplication::FullClientUnload(int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ServerApplication::FullAccountUnload(int index) {
|
void ServerApplication::FullAccountUnload(int index) {
|
||||||
accountMgr.UnloadIf([&](std::pair<const int, AccountData> account) -> bool {
|
accountMgr.UnloadIf([&](std::pair<const int, AccountData const&> account) -> bool {
|
||||||
//skip the wrong accounts
|
//skip the wrong accounts
|
||||||
if (account.first != index) {
|
if (account.first != index) {
|
||||||
return false;
|
return false;
|
||||||
@@ -143,7 +143,7 @@ void ServerApplication::FullAccountUnload(int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ServerApplication::FullCharacterUnload(int index) {
|
void ServerApplication::FullCharacterUnload(int index) {
|
||||||
characterMgr.UnloadIf([&](std::pair<const int, CharacterData> character) -> bool {
|
characterMgr.UnloadIf([&](std::pair<const int, CharacterData const&> character) -> bool {
|
||||||
//skip the wrong characters
|
//skip the wrong characters
|
||||||
if (character.first != index) {
|
if (character.first != index) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void WaypointManager::UnloadAll() {
|
|||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaypointManager::UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn) {
|
void WaypointManager::UnloadIf(std::function<bool(std::pair<const int, WaypointData const&>)> fn) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
void Delete(int uid);
|
void Delete(int uid);
|
||||||
|
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn);
|
void UnloadIf(std::function<bool(std::pair<const int, WaypointData const&>)> fn);
|
||||||
|
|
||||||
//accessors & mutators
|
//accessors & mutators
|
||||||
WaypointData* Get(int uid);
|
WaypointData* Get(int uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user