Merge branch 'master' into drunk

This commit is contained in:
2016-12-09 18:36:00 +11:00
4 changed files with 33 additions and 8 deletions
+6 -1
View File
@@ -43,6 +43,11 @@ std::list<int> ClientManager::CheckConnections() {
for (auto& it : elementMap) {
if (it.second.GetAttempts() > 2) {
returnList.push_back(it.first);
//send the drop message
ServerPacket newPacket;
newPacket.type = SerialPacketType::ADMIN_DISCONNECT_FORCED;
UDPNetworkUtility::GetSingleton().SendTo(it.second.GetAddress(), &newPacket);
}
}
@@ -106,4 +111,4 @@ int ClientManager::GetTotalCount() {
std::map<int, ClientData>* ClientManager::GetContainer() {
return &elementMap;
}
}
+4 -4
View File
@@ -50,6 +50,9 @@ void TriggerManager::Compare(std::stack<Entity*> entityStack) {
continue;
}
//push to the exclusion list
triggerPair.second.GetExclusionList()->push_back(entity);
//run the trigger script
lua_rawgeti(lua, LUA_REGISTRYINDEX, triggerPair.second.GetScriptReference());
lua_pushlightuserdata(lua, entity);
@@ -58,13 +61,10 @@ void TriggerManager::Compare(std::stack<Entity*> entityStack) {
//error
throw(std::runtime_error(std::string() + "Lua error: " + lua_tostring(lua, -1) ));
}
//push to the exclusion list
triggerPair.second.GetExclusionList()->push_back(entity);
}
else {
//remove members of the exclusion list
//NOTE: characters in different rooms won't be removed, but that shouldn't be a problem
//NOTE: characters in different rooms won't be removed, which does tend to be a problem
triggerPair.second.GetExclusionList()->remove_if([entity](Entity* ptr) -> bool {
return entity == ptr;
});