StaffEN 7 Report post Posted December 28, 2024 (edited) Может ли кто-нибудь объяснить мне, как добавить систему времени сервера? Я хочу знать об этом исходном коде Could someone explain me how to add the server time system? i want to learn about this source code Edited January 4 by StaffEN Quote Share this post Link to post Share on other sites
StaffEN 7 Report post Posted December 30, 2024 Up Quote Share this post Link to post Share on other sites
champ 170 Report post Posted January 16 Надо наверное прорендерить время в клиенте как 00:00, при подключение, отправить пакет с сервера с зоной времени и дальше парсить с клиента. Quote Share this post Link to post Share on other sites
mastersea 1 Report post Posted January 21 #include <time.h> bool CMiniMapMgr::Init() { ...other code ...other code ...other code labClock = dynamic_cast<CLabelEx*>(frmMinimap->Find("labClock")); if (!labClock) return Error(g_oLangRec.GetString(45), frmMinimap->GetName(), "labClock"); return true; } void CMiniMapMgr::RefreshChaPos( int x, int y ) { ...other code ...other code ...other code SetClockStringClientSide(); } void CMiniMapMgr::SetClockStringClientSide() { time_t rawtime = time(NULL); time_t time = rawtime - (7 * 3600); struct tm* timeinfo; timeinfo = gmtime(&time); static char buf[50]; strftime(buf, sizeof(buf), "%a, %b %d | %H:%M:%S %p", timeinfo); labClock->SetCaption(buf); } Quote Share this post Link to post Share on other sites