mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-11 06:24:38 +00:00
Home Continent Access (#1006)
* no longer get locked out of home continent when adjacent facility is not aligned with faction * better parameter names
This commit is contained in:
parent
ed705d2cb0
commit
043e2534bb
1 changed files with 14 additions and 14 deletions
|
|
@ -127,10 +127,10 @@ case object WarpGateLogic
|
||||||
}
|
}
|
||||||
|
|
||||||
case (Some(_), Some(wg : WarpGate), Some(otherWg : WarpGate), None) =>
|
case (Some(_), Some(wg : WarpGate), Some(otherWg : WarpGate), None) =>
|
||||||
handleWarpGateDeadendPair(details, wg, otherWg)
|
handleWarpGateDeadendPair(details, otherWg, wg)
|
||||||
|
|
||||||
case (None, Some(wg : WarpGate), Some(otherWg : WarpGate), Some(_)) =>
|
case (None, Some(wg : WarpGate), Some(otherWg : WarpGate), Some(_)) =>
|
||||||
handleWarpGateDeadendPair(details, otherWg, wg)
|
handleWarpGateDeadendPair(details, wg, otherWg)
|
||||||
|
|
||||||
case (_, Some(wg: WarpGate), None, None) if !wg.Active =>
|
case (_, Some(wg: WarpGate), None, None) if !wg.Active =>
|
||||||
updateBroadcastCapabilitiesOfWarpGate(details, wg, Set(PlanetSideEmpire.NEUTRAL))
|
updateBroadcastCapabilitiesOfWarpGate(details, wg, Set(PlanetSideEmpire.NEUTRAL))
|
||||||
|
|
@ -171,25 +171,25 @@ case object WarpGateLogic
|
||||||
* Some warp gates are directed to point to different destination warp gates based on the server's policies.
|
* Some warp gates are directed to point to different destination warp gates based on the server's policies.
|
||||||
* Another exception to the gate pair rule is a pure broadcast warp gate.
|
* Another exception to the gate pair rule is a pure broadcast warp gate.
|
||||||
* @param details package class that conveys the important information
|
* @param details package class that conveys the important information
|
||||||
* @param warpgate one side of the warp gate pair (usually "our" side)
|
* @param terminalWg unpaired side (terminal) of a warp gate pair
|
||||||
* @param otherWarpgate the other side of the warp gate pair
|
* @param pairedWg facility-paired (connected) side of a warp gate pair
|
||||||
*/
|
*/
|
||||||
private def handleWarpGateDeadendPair(
|
private def handleWarpGateDeadendPair(
|
||||||
details: BuildingWrapper,
|
details: BuildingWrapper,
|
||||||
warpgate: WarpGate,
|
terminalWg: WarpGate,
|
||||||
otherWarpgate: WarpGate
|
pairedWg: WarpGate
|
||||||
): Unit = {
|
): Unit = {
|
||||||
//either the terminal warp gate messaged its connected gate, or the connected gate messaged the terminal gate
|
//either the terminal warp gate messaged its connected gate, or the connected gate messaged the terminal gate
|
||||||
//make certain the connected gate matches the terminal gate's faction
|
//make certain the connected gate matches the terminal gate's faction
|
||||||
val otherWarpgateFaction = otherWarpgate.Faction
|
val terminalWgFaction = terminalWg.Faction
|
||||||
if (warpgate.Faction != otherWarpgateFaction) {
|
val pairedWgFaction = pairedWg.Faction
|
||||||
warpgate.Faction = otherWarpgateFaction
|
if (pairedWgFaction != terminalWgFaction) {
|
||||||
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.MapUpdate(warpgate.infoUpdateMessage()))
|
pairedWg.Faction = terminalWgFaction
|
||||||
|
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.MapUpdate(pairedWg.infoUpdateMessage()))
|
||||||
}
|
}
|
||||||
//can not be considered broadcast for other factions
|
//the terminal warpgate can not be considered broadcast for other faction
|
||||||
val wgBroadcastAllowances = warpgate.AllowBroadcastFor
|
if (terminalWg.AllowBroadcastFor.contains(pairedWgFaction)) {
|
||||||
if (!wgBroadcastAllowances.contains(PlanetSideEmpire.NEUTRAL) || !wgBroadcastAllowances.contains(otherWarpgateFaction)) {
|
updateBroadcastCapabilitiesOfWarpGate(details, terminalWg, Set(terminalWgFaction))
|
||||||
updateBroadcastCapabilitiesOfWarpGate(details, warpgate, Set(PlanetSideEmpire.NEUTRAL))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue