mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
barebones implementation of the three VoiceHost packets, for completion
This commit is contained in:
parent
daa22c572e
commit
b01401dd6d
|
|
@ -528,9 +528,9 @@ object GamePacketOpcode extends Enumeration {
|
|||
case 0xaf => noDecoder(CSAssistCommentMessage)
|
||||
|
||||
// OPCODES 0xb0-bf
|
||||
case 0xb0 => noDecoder(VoiceHostRequest)
|
||||
case 0xb1 => noDecoder(VoiceHostKill)
|
||||
case 0xb2 => noDecoder(VoiceHostInfo)
|
||||
case 0xb0 => game.VoiceHostRequest.decode
|
||||
case 0xb1 => game.VoiceHostKill.decode
|
||||
case 0xb2 => game.VoiceHostInfo.decode
|
||||
case 0xb3 => noDecoder(BattleplanMessage)
|
||||
case 0xb4 => noDecoder(BattleExperienceMessage)
|
||||
case 0xb5 => noDecoder(TargetingImplantRequest)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package net.psforever.packet.game
|
||||
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||
import scodec.Codec
|
||||
import scodec.bits.ByteVector
|
||||
import scodec.codecs._
|
||||
|
||||
/**
|
||||
* Used by PlanetSide in conjunction with wiredred/pscs.exe to establish local platoon/squad voice chat.
|
||||
* We are not focusing on implementation of this feature.
|
||||
* This packet should not be generated because `VoiceHostRequest` is snubbed.
|
||||
* @param player_guid the player who sent this info (the originator of voice chat?)
|
||||
* @param data everything else
|
||||
*/
|
||||
final case class VoiceHostInfo(player_guid : PlanetSideGUID,
|
||||
data : ByteVector)
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = VoiceHostInfo
|
||||
def opcode = GamePacketOpcode.VoiceHostInfo
|
||||
def encode = VoiceHostInfo.encode(this)
|
||||
}
|
||||
|
||||
object VoiceHostInfo extends Marshallable[VoiceHostInfo] {
|
||||
implicit val codec : Codec[VoiceHostInfo] = (
|
||||
("player_guid" | PlanetSideGUID.codec) ::
|
||||
("data" | bytes)
|
||||
).as[VoiceHostInfo]
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package net.psforever.packet.game
|
||||
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket}
|
||||
import scodec.Codec
|
||||
|
||||
/**
|
||||
* Used by PlanetSide in conjunction with wiredred/pscs.exe to establish local platoon/squad voice chat.
|
||||
* We are not focusing on implementation of this feature.
|
||||
* As a precaution, all attempts at sending `VoiceHostRequest` should be replied to with a `VoiceHostKill`.
|
||||
* This packet seems to publish no data.
|
||||
*/
|
||||
final case class VoiceHostKill()
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = VoiceHostKill
|
||||
def opcode = GamePacketOpcode.VoiceHostKill
|
||||
def encode = VoiceHostKill.encode(this)
|
||||
}
|
||||
|
||||
object VoiceHostKill extends Marshallable[VoiceHostKill] {
|
||||
implicit val codec : Codec[VoiceHostKill] = PacketHelpers.emptyCodec(VoiceHostKill())
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package net.psforever.packet.game
|
||||
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||
import scodec.Codec
|
||||
import scodec.bits.ByteVector
|
||||
import scodec.codecs._
|
||||
|
||||
/**
|
||||
* Used by PlanetSide in conjunction with wiredred/pscs.exe to establish local platoon/squad voice chat.
|
||||
* We are not focusing on implementation of this feature.
|
||||
* At the most, we will merely record data about who requested it.
|
||||
* @param unk na
|
||||
* @param player_guid the player who sent this request
|
||||
* @param data everything else
|
||||
*/
|
||||
final case class VoiceHostRequest(unk : Boolean,
|
||||
player_guid : PlanetSideGUID,
|
||||
data : ByteVector)
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = VoiceHostRequest
|
||||
def opcode = GamePacketOpcode.VoiceHostRequest
|
||||
def encode = VoiceHostRequest.encode(this)
|
||||
}
|
||||
|
||||
object VoiceHostRequest extends Marshallable[VoiceHostRequest] {
|
||||
implicit val codec : Codec[VoiceHostRequest] = (
|
||||
("unk" | bool) ::
|
||||
("player_guid" | PlanetSideGUID.codec) ::
|
||||
("data" | bytes)
|
||||
).as[VoiceHostRequest]
|
||||
}
|
||||
Loading…
Reference in a new issue