Add ping to game_reader
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user