From: Chris Tallon Date: Wed, 6 Jul 2005 19:22:52 +0000 (+0000) Subject: Fix for timezone on client #1233050 X-Git-Tag: r0-0-17~21 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=ed070078e22428cb5b2f81efb2e9727f3002dfd8;p=vompserver.git Fix for timezone on client #1233050 --- diff --git a/mvpclient.c b/mvpclient.c index 74a5380..18a9dd1 100644 --- a/mvpclient.c +++ b/mvpclient.c @@ -228,14 +228,15 @@ void MVPClient::processLogin(unsigned char* buffer, int length) { time_t timeNow = time(NULL); struct tm* timeStruct = localtime(&timeNow); - timeOffset = timeStruct->tm_gmtoff; + int timeOffset = timeStruct->tm_gmtoff; - // seems dhcp is sending timezone out to mvp - // so just supply utc timestamp - timeOffset = 0; + unsigned char sendBuffer[12]; + *(unsigned long*)&sendBuffer[0] = htonl(8); + *(unsigned long*)&sendBuffer[4] = htonl(timeNow); + *(signed int*)&sendBuffer[8] = htonl(timeOffset); - sendULONG(timeNow + timeOffset); - printf("written time\n"); + tcp.sendPacket(sendBuffer, 12); + printf("written login reply\n"); } void MVPClient::processGetRecordingsList(unsigned char* data, int length) @@ -263,7 +264,7 @@ void MVPClient::processGetRecordingsList(unsigned char* data, int length) for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { if (count > 49000) break; // just how big is that hard disk?! - *(unsigned long*)&sendBuffer[count] = htonl(recording->start + timeOffset); + *(unsigned long*)&sendBuffer[count] = htonl(recording->start);// + timeOffset); count += 4; point = (char*)recording->Name(); diff --git a/mvpclient.h b/mvpclient.h index d704314..b31ce31 100644 --- a/mvpclient.h +++ b/mvpclient.h @@ -56,7 +56,6 @@ class MVPClient cMediamvpTransceiver* cm; cRecordings* recordingManager; RecPlayer* rp; - int timeOffset; void processLogin(unsigned char* buffer, int length); void processGetRecordingsList(unsigned char* data, int length);