mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-13 23:44:40 +00:00
commit
5552d3469c
4 changed files with 18 additions and 3 deletions
|
|
@ -106,7 +106,7 @@ class SessionTerminalHandlers(
|
||||||
lastTerminalOrderFulfillment = true
|
lastTerminalOrderFulfillment = true
|
||||||
|
|
||||||
case Terminal.BuyVehicle(vehicle, _, _)
|
case Terminal.BuyVehicle(vehicle, _, _)
|
||||||
if tplayer.avatar.purchaseCooldown(vehicle.Definition).nonEmpty =>
|
if tplayer.avatar.purchaseCooldown(vehicle.Definition).nonEmpty || tplayer.spectator =>
|
||||||
sendResponse(ItemTransactionResultMessage(msg.terminal_guid, TransactionType.Buy, success = false))
|
sendResponse(ItemTransactionResultMessage(msg.terminal_guid, TransactionType.Buy, success = false))
|
||||||
lastTerminalOrderFulfillment = true
|
lastTerminalOrderFulfillment = true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
|
||||||
player.Name,
|
player.Name,
|
||||||
AvatarAction.ObjectHeld(player.GUID, before, -1)
|
AvatarAction.ObjectHeld(player.GUID, before, -1)
|
||||||
)
|
)
|
||||||
} else if (!resistance && before != slot && (player.DrawnSlot = slot) != before) {
|
} else if ((!resistance && before != slot && (player.DrawnSlot = slot) != before) && ItemSwapSlot != before) {
|
||||||
val mySlot = if (updateMyHolsterArm) slot else -1 //use as a short-circuit
|
val mySlot = if (updateMyHolsterArm) slot else -1 //use as a short-circuit
|
||||||
events ! AvatarServiceMessage(
|
events ! AvatarServiceMessage(
|
||||||
player.Continent,
|
player.Continent,
|
||||||
|
|
@ -353,6 +353,9 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
|
||||||
log.info(s"${player.Name} lowers ${player.Sex.possessive} hand")
|
log.info(s"${player.Name} lowers ${player.Sex.possessive} hand")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UpdateItemSwapSlot
|
||||||
|
} else if (ItemSwapSlot == before) {
|
||||||
|
UpdateItemSwapSlot
|
||||||
}
|
}
|
||||||
|
|
||||||
case Terminal.TerminalMessage(_, msg, order) =>
|
case Terminal.TerminalMessage(_, msg, order) =>
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ trait ContainableBehavior {
|
||||||
* The destination is set back to normal - flag to `0` - when both of the attempts short-circuit due to timeout.
|
* The destination is set back to normal - flag to `0` - when both of the attempts short-circuit due to timeout.
|
||||||
*/
|
*/
|
||||||
private var waitOnMoveItemOps: Int = 0
|
private var waitOnMoveItemOps: Int = 0
|
||||||
|
private var itemSwapSlot: Int = 10 // Just a number higher than any inventory item slots
|
||||||
|
|
||||||
final val containerBehavior: Receive = {
|
final val containerBehavior: Receive = {
|
||||||
/* messages that modify delivery order */
|
/* messages that modify delivery order */
|
||||||
|
|
@ -136,6 +137,15 @@ trait ContainableBehavior {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Functions (item transfer) */
|
/* Functions (item transfer) */
|
||||||
|
// For issue 1108
|
||||||
|
def UpdateItemSwapSlot: Int = {
|
||||||
|
itemSwapSlot = 10
|
||||||
|
itemSwapSlot
|
||||||
|
}
|
||||||
|
// For issue 1108
|
||||||
|
def ItemSwapSlot: Int = {
|
||||||
|
itemSwapSlot
|
||||||
|
}
|
||||||
|
|
||||||
protected def ContainableMoveItem(
|
protected def ContainableMoveItem(
|
||||||
destination: PlanetSideServerObject with Container,
|
destination: PlanetSideServerObject with Container,
|
||||||
|
|
@ -154,6 +164,7 @@ trait ContainableBehavior {
|
||||||
LocalPutItemInSlot(item, dest) match {
|
LocalPutItemInSlot(item, dest) match {
|
||||||
case Containable.ItemPutInSlot(_, _, _, None) => ; //success
|
case Containable.ItemPutInSlot(_, _, _, None) => ; //success
|
||||||
case Containable.ItemPutInSlot(_, _, _, Some(swapItem)) => //success, but with swap item
|
case Containable.ItemPutInSlot(_, _, _, Some(swapItem)) => //success, but with swap item
|
||||||
|
itemSwapSlot = dest
|
||||||
LocalPutItemInSlotOnlyOrAway(swapItem, slot) match {
|
LocalPutItemInSlotOnlyOrAway(swapItem, slot) match {
|
||||||
case Containable.ItemPutInSlot(_, _, _, None) => ;
|
case Containable.ItemPutInSlot(_, _, _, None) => ;
|
||||||
case _ =>
|
case _ =>
|
||||||
|
|
@ -174,6 +185,7 @@ trait ContainableBehavior {
|
||||||
case Success(Containable.ItemPutInSlot(_, _, _, None)) => ; //successful
|
case Success(Containable.ItemPutInSlot(_, _, _, None)) => ; //successful
|
||||||
|
|
||||||
case Success(Containable.ItemPutInSlot(_, _, _, Some(swapItem))) => //successful, but with swap item
|
case Success(Containable.ItemPutInSlot(_, _, _, Some(swapItem))) => //successful, but with swap item
|
||||||
|
itemSwapSlot = dest
|
||||||
PutItBackOrDropIt(source, swapItem, slot, destination.Actor)
|
PutItBackOrDropIt(source, swapItem, slot, destination.Actor)
|
||||||
|
|
||||||
case Success(_: Containable.CanNotPutItemInSlot) => //failure case ; try restore original item placement
|
case Success(_: Containable.CanNotPutItemInSlot) => //failure case ; try restore original item placement
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import scala.util.Random
|
||||||
*/
|
*/
|
||||||
class HackCaptureActor extends Actor {
|
class HackCaptureActor extends Actor {
|
||||||
private[this] val log = org.log4s.getLogger
|
private[this] val log = org.log4s.getLogger
|
||||||
|
|
||||||
/** main timer for completing or clearing hacked states */
|
/** main timer for completing or clearing hacked states */
|
||||||
private var clearTrigger: Cancellable = Default.Cancellable
|
private var clearTrigger: Cancellable = Default.Cancellable
|
||||||
/** list of currently hacked server objects */
|
/** list of currently hacked server objects */
|
||||||
|
|
@ -167,6 +166,7 @@ class HackCaptureActor extends Actor {
|
||||||
case Some((owner, _, _)) =>
|
case Some((owner, _, _)) =>
|
||||||
log.error(s"TrySpawnCaptureFlag: couldn't find any neighbouring $hackingFaction facilities of ${owner.Name} for LLU hack")
|
log.error(s"TrySpawnCaptureFlag: couldn't find any neighbouring $hackingFaction facilities of ${owner.Name} for LLU hack")
|
||||||
owner.GetFlagSocket.foreach { _.clearOldFlagData() }
|
owner.GetFlagSocket.foreach { _.clearOldFlagData() }
|
||||||
|
terminal.Zone.LocalEvents ! CaptureFlagManager.Lost(owner.GetFlag.get, CaptureFlagLostReasonEnum.Ended)
|
||||||
false
|
false
|
||||||
case _ =>
|
case _ =>
|
||||||
log.error(s"TrySpawnCaptureFlag: expecting a terminal ${terminal.GUID.guid} with the ctf owning facility")
|
log.error(s"TrySpawnCaptureFlag: expecting a terminal ${terminal.GUID.guid} with the ctf owning facility")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue