mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-12 23:14:42 +00:00
Documentation update
This commit is contained in:
parent
c6eff22df7
commit
21b0f07fb7
3 changed files with 32 additions and 14 deletions
|
|
@ -118,6 +118,7 @@ import scodec.codecs._
|
||||||
* `77 - Cavern Facility Captures. Value is the number of captures`<br>
|
* `77 - Cavern Facility Captures. Value is the number of captures`<br>
|
||||||
* `78 - Cavern Kills. Value is the number of kills`<br>
|
* `78 - Cavern Kills. Value is the number of kills`<br>
|
||||||
* `106 - Custom Head`<br>
|
* `106 - Custom Head`<br>
|
||||||
|
* `116 - Apply colour to REK beam and REK icon above players (0 = yellow, 1 = red, 2 = purple, 3 = blue)`<br>
|
||||||
* Client to Server : <br>
|
* Client to Server : <br>
|
||||||
* `106 - Custom Head`<br>
|
* `106 - Custom Head`<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import scodec.codecs._
|
||||||
/**
|
/**
|
||||||
* (Where the child object was before it was moved is not specified or important.)<br>
|
* (Where the child object was before it was moved is not specified or important.)<br>
|
||||||
* @param avatar_guid the player.
|
* @param avatar_guid the player.
|
||||||
* @param unk1 dont know how call that. It's the "item" ID when use a rek to hack or a medkit to heal.
|
* @param item_used_guid The "item" GUID used e.g. a rek to hack or a medkit to heal.
|
||||||
* @param object_guid can be : Door, Terminal, Avatar (medkit).
|
* @param object_guid can be : Door, Terminal, Avatar (medkit).
|
||||||
* @param unk2 ???
|
* @param unk2 ???
|
||||||
* @param unk3 ??? true when use a rek (false when door, medkit or open equip term)
|
* @param unk3 ??? true when use a rek (false when door, medkit or open equip term)
|
||||||
|
|
@ -21,7 +21,7 @@ import scodec.codecs._
|
||||||
* @param itemType object ID from game_objects.adb (ex 612 is an equipment terminal, for medkit we have 121 (avatar))
|
* @param itemType object ID from game_objects.adb (ex 612 is an equipment terminal, for medkit we have 121 (avatar))
|
||||||
*/
|
*/
|
||||||
final case class UseItemMessage(avatar_guid : PlanetSideGUID,
|
final case class UseItemMessage(avatar_guid : PlanetSideGUID,
|
||||||
unk1 : Int,
|
item_used_guid : Int,
|
||||||
object_guid : PlanetSideGUID,
|
object_guid : PlanetSideGUID,
|
||||||
unk2 : Long,
|
unk2 : Long,
|
||||||
unk3 : Boolean,
|
unk3 : Boolean,
|
||||||
|
|
@ -40,7 +40,7 @@ final case class UseItemMessage(avatar_guid : PlanetSideGUID,
|
||||||
object UseItemMessage extends Marshallable[UseItemMessage] {
|
object UseItemMessage extends Marshallable[UseItemMessage] {
|
||||||
implicit val codec : Codec[UseItemMessage] = (
|
implicit val codec : Codec[UseItemMessage] = (
|
||||||
("avatar_guid" | PlanetSideGUID.codec) ::
|
("avatar_guid" | PlanetSideGUID.codec) ::
|
||||||
("unk1" | uint16L) ::
|
("item_used_guid" | uint16L) ::
|
||||||
("object_guid" | PlanetSideGUID.codec) ::
|
("object_guid" | PlanetSideGUID.codec) ::
|
||||||
("unk2" | uint32L) ::
|
("unk2" | uint32L) ::
|
||||||
("unk3" | bool) ::
|
("unk3" | bool) ::
|
||||||
|
|
|
||||||
|
|
@ -2410,7 +2410,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
case msg @ AvatarImplantMessage(_, _, _, _) => //(player_guid, unk1, unk2, implant) =>
|
case msg @ AvatarImplantMessage(_, _, _, _) => //(player_guid, unk1, unk2, implant) =>
|
||||||
log.info("AvatarImplantMessage: " + msg)
|
log.info("AvatarImplantMessage: " + msg)
|
||||||
|
|
||||||
case msg @ UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType) =>
|
case msg @ UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType) =>
|
||||||
log.info("UseItem: " + msg)
|
log.info("UseItem: " + msg)
|
||||||
// TODO: Not all fields in the response are identical to source in real packet logs (but seems to be ok)
|
// TODO: Not all fields in the response are identical to source in real packet logs (but seems to be ok)
|
||||||
// TODO: Not all incoming UseItemMessage's respond with another UseItemMessage (i.e. doors only send out GenericObjectStateMsg)
|
// TODO: Not all incoming UseItemMessage's respond with another UseItemMessage (i.e. doors only send out GenericObjectStateMsg)
|
||||||
|
|
@ -2444,11 +2444,11 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
case Some(obj : Player) =>
|
case Some(obj : Player) =>
|
||||||
if(obj.isBackpack) {
|
if(obj.isBackpack) {
|
||||||
log.info(s"UseItem: $player looting the corpse of $obj")
|
log.info(s"UseItem: $player looting the corpse of $obj")
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
accessedContainer = Some(obj)
|
accessedContainer = Some(obj)
|
||||||
}
|
}
|
||||||
else if(!unk3) { //potential kit use
|
else if(!unk3) { //potential kit use
|
||||||
continent.GUID(unk1) match {
|
continent.GUID(item_used_guid) match {
|
||||||
case Some(kit : Kit) =>
|
case Some(kit : Kit) =>
|
||||||
player.Find(kit) match {
|
player.Find(kit) match {
|
||||||
case Some(index) =>
|
case Some(index) =>
|
||||||
|
|
@ -2464,7 +2464,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
case Some(index) =>
|
case Some(index) =>
|
||||||
whenUsedLastKit = System.currentTimeMillis
|
whenUsedLastKit = System.currentTimeMillis
|
||||||
player.Slot(index).Equipment = None //remove from slot immediately; must exist on client for next packet
|
player.Slot(index).Equipment = None //remove from slot immediately; must exist on client for next packet
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, 0, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, 0, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
sendResponse(ObjectDeleteMessage(kit.GUID, 0))
|
sendResponse(ObjectDeleteMessage(kit.GUID, 0))
|
||||||
taskResolver ! GUIDTask.UnregisterEquipment(kit)(continent.GUID)
|
taskResolver ! GUIDTask.UnregisterEquipment(kit)(continent.GUID)
|
||||||
//TODO better health/damage control workflow
|
//TODO better health/damage control workflow
|
||||||
|
|
@ -2486,7 +2486,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
case Some(item) =>
|
case Some(item) =>
|
||||||
log.warn(s"UseItem: looking for Kit to use, but found $item instead")
|
log.warn(s"UseItem: looking for Kit to use, but found $item instead")
|
||||||
case None =>
|
case None =>
|
||||||
log.warn(s"UseItem: anticipated a Kit $unk1, but can't find it")
|
log.warn(s"UseItem: anticipated a Kit $item_used_guid, but can't find it")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2495,7 +2495,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
log.info(s"UseItem: $player accessing a locker")
|
log.info(s"UseItem: $player accessing a locker")
|
||||||
val container = player.Locker
|
val container = player.Locker
|
||||||
accessedContainer = Some(container)
|
accessedContainer = Some(container)
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, container.GUID, unk2, unk3, unk4, unk5, unk6, unk7, unk8, 456))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, container.GUID, unk2, unk3, unk4, unk5, unk6, unk7, unk8, 456))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log.info(s"UseItem: not $player's locker")
|
log.info(s"UseItem: not $player's locker")
|
||||||
|
|
@ -2517,7 +2517,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
obj.AccessingTrunk = player.GUID
|
obj.AccessingTrunk = player.GUID
|
||||||
accessedContainer = Some(obj)
|
accessedContainer = Some(obj)
|
||||||
AccessContents(obj)
|
AccessContents(obj)
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log.info(s"UseItem: $player can not cut in line while player ${obj.AccessingTrunk.get} is using $obj's trunk")
|
log.info(s"UseItem: $player can not cut in line while player ${obj.AccessingTrunk.get} is using $obj's trunk")
|
||||||
|
|
@ -2550,14 +2550,31 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
else if(obj.Definition.isInstanceOf[RepairRearmSiloDefinition]) {
|
else if(obj.Definition.isInstanceOf[RepairRearmSiloDefinition]) {
|
||||||
FindLocalVehicle match {
|
FindLocalVehicle match {
|
||||||
case Some(vehicle) =>
|
case Some(vehicle) =>
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, vehicle.GUID, unk2, unk3, unk4, unk5, unk6, unk7, unk8, vehicle.Definition.ObjectId))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, vehicle.GUID, unk2, unk3, unk4, unk5, unk6, unk7, unk8, vehicle.Definition.ObjectId))
|
||||||
case None =>
|
case None =>
|
||||||
log.error("UseItem: expected seated vehicle, but found none")
|
log.error("UseItem: expected seated vehicle, but found none")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
if(obj.Faction != player.Faction && obj.HackedBy.isEmpty) {
|
||||||
|
log.warn(s"${obj.Faction} ${player.Faction} ${obj.HackedBy}")
|
||||||
|
player.Slot(player.DrawnSlot).Equipment match {
|
||||||
|
case Some(tool: SimpleItem) =>
|
||||||
|
if (tool.Definition == GlobalDefinitions.remote_electronics_kit) {
|
||||||
|
//TODO get player hack level (for now, presume 15s in intervals of 4/s)
|
||||||
|
progressBarValue = Some(-GetPlayerHackSpeed())
|
||||||
|
self ! WorldSessionActor.ItemHacking(player, obj, tool.GUID, GetPlayerHackSpeed(), FinishHackingTerminal(obj, 3212836864L))
|
||||||
|
log.info("Hacking a terminal")
|
||||||
|
}
|
||||||
|
case _ => ;
|
||||||
|
}
|
||||||
|
} else if (obj.Faction == player.Faction || !obj.HackedBy.isEmpty) {
|
||||||
|
// If hacked only allow access to the faction that hacked it
|
||||||
|
// Otherwise allow the faction that owns the terminal to use it
|
||||||
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Some(obj : SpawnTube) =>
|
case Some(obj : SpawnTube) =>
|
||||||
|
|
@ -2571,7 +2588,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
|
|
||||||
case Some(obj) =>
|
case Some(obj) =>
|
||||||
log.warn(s"UseItem: don't know how to handle $obj; taking a shot in the dark")
|
log.warn(s"UseItem: don't know how to handle $obj; taking a shot in the dark")
|
||||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
sendResponse(UseItemMessage(avatar_guid, item_used_guid, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||||
|
|
||||||
case None =>
|
case None =>
|
||||||
log.error(s"UseItem: can not find object $object_guid")
|
log.error(s"UseItem: can not find object $object_guid")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue