Merge branch 'master' into drunk
This commit is contained in:
@@ -33,3 +33,15 @@ Instructions For Setup
|
||||
from the main menu; this displays the list of available servers.
|
||||
7. Select the name of a server (default is 'Public') and select 'Join'.
|
||||
8. Welcome to Tortuga, enjoy your stay.
|
||||
|
||||
-------------------------
|
||||
Linux Users
|
||||
-------------------------
|
||||
|
||||
Before running this on linux, you may need to run the following commands:
|
||||
|
||||
sudo apt-get install libsdl2-net-2.0-0
|
||||
sudo apt-get install libsdl2-image-2.0-0
|
||||
sudo apt-get install libsdl2-ttf-2.0-0
|
||||
|
||||
|
||||
|
||||
@@ -60,12 +60,16 @@ function doorUtility.CreateDoorPair(handle, roomOne, Xone, Yone, roomTwo, Xtwo,
|
||||
|
||||
--move the character
|
||||
characterAPI.SetRoom(entity, roomTwo)
|
||||
characterAPI.SetOrigin(entity, Xtwo, Ytwo-16)
|
||||
characterAPI.SetOrigin(entity, Xtwo, Ytwo+16)
|
||||
networkAPI.PumpCharacterUpdate(entity)
|
||||
|
||||
--disable the other trigger
|
||||
local triggerTwo = triggerManagerAPI.FindTrigger(roomAPI.GetTriggerMgr(roomTwo), handle)
|
||||
triggerAPI.PushExclusionEntity(triggerTwo, entity)
|
||||
|
||||
--bookkeeping: remove from the original trigger's exclusion list
|
||||
local triggerOne = triggerManagerAPI.FindTrigger(roomAPI.GetTriggerMgr(roomOne), handle)
|
||||
triggerAPI.RemoveExclusionEntity(triggerOne, entity)
|
||||
end
|
||||
|
||||
local function scriptTwo(entity)
|
||||
@@ -73,12 +77,16 @@ function doorUtility.CreateDoorPair(handle, roomOne, Xone, Yone, roomTwo, Xtwo,
|
||||
|
||||
--move the character
|
||||
characterAPI.SetRoom(entity, roomOne)
|
||||
characterAPI.SetOrigin(entity, Xone, Yone-16) --NOTE: the 16 pixel margin for presentation
|
||||
characterAPI.SetOrigin(entity, Xone, Yone+16) --NOTE: +16 should prevent double collision issues
|
||||
networkAPI.PumpCharacterUpdate(entity)
|
||||
|
||||
--disable the other trigger
|
||||
local triggerOne = triggerManagerAPI.FindTrigger(roomAPI.GetTriggerMgr(roomOne), handle)
|
||||
triggerAPI.PushExclusionEntity(triggerOne, entity)
|
||||
|
||||
--bookkeeping: remove from the original trigger's exclusion list
|
||||
local triggerTwo = triggerManagerAPI.FindTrigger(roomAPI.GetTriggerMgr(roomTwo), handle)
|
||||
triggerAPI.RemoveExclusionEntity(triggerTwo, entity)
|
||||
end
|
||||
|
||||
--create the triggers proper
|
||||
@@ -86,4 +94,4 @@ function doorUtility.CreateDoorPair(handle, roomOne, Xone, Yone, roomTwo, Xtwo,
|
||||
doorUtility.CreateTrigger(handle, roomTwo, Xtwo, Ytwo, scriptTwo)
|
||||
end
|
||||
|
||||
return doorUtility
|
||||
return doorUtility
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user