I know CalendarGetDate() could do, but I want to get server date and time(not client date and time) by reading memory. Anybody help ?
Thanks.
I know CalendarGetDate() could do, but I want to get server date and time(not client date and time) by reading memory. Anybody help ?
Thanks.
I think you can't get the accurate time.Server only sent Hour and Minute(When logged in) to the client according to my past research.
When you connect to the server, your client calculates and stores the time difference between your local computer and the server time.
At any moment, your client can know the server time by adding your current local time to this time difference.
This is what the lua function GetServerTime does.
Look at this function to get the pointer of the stored time difference.
Not really sure how precise you need it, but the variable g_homeServerTime might be useful to you. You can easily find it referenced in Script_GetGameTime. It's accurate to the minute.
Code:signed int __cdecl Script_GetGameTime(lua_State *L) { klua_pushnumber(L, COERCE__INT64(g_homeServerTime[1])); klua_pushnumber(L, COERCE__INT64(g_homeServerTime[0])); return 2; }Code:var time = Offsets.Instance["g_homeServerTime"].Read<int>(6); return new DateTime(time[5] + 2000, time[4] + 1, time[3] + 1, time[1], time[0], 0, DateTimeKind.Utc);
Last edited by Jadd; 07-04-2018 at 10:17 AM.