]> git.vomp.tv Git - vompserver.git/commitdiff
Fix for timezone on client #1233050
authorChris Tallon <chris@vomp.tv>
Wed, 6 Jul 2005 19:22:52 +0000 (19:22 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 6 Jul 2005 19:22:52 +0000 (19:22 +0000)
mvpclient.c
mvpclient.h

index 74a53806e4576b58ae81c5ccd7c57977a43b07a0..18a9dd13c5d537cc17ed0e0f5a471dc83bf83b74 100644 (file)
@@ -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();
index d704314c46e3413b3a1e7d2832585d2a9f86b294..b31ce3196cd0f3e17483531db2a1ce7cba4768c3 100644 (file)
@@ -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);