mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-21 11:04:44 +00:00
Tweaks to !hack admin command to reduce the message storm it causes (#405)
This commit is contained in:
parent
4c249bb358
commit
70e59effec
|
|
@ -2,7 +2,7 @@
|
|||
package net.psforever.objects.zones
|
||||
|
||||
import akka.actor.{Actor, Props}
|
||||
import net.psforever.objects.serverobject.structures.Building
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.types.Vector3
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
|
@ -75,7 +75,9 @@ class InterstellarCluster(zones : List[Zone]) extends Actor {
|
|||
}
|
||||
case InterstellarCluster.ZoneMapUpdate(zone_num: Int) =>
|
||||
val zone = zones.find(x => x.Number == zone_num).get
|
||||
zone.Buildings.values.foreach(b => b.Actor ! Building.SendMapUpdate(all_clients = true))
|
||||
zone.Buildings
|
||||
.filter(_._2.BuildingType == StructureType.Facility)
|
||||
.values.foreach(b => b.Actor ! Building.SendMapUpdate(all_clients = true))
|
||||
|
||||
|
||||
case Zoning.InstantAction.Request(faction) =>
|
||||
|
|
|
|||
|
|
@ -4663,7 +4663,6 @@ class WorldSessionActor extends Actor
|
|||
if(!building.Name.isEmpty && args(1).equalsIgnoreCase(building.Name)) {
|
||||
log.info(s"Hack Base Name : ${args(1)} to empire : ${args(2)}")
|
||||
building.Faction = hackFaction
|
||||
building.Actor ! Building.TriggerZoneMapUpdate(continent.Number)
|
||||
continent.LocalEvents ! LocalServiceMessage(continent.Id, LocalAction.SetEmpire(building.GUID, hackFaction))
|
||||
}
|
||||
})
|
||||
|
|
@ -4681,10 +4680,13 @@ class WorldSessionActor extends Actor
|
|||
else {
|
||||
continent.Buildings.foreach({
|
||||
case (id, building) =>
|
||||
if (!building.Name.isEmpty && !bad && building.BuildingType.id != 6) {
|
||||
if (!building.Name.isEmpty && !bad
|
||||
&& building.BuildingType != StructureType.Bridge
|
||||
&& building.BuildingType != StructureType.Bunker
|
||||
&& building.BuildingType != StructureType.WarpGate
|
||||
) {
|
||||
log.info(s"Hack Bases to empire : ${args(1)}")
|
||||
building.Faction = hackFaction
|
||||
building.Actor ! Building.TriggerZoneMapUpdate(continent.Number)
|
||||
continent.LocalEvents ! LocalServiceMessage(continent.Id, LocalAction.SetEmpire(building.GUID, hackFaction))
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue