mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-27 14:55:22 +00:00
Merge pull request #97 from Fate-JH/generic-action-new
Packet: GenericActionMessage (new)
This commit is contained in:
commit
aa67cd63c0
3 changed files with 75 additions and 1 deletions
|
|
@ -516,7 +516,7 @@ object GamePacketOpcode extends Enumeration {
|
||||||
case 0xa4 => noDecoder(WarpgateRequest)
|
case 0xa4 => noDecoder(WarpgateRequest)
|
||||||
case 0xa5 => noDecoder(WarpgateResponse)
|
case 0xa5 => noDecoder(WarpgateResponse)
|
||||||
case 0xa6 => noDecoder(DamageWithPositionMessage)
|
case 0xa6 => noDecoder(DamageWithPositionMessage)
|
||||||
case 0xa7 => noDecoder(GenericActionMessage)
|
case 0xa7 => game.GenericActionMessage.decode
|
||||||
// 0xa8
|
// 0xa8
|
||||||
case 0xa8 => game.ContinentalLockUpdateMessage.decode
|
case 0xa8 => game.ContinentalLockUpdateMessage.decode
|
||||||
case 0xa9 => game.AvatarGrenadeStateMessage.decode
|
case 0xa9 => game.AvatarGrenadeStateMessage.decode
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
// Copyright (c) 2016 PSForever.net to present
|
||||||
|
package net.psforever.packet.game
|
||||||
|
|
||||||
|
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reports that something has happened, or makes something happen.<br>
|
||||||
|
* <br>
|
||||||
|
* When sent from the server to a client, there are twenty-seven individual actions caused by this packet.
|
||||||
|
* They are only vaguely organized by behavior and some numbers may not be associated with an action.
|
||||||
|
* When sent by the client to the server, an unknown number of actions are available.
|
||||||
|
* The highest known action is a server-sent 45.<br>
|
||||||
|
*<br>
|
||||||
|
* Actions (when sent from server):<br>
|
||||||
|
* 03 - symbol: show Mosquito radar<br>
|
||||||
|
* 04 - symbol: hide Mosquito radar<br>
|
||||||
|
* 07 - warning: missile lock<br>
|
||||||
|
* 08 - warning: Wasp missile lock<br>
|
||||||
|
* 09 - warning: T-REK lock<br>
|
||||||
|
* 12 - sound: base captured fanfare<br>
|
||||||
|
* 14 - prompt: new character basic training<br>
|
||||||
|
* 22 - message: awarded a cavern capture (updates cavern capture status)<br>
|
||||||
|
* 23 - award a cavern kill<br>
|
||||||
|
* 24 - message: you have been imprinted (updates imprinted status; does it?)<br>
|
||||||
|
* 25 - message: you are no longer imprinted (updates imprinted status; does it?)<br>
|
||||||
|
* 27 - event: purchase timers reset (does it?)<br>
|
||||||
|
* 31 - switch to first person view, attempt to deconstruct but fail;
|
||||||
|
* event: fail to deconstruct due to having a "parent vehicle"<br>
|
||||||
|
* 32 - switch to first person view<br>
|
||||||
|
* 33 - event: fail to deconstruct<br>
|
||||||
|
* 43 - prompt: friendly fire in virtual reality zone<br>
|
||||||
|
* 45 - ?<br>
|
||||||
|
* <br>
|
||||||
|
* Actions (when sent from client):<br>
|
||||||
|
* 29 - AFK<br>
|
||||||
|
* 30 - back in game<br>
|
||||||
|
* 36 - turn on "Looking for Squad"<br>
|
||||||
|
* 37 - turn off "Looking for Squad"
|
||||||
|
* @param action what this packet does
|
||||||
|
*/
|
||||||
|
final case class GenericActionMessage(action : Int)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = GenericActionMessage
|
||||||
|
def opcode = GamePacketOpcode.GenericActionMessage
|
||||||
|
def encode = GenericActionMessage.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object GenericActionMessage extends Marshallable[GenericActionMessage] {
|
||||||
|
implicit val codec : Codec[GenericActionMessage] = (
|
||||||
|
"action" | uint(6)
|
||||||
|
).as[GenericActionMessage]
|
||||||
|
}
|
||||||
|
|
@ -1471,6 +1471,26 @@ class GamePacketTest extends Specification {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"GenericActionMessage" should {
|
||||||
|
val string = hex"A7 94"
|
||||||
|
|
||||||
|
"decode" in {
|
||||||
|
PacketCoding.DecodePacket(string).require match {
|
||||||
|
case GenericActionMessage(action) =>
|
||||||
|
action mustEqual 37
|
||||||
|
case default =>
|
||||||
|
ko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"encode" in {
|
||||||
|
val msg = GenericActionMessage(37)
|
||||||
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||||
|
|
||||||
|
pkt mustEqual string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"ContinentalLockUpdateMessage" should {
|
"ContinentalLockUpdateMessage" should {
|
||||||
val string = hex"A8 16 00 40"
|
val string = hex"A8 16 00 40"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue