diff --git a/lib/svrquery/protocol/titanfall/types.go b/lib/svrquery/protocol/titanfall/types.go index 87f065e..c86543c 100644 --- a/lib/svrquery/protocol/titanfall/types.go +++ b/lib/svrquery/protocol/titanfall/types.go @@ -54,7 +54,7 @@ type InstanceInfo struct { RandomServerID uint64 } -// InstanceInfo represents instance information contained in a query response. +// InstanceInfoV8 represents instance information contained in a query response. type InstanceInfoV8 struct { Retail byte InstanceType byte @@ -78,6 +78,7 @@ func (a HealthFlags) MarshalJSON() ([]byte, error) { PacketChokedOut bool SlowServerFrames bool Hitching bool + DOS bool }{} obj.None = a.None() obj.PacketLossIn = a.PacketLossIn() @@ -86,6 +87,7 @@ func (a HealthFlags) MarshalJSON() ([]byte, error) { obj.PacketChokedOut = a.PacketChokedOut() obj.SlowServerFrames = a.SlowServerFrames() obj.Hitching = a.Hitching() + obj.DOS = a.DOS() return json.Marshal(obj) } @@ -125,6 +127,11 @@ func (a HealthFlags) Hitching() bool { return (a>>5)&1 == 1 } +// DOS health flag +func (a HealthFlags) DOS() bool { + return (a>>6)&1 == 1 +} + // BasicInfo represents basic information contained in a query response. type BasicInfo struct { Port uint16 diff --git a/lib/svrquery/protocol/titanfall/types_test.go b/lib/svrquery/protocol/titanfall/types_test.go index 51c8ef3..ba0927a 100644 --- a/lib/svrquery/protocol/titanfall/types_test.go +++ b/lib/svrquery/protocol/titanfall/types_test.go @@ -17,6 +17,7 @@ func TestHealthFlags(t *testing.T) { expPacketChokedOut bool expSlowServerFrames bool expHitching bool + expDOS bool }{ { input: 0, @@ -46,6 +47,10 @@ func TestHealthFlags(t *testing.T) { input: 1 << 5, expHitching: true, }, + { + input: 1 << 6, + expDOS: true, + }, } for _, tc := range testCases {