Fix Poke timeout, input CommandLow handling, and add Poke Popup
This commit is contained in:
@@ -36,6 +36,7 @@ type Client struct {
|
||||
PingPacketID uint16 // Type 0x04
|
||||
PongPacketID uint16 // Type 0x05
|
||||
AckPacketID uint16 // Type 0x06
|
||||
AckLowPacketID uint16 // Type 0x07
|
||||
|
||||
// Ping RTT tracking
|
||||
PingSentTimes map[uint16]time.Time // Map PingPacketID -> Time sent
|
||||
@@ -48,10 +49,14 @@ type Client struct {
|
||||
ServerName string
|
||||
|
||||
// Fragment reassembly (packet queue like ts3j)
|
||||
CommandQueue map[uint16]*protocol.Packet // Packets waiting for reassembly
|
||||
ExpectedCommandPID uint16 // Next expected packet ID
|
||||
CommandQueue map[uint16]*protocol.Packet // Packets waiting for reassembly (Type 0x02)
|
||||
ExpectedCommandPID uint16 // Next expected packet ID (Type 0x02)
|
||||
FragmentState bool // Toggle: true = collecting, false = ready
|
||||
|
||||
CommandLowQueue map[uint16]*protocol.Packet // Packets waiting for reassembly (Type 0x03)
|
||||
ExpectedCommandLowPID uint16 // Next expected packet ID (Type 0x03)
|
||||
FragmentStateLow bool // Toggle: true = collecting, false = ready
|
||||
|
||||
// Server Data
|
||||
Channels map[uint64]*Channel
|
||||
|
||||
@@ -69,17 +74,20 @@ type Client struct {
|
||||
|
||||
func NewClient(nickname string) *Client {
|
||||
return &Client{
|
||||
Nickname: nickname,
|
||||
PacketIDCounterC2S: 1,
|
||||
VoicePacketID: 1,
|
||||
Channels: make(map[uint64]*Channel),
|
||||
VoiceDecoders: make(map[uint16]*opus.Decoder),
|
||||
CommandQueue: make(map[uint16]*protocol.Packet),
|
||||
ExpectedCommandPID: 0,
|
||||
PingSentTimes: make(map[uint16]time.Time),
|
||||
PingRTT: 0,
|
||||
PingDeviation: 0,
|
||||
done: make(chan struct{}),
|
||||
Nickname: nickname,
|
||||
PacketIDCounterC2S: 1,
|
||||
AckLowPacketID: 1,
|
||||
VoicePacketID: 1,
|
||||
Channels: make(map[uint64]*Channel),
|
||||
VoiceDecoders: make(map[uint16]*opus.Decoder),
|
||||
CommandQueue: make(map[uint16]*protocol.Packet),
|
||||
ExpectedCommandPID: 0,
|
||||
CommandLowQueue: make(map[uint16]*protocol.Packet),
|
||||
ExpectedCommandLowPID: 0,
|
||||
PingSentTimes: make(map[uint16]time.Time),
|
||||
PingRTT: 0,
|
||||
PingDeviation: 0,
|
||||
done: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user