diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index 9679c44..500cb7b 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -111,6 +111,7 @@ func (gd *GameReader) GetData() data.Data { LastGameName: gd.LastGameName(), LastGamePassword: gd.LastGamePass(), FPS: gd.FPS(), + Ping: gd.Ping(), }, Monsters: monsters, Corpses: gd.Corpses(pu.Position, hover), @@ -441,6 +442,12 @@ func (gd *GameReader) FPS() int { return int(gd.ReadUInt(gd.moduleBaseAddressPtr+gd.offset.FPS, Uint32)) } +func (gd *GameReader) Ping() int { + ptrToStructPtr := gd.moduleBaseAddressPtr + gd.offset.Ping + structPtrAddr := gd.ReadUInt(ptrToStructPtr, Uint64) + return int(gd.ReadUInt(uintptr(structPtrAddr+36), Uint32)) +} + func (gd *GameReader) HasMerc() bool { return gd.ReadUInt(gd.Process.moduleBaseAddressPtr+gd.offset.UI+0x8, Uint8) != 0 }