Changeset 82061


Ignore:
Timestamp:
Aug 7, 2011, 6:53:11 AM (9 years ago)
Author:
ryandesign@…
Message:

libhsplasma: update to version from 2011-08-01, update fetch and livecheck

Location:
trunk/dports/devel/libhsplasma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/devel/libhsplasma/Portfile

    r75718 r82061  
    66
    77name                        libhsplasma
    8 version                     0.0-798
     8version                     0.0-20110801
    99categories                  devel
    1010platforms                   darwin
     
    2020                            games Myst V: End of Ages and Myst Online: URU Live
    2121
    22 fetch.type                  hg
    23 hg.url                      http://uru.zrax.net/hg/libhsplasma
    24 hg.tag                      51c5233d5049
     22fetch.type                  git
     23git.url                     https://github.com/H-uru/libhsplasma.git
     24git.branch                  7bb605276da0ba15d44d
    2525
    2626depends_lib                 port:zlib \
     
    6565
    6666livecheck.type              regex
    67 livecheck.url               ${hg.url}
    68 livecheck.version           [lindex [split ${version} -] 1]
    69 livecheck.regex             {rev (\d+)}
     67livecheck.url               https://github.com/H-uru/libhsplasma/commits/master
     68livecheck.version           [regsub {(....)(..)(..)} [lindex [split ${version} -] 1] {\1-\2-\3}]
     69livecheck.regex             {<h2>([0-9-]+)</h2>}
  • trunk/dports/devel/libhsplasma/files/patch-endian.diff

    r73738 r82061  
    1 --- core/Sys/plUuid.cpp.orig    Thu Nov 11 11:14:21 2010 -0800
    2 +++ core/Sys/plUuid.cpp Thu Nov 18 15:52:46 2010 -0600
    3 @@ -69,6 +69,9 @@
     1--- core/Sys/plUuid.cpp.orig
     2+++ core/Sys/plUuid.cpp
     3@@ -69,6 +69,9 @@ void plUuid::read(const unsigned char* buffer) {
    44     fData1 = *(unsigned int*  )(buffer    );
    55     fData2 = *(unsigned short*)(buffer + 4);
     
    1111 }
    1212 
    13 @@ -80,9 +83,9 @@
     13@@ -80,9 +83,9 @@ void plUuid::write(hsStream* S) {
    1414 }
    1515 
     
    2424 }
    2525 
    26 --- net/auth/pnAuthClient.cpp.orig      Thu Nov 11 11:14:21 2010 -0800
    27 +++ net/auth/pnAuthClient.cpp   Thu Nov 18 15:52:46 2010 -0600
    28 @@ -64,6 +64,7 @@
    29      hsUint16 msgId;
    30  
    31      sock->recv(&msgId, sizeof(hsUint16));
     26--- net/auth/pnAuthClient.cpp.orig
     27+++ net/auth/pnAuthClient.cpp
     28@@ -64,6 +64,7 @@ bool pnAuthClient::Dispatch::dispatch(pnSocket* sock)
     29     uint16_t msgId;
     30 
     31     sock->recv(&msgId, sizeof(uint16_t));
    3232+    msgId = LESWAP16(msgId);
    3333     const pnNetMsg* msgDesc = GET_Auth2Cli(msgId);
    3434     if (msgDesc == NULL) {
    3535         plDebug::Error("Got invalid message ID (%u)", msgId);
    36 @@ -385,13 +386,13 @@
    37      hsUbyte connectHeader[51];  // ConnectHeader + AuthConnectHeader
     36@@ -385,13 +386,13 @@ ENetError pnAuthClient::performConnect()
     37     uint8_t connectHeader[51];  // ConnectHeader + AuthConnectHeader
    3838     /* Begin ConnectHeader */
    39      *(hsUbyte* )(connectHeader     ) = kConnTypeCliToAuth;
    40 -    *(hsUint16*)(connectHeader +  1) = 31;
    41 -    *(hsUint32*)(connectHeader +  3) = fBuildId;
    42 -    *(hsUint32*)(connectHeader +  7) = fBuildType;
    43 -    *(hsUint32*)(connectHeader + 11) = fBranchId;
    44 +    *(hsUint16*)(connectHeader +  1) = LESWAP16(31);
    45 +    *(hsUint32*)(connectHeader +  3) = LESWAP32(fBuildId);
    46 +    *(hsUint32*)(connectHeader +  7) = LESWAP32(fBuildType);
    47 +    *(hsUint32*)(connectHeader + 11) = LESWAP32(fBranchId);
     39     *(uint8_t* )(connectHeader     ) = kConnTypeCliToAuth;
     40-    *(uint16_t*)(connectHeader +  1) = 31;
     41-    *(uint32_t*)(connectHeader +  3) = fBuildId;
     42-    *(uint32_t*)(connectHeader +  7) = fBuildType;
     43-    *(uint32_t*)(connectHeader + 11) = fBranchId;
     44+    *(uint16_t*)(connectHeader +  1) = LESWAP16(31);
     45+    *(uint32_t*)(connectHeader +  3) = LESWAP32(fBuildId);
     46+    *(uint32_t*)(connectHeader +  7) = LESWAP32(fBuildType);
     47+    *(uint32_t*)(connectHeader + 11) = LESWAP32(fBranchId);
    4848     fProductId.write(connectHeader + 15);
    4949     /* Begin AuthConnectHeader */
    50 -    *(hsUint32*)(connectHeader + 31) = 20;
    51 +    *(hsUint32*)(connectHeader + 31) = LESWAP32(20);
     50-    *(uint32_t*)(connectHeader + 31) = 20;
     51+    *(uint32_t*)(connectHeader + 31) = LESWAP32(20);
    5252     memset(connectHeader + 35, 0, 16);
    5353     fSock->send(connectHeader, 51);
    5454 
    55 @@ -439,6 +440,7 @@
     55@@ -439,6 +440,7 @@ ENetError pnAuthClient::performConnect()
    5656     } else if (msg == kNetCliSrv2CliError) {
    57          hsUint32 errorCode;
    58          fSock->recv(&errorCode, sizeof(hsUint32));
     57         uint32_t errorCode;
     58         fSock->recv(&errorCode, sizeof(uint32_t));
    5959+        errorCode = LESWAP32(errorCode);
    6060         delete fSock;
    6161         fSock = NULL;
    6262         plDebug::Error("Error connecting to Auth server: %s",
    63 --- net/pnSocket.cpp.orig       Thu Nov 11 11:14:21 2010 -0800
    64 +++ net/pnSocket.cpp    Thu Nov 18 15:52:46 2010 -0600
    65 @@ -334,11 +334,11 @@
     63--- net/pnSocket.cpp.orig
     64+++ net/pnSocket.cpp
     65@@ -338,11 +338,11 @@ static void RecvBasic(pnSocket* sock, msgparm_t& data,
    6666         } else if (size == 2) {
    67              hsUint16 v;
    68              sock->recv(&v, sizeof(hsUint16));
     67             uint16_t v;
     68             sock->recv(&v, sizeof(uint16_t));
    6969-            data.fUint = v;
    7070+            data.fUint = LESWAP16(v);
    7171         } else if (size == 4) {
    72              hsUint32 v;
    73              sock->recv(&v, sizeof(hsUint32));
     72             uint32_t v;
     73             sock->recv(&v, sizeof(uint32_t));
    7474-            data.fUint = v;
    7575+            data.fUint = LESWAP32(v);
     
    7777 
    7878 #ifdef COMMDEBUG
    79 @@ -381,10 +381,10 @@
    80              *(hsUbyte*)buf = (hsUbyte)data.fUint;
    81              buf += sizeof(hsUbyte);
     79@@ -385,10 +385,10 @@ static void SendBasic(unsigned char*& buf, const msgparm_t& data,
     80             *(uint8_t*)buf = (uint8_t)data.fUint;
     81             buf += sizeof(uint8_t);
    8282         } else if (size == 2) {
    83 -            *(hsUint16*)buf = (hsUint16)data.fUint;
    84 +            *(hsUint16*)buf = (hsUint16)LESWAP16(data.fUint);
    85              buf += sizeof(hsUint16);
     83-            *(uint16_t*)buf = (uint16_t)data.fUint;
     84+            *(uint16_t*)buf = (uint16_t)LESWAP16(data.fUint);
     85             buf += sizeof(uint16_t);
    8686         } else if (size == 4) {
    87 -            *(hsUint32*)buf = data.fUint;
    88 +            *(hsUint32*)buf = LESWAP32(data.fUint);
    89              buf += sizeof(hsUint32);
     87-            *(uint32_t*)buf = data.fUint;
     88+            *(uint32_t*)buf = LESWAP32(data.fUint);
     89             buf += sizeof(uint32_t);
    9090         }
    9191 
    92 @@ -435,7 +435,7 @@
    93      size_t bufSize = sizeof(hsUint16) + NCMessageSize(data, msg);
     92@@ -439,7 +439,7 @@ bool pnSocket::sendMsg(const msgparm_t* data, const pnNetMsg* msg)
     93     size_t bufSize = sizeof(uint16_t) + NCMessageSize(data, msg);
    9494     unsigned char* buffer = new unsigned char[bufSize];
    9595     unsigned char* bp = buffer;
    96 -    *(hsUint16*)bp = msg->fMsgId;
    97 +    *(hsUint16*)bp = LESWAP16(msg->fMsgId);
    98      bp += sizeof(hsUint16);
     96-    *(uint16_t*)bp = msg->fMsgId;
     97+    *(uint16_t*)bp = LESWAP16(msg->fMsgId);
     98     bp += sizeof(uint16_t);
    9999 
    100100     unsigned int size = 0;
    101 @@ -450,9 +450,13 @@
     101@@ -454,9 +454,13 @@ bool pnSocket::sendMsg(const msgparm_t* data, const pnNetMsg* msg)
    102102         case kFieldString:
    103103             {
    104                  hsUint16 len = plwcslen(data[i].fString);
    105 -                *(hsUint16*)bp = len;
    106 +                *(hsUint16*)bp = LESWAP16(len);
    107                  bp += sizeof(hsUint16);
     104                 uint16_t len = plwcslen(data[i].fString);
     105-                *(uint16_t*)bp = len;
     106+                *(uint16_t*)bp = LESWAP16(len);
     107                 bp += sizeof(uint16_t);
    108108                 memcpy(bp, data[i].fString, len * sizeof(pl_wchar_t));
    109109+#ifdef WORDS_BIGENDIAN
     
    114114 #ifdef COMMDEBUG
    115115                 plDebug::Debug("     -> Str: %s", plString(data[i].fString, len).cstr());
    116 @@ -462,7 +466,7 @@
     116@@ -466,7 +470,7 @@ bool pnSocket::sendMsg(const msgparm_t* data, const pnNetMsg* msg)
    117117         case kFieldVarCount:
    118118             size = field->fSize;
    119119             count = data[i].fUint;
    120 -            *(hsUint32*)bp = count;
    121 +            *(hsUint32*)bp = LESWAP32(count);
    122              bp += sizeof(hsUint32);
     120-            *(uint32_t*)bp = count;
     121+            *(uint32_t*)bp = LESWAP32(count);
     122             bp += sizeof(uint32_t);
    123123 #ifdef COMMDEBUG
    124124             plDebug::Debug("     -> Count: %d", count);
    125 @@ -536,8 +540,13 @@
     125@@ -540,8 +544,13 @@ msgparm_t* pnSocket::recvMsg(const pnNetMsg* msg)
    126126             {
    127                  hsUint16 len;
    128                  recv(&len, sizeof(hsUint16));
     127                 uint16_t len;
     128                 recv(&len, sizeof(uint16_t));
    129129+                len = LESWAP16(len);
    130130                 pl_wchar_t* str = new pl_wchar_t[len + 1];
     
    137137                 data[i].fString = str;
    138138 #ifdef COMMDEBUG
    139 @@ -548,7 +557,7 @@
     139@@ -552,7 +561,7 @@ msgparm_t* pnSocket::recvMsg(const pnNetMsg* msg)
    140140         case kFieldVarCount:
    141141             size = field->fSize;
    142              recv(&count, sizeof(hsUint32));
     142             recv(&count, sizeof(uint32_t));
    143143-            data[i].fUint = count;
    144144+            data[i].fUint = LESWAP32(count);
     
    146146             plDebug::Debug("     <- Count: %d", count);
    147147 #endif
    148 --- net/file/pnFileClient.cpp.orig      Thu Nov 11 11:14:21 2010 -0800
    149 +++ net/file/pnFileClient.cpp   Thu Nov 18 15:52:46 2010 -0600
    150 @@ -115,6 +115,8 @@
     148--- net/file/pnFileClient.cpp.orig
     149+++ net/file/pnFileClient.cpp
     150@@ -115,6 +115,8 @@ bool pnFileClient::Dispatch::dispatch(pnSocket* sock)
    151151 
    152152     sock->recv(&header.fMsgSize, sizeof(header.fMsgSize));
     
    154154+    header.fMsgSize = LESWAP32(header.fMsgSize);
    155155+    header.fMsgId = LESWAP32(header.fMsgId);
    156      hsUbyte* msgbuf = new hsUbyte[header.fMsgSize - 8];
    157      hsUint32 read_data = 0;
     156     uint8_t* msgbuf = new uint8_t[header.fMsgSize - 8];
     157     uint32_t read_data = 0;
    158158     while (read_data < header.fMsgSize - 8)
    159 @@ -239,13 +241,13 @@
    160      hsUbyte connectHeader[43];  // ConnectHeader + FileConnectHeader
     159@@ -239,13 +241,13 @@ ENetError pnFileClient::performConnect()
     160     uint8_t connectHeader[43];  // ConnectHeader + FileConnectHeader
    161161     /* Begin ConnectHeader */
    162      *(hsUbyte* )(connectHeader     ) = kConnTypeCliToFile;
    163 -    *(hsUint16*)(connectHeader +  1) = 31;
    164 +    *(hsUint16*)(connectHeader +  1) = LESWAP16(31);
    165      *(hsUint32*)(connectHeader +  3) = 0;
    166 -    *(hsUint32*)(connectHeader +  7) = fBuildType;
    167 -    *(hsUint32*)(connectHeader + 11) = fBranchId;
    168 +    *(hsUint32*)(connectHeader +  7) = LESWAP32(fBuildType);
    169 +    *(hsUint32*)(connectHeader + 11) = LESWAP32(fBranchId);
     162     *(uint8_t* )(connectHeader     ) = kConnTypeCliToFile;
     163-    *(uint16_t*)(connectHeader +  1) = 31;
     164+    *(uint16_t*)(connectHeader +  1) = LESWAP16(31);
     165     *(uint32_t*)(connectHeader +  3) = 0;
     166-    *(uint32_t*)(connectHeader +  7) = fBuildType;
     167-    *(uint32_t*)(connectHeader + 11) = fBranchId;
     168+    *(uint32_t*)(connectHeader +  7) = LESWAP32(fBuildType);
     169+    *(uint32_t*)(connectHeader + 11) = LESWAP32(fBranchId);
    170170     fProductId.write(connectHeader + 15);
    171171     /* Begin FileConnectHeader */
    172 -    *(hsUint32*)(connectHeader + 31) = 12;
    173 +    *(hsUint32*)(connectHeader + 31) = LESWAP32(12);
    174      *(hsUint32*)(connectHeader + 35) = 0;
    175      *(hsUint32*)(connectHeader + 39) = 0;
     172-    *(uint32_t*)(connectHeader + 31) = 12;
     173+    *(uint32_t*)(connectHeader + 31) = LESWAP32(12);
     174     *(uint32_t*)(connectHeader + 35) = 0;
     175     *(uint32_t*)(connectHeader + 39) = 0;
    176176     fSock->send(connectHeader, 43);
    177 @@ -269,9 +271,9 @@
    178  void pnFileClient::sendPingRequest(hsUint32 pingTimeMs)
    179  {
    180      hsUbyte msgbuf[12];
    181 -    *(hsUint32*)(msgbuf    ) = 12;                      // Msg size
    182 -    *(hsUint32*)(msgbuf + 4) = kCli2File_PingRequest;   // Msg ID
    183 -    *(hsUint32*)(msgbuf + 8) = pingTimeMs;              // Ping time
    184 +    *(hsUint32*)(msgbuf    ) = LESWAP32(12);                    // Msg size
    185 +    *(hsUint32*)(msgbuf + 4) = LESWAP32(kCli2File_PingRequest); // Msg ID
    186 +    *(hsUint32*)(msgbuf + 8) = LESWAP32(pingTimeMs);            // Ping time
     177@@ -269,9 +271,9 @@ ENetError pnFileClient::performConnect()
     178 void pnFileClient::sendPingRequest(uint32_t pingTimeMs)
     179 {
     180     uint8_t msgbuf[12];
     181-    *(uint32_t*)(msgbuf    ) = 12;                      // Msg size
     182-    *(uint32_t*)(msgbuf + 4) = kCli2File_PingRequest;   // Msg ID
     183-    *(uint32_t*)(msgbuf + 8) = pingTimeMs;              // Ping time
     184+    *(uint32_t*)(msgbuf    ) = LESWAP32(12);                    // Msg size
     185+    *(uint32_t*)(msgbuf + 4) = LESWAP32(kCli2File_PingRequest); // Msg ID
     186+    *(uint32_t*)(msgbuf + 8) = LESWAP32(pingTimeMs);            // Ping time
    187187     fSock->send(msgbuf, 12);
    188188 }
    189189 
    190 @@ -279,9 +281,9 @@
    191  {
    192      hsUint32 transId = nextTransId();
    193      hsUbyte msgbuf[12];
    194 -    *(hsUint32*)(msgbuf    ) = 12;                          // Msg size
    195 -    *(hsUint32*)(msgbuf + 4) = kCli2File_BuildIdRequest;    // Msg ID
    196 -    *(hsUint32*)(msgbuf + 8) = transId;                     // Trans ID
    197 +    *(hsUint32*)(msgbuf    ) = LESWAP32(12);                        // Msg size
    198 +    *(hsUint32*)(msgbuf + 4) = LESWAP32(kCli2File_BuildIdRequest);  // Msg ID
    199 +    *(hsUint32*)(msgbuf + 8) = LESWAP32(transId);                   // Trans ID
     190@@ -279,9 +281,9 @@ uint32_t pnFileClient::sendBuildIdRequest()
     191 {
     192     uint32_t transId = nextTransId();
     193     uint8_t msgbuf[12];
     194-    *(uint32_t*)(msgbuf    ) = 12;                          // Msg size
     195-    *(uint32_t*)(msgbuf + 4) = kCli2File_BuildIdRequest;    // Msg ID
     196-    *(uint32_t*)(msgbuf + 8) = transId;                     // Trans ID
     197+    *(uint32_t*)(msgbuf    ) = LESWAP32(12);                        // Msg size
     198+    *(uint32_t*)(msgbuf + 4) = LESWAP32(kCli2File_BuildIdRequest);  // Msg ID
     199+    *(uint32_t*)(msgbuf + 8) = LESWAP32(transId);                   // Trans ID
    200200     fSock->send(msgbuf, 12);
    201201     return transId;
    202202 }
    203 @@ -293,12 +295,12 @@
    204  
    205      hsUint32 transId = nextTransId();
    206      hsUbyte msgbuf[536];
    207 -    *(hsUint32*)(msgbuf    ) = 536;                         // Msg size
    208 -    *(hsUint32*)(msgbuf + 4) = kCli2File_ManifestRequest;   // Msg ID
    209 -    *(hsUint32*)(msgbuf + 8) = transId;                     // Trans ID
    210 +    *(hsUint32*)(msgbuf    ) = LESWAP32(536);                       // Msg size
    211 +    *(hsUint32*)(msgbuf + 4) = LESWAP32(kCli2File_ManifestRequest); // Msg ID
    212 +    *(hsUint32*)(msgbuf + 8) = LESWAP32(transId);                   // Trans ID
     203@@ -293,12 +295,12 @@ uint32_t pnFileClient::sendManifestRequest(const plString& group, uint32_t build
     204 
     205     uint32_t transId = nextTransId();
     206     uint8_t msgbuf[536];
     207-    *(uint32_t*)(msgbuf    ) = 536;                         // Msg size
     208-    *(uint32_t*)(msgbuf + 4) = kCli2File_ManifestRequest;   // Msg ID
     209-    *(uint32_t*)(msgbuf + 8) = transId;                     // Trans ID
     210+    *(uint32_t*)(msgbuf    ) = LESWAP32(536);                       // Msg size
     211+    *(uint32_t*)(msgbuf + 4) = LESWAP32(kCli2File_ManifestRequest); // Msg ID
     212+    *(uint32_t*)(msgbuf + 8) = LESWAP32(transId);                   // Trans ID
    213213     memcpy(msgbuf + 12, wgroup.data(), (len >= 260 ? 259 : len) * sizeof(pl_wchar_t));
    214214-    *(pl_wchar_t*)(msgbuf + 530) = 0;                       // Nul terminator
    215 -    *(hsUint32*)(msgbuf + 532) = buildId;                   // Build ID
     215-    *(uint32_t*)(msgbuf + 532) = buildId;                   // Build ID
    216216+    *(pl_wchar_t*)(msgbuf + 530) = 0;                               // Nul terminator
    217 +    *(hsUint32*)(msgbuf + 532) = LESWAP32(buildId);                 // Build ID
     217+    *(uint32_t*)(msgbuf + 532) = LESWAP32(buildId);                 // Build ID
    218218     fSock->send(msgbuf, 536);
    219219     return transId;
    220220 }
    221 @@ -310,12 +312,12 @@
    222  
    223      hsUint32 transId = nextTransId();
    224      hsUbyte msgbuf[536];
    225 -    *(hsUint32*)(msgbuf    ) = 536;                             // Msg size
    226 -    *(hsUint32*)(msgbuf + 4) = kCli2File_FileDownloadRequest;   // Msg ID
    227 -    *(hsUint32*)(msgbuf + 8) = transId;                         // Trans ID
    228 +    *(hsUint32*)(msgbuf    ) = LESWAP32(536);                           // Msg size
    229 +    *(hsUint32*)(msgbuf + 4) = LESWAP32(kCli2File_FileDownloadRequest); // Msg ID
    230 +    *(hsUint32*)(msgbuf + 8) = LESWAP32(transId);                       // Trans ID
     221@@ -310,12 +312,12 @@ uint32_t pnFileClient::sendFileDownloadRequest(const plString& filename, uint32_
     222 
     223     uint32_t transId = nextTransId();
     224     uint8_t msgbuf[536];
     225-    *(uint32_t*)(msgbuf    ) = 536;                             // Msg size
     226-    *(uint32_t*)(msgbuf + 4) = kCli2File_FileDownloadRequest;   // Msg ID
     227-    *(uint32_t*)(msgbuf + 8) = transId;                         // Trans ID
     228+    *(uint32_t*)(msgbuf    ) = LESWAP32(536);                           // Msg size
     229+    *(uint32_t*)(msgbuf + 4) = LESWAP32(kCli2File_FileDownloadRequest); // Msg ID
     230+    *(uint32_t*)(msgbuf + 8) = LESWAP32(transId);                       // Trans ID
    231231     memcpy(msgbuf + 12, wfilename.data(), (len >= 260 ? 259 : len) * sizeof(pl_wchar_t));
    232232-    *(pl_wchar_t*)(msgbuf + 530) = 0;                           // Nul terminator
    233 -    *(hsUint32*)(msgbuf + 532) = buildId;                       // Build ID
     233-    *(uint32_t*)(msgbuf + 532) = buildId;                       // Build ID
    234234+    *(pl_wchar_t*)(msgbuf + 530) = 0;                                   // Nul terminator
    235 +    *(hsUint32*)(msgbuf + 532) = LESWAP32(buildId);                     // Build ID
     235+    *(uint32_t*)(msgbuf + 532) = LESWAP32(buildId);                     // Build ID
    236236     fSock->send(msgbuf, 536);
    237237     return transId;
    238238 }
    239 @@ -323,20 +325,20 @@
    240  void pnFileClient::sendManifestEntryAck(hsUint32 transId, hsUint32 readerId)
    241  {
    242      hsUbyte msgbuf[16];
    243 -    *(hsUint32*)(msgbuf     ) = 16;                         // Msg size
    244 -    *(hsUint32*)(msgbuf +  4) = kCli2File_ManifestEntryAck; // Msg ID
    245 -    *(hsUint32*)(msgbuf +  8) = transId;                    // Trans ID
    246 -    *(hsUint32*)(msgbuf + 12) = readerId;                   // Reader ID
    247 +    *(hsUint32*)(msgbuf     ) = LESWAP32(16);                           // Msg size
    248 +    *(hsUint32*)(msgbuf +  4) = LESWAP32(kCli2File_ManifestEntryAck);   // Msg ID
    249 +    *(hsUint32*)(msgbuf +  8) = LESWAP32(transId);                      // Trans ID
    250 +    *(hsUint32*)(msgbuf + 12) = LESWAP32(readerId);                     // Reader ID
     239@@ -323,20 +325,20 @@ uint32_t pnFileClient::sendFileDownloadRequest(const plString& filename, uint32_
     240 void pnFileClient::sendManifestEntryAck(uint32_t transId, uint32_t readerId)
     241 {
     242     uint8_t msgbuf[16];
     243-    *(uint32_t*)(msgbuf     ) = 16;                         // Msg size
     244-    *(uint32_t*)(msgbuf +  4) = kCli2File_ManifestEntryAck; // Msg ID
     245-    *(uint32_t*)(msgbuf +  8) = transId;                    // Trans ID
     246-    *(uint32_t*)(msgbuf + 12) = readerId;                   // Reader ID
     247+    *(uint32_t*)(msgbuf     ) = LESWAP32(16);                           // Msg size
     248+    *(uint32_t*)(msgbuf +  4) = LESWAP32(kCli2File_ManifestEntryAck);   // Msg ID
     249+    *(uint32_t*)(msgbuf +  8) = LESWAP32(transId);                      // Trans ID
     250+    *(uint32_t*)(msgbuf + 12) = LESWAP32(readerId);                     // Reader ID
    251251     fSock->send(msgbuf, 16);
    252252 }
    253253 
    254  void pnFileClient::sendFileDownloadChunkAck(hsUint32 transId, hsUint32 readerId)
    255  {
    256      hsUbyte msgbuf[16];
    257 -    *(hsUint32*)(msgbuf     ) = 16;                             // Msg size
    258 -    *(hsUint32*)(msgbuf +  4) = kCli2File_FileDownloadChunkAck; // Msg ID
    259 -    *(hsUint32*)(msgbuf +  8) = transId;                        // Trans ID
    260 -    *(hsUint32*)(msgbuf + 12) = readerId;                       // Reader ID
    261 +    *(hsUint32*)(msgbuf     ) = LESWAP32(16);                               // Msg size
    262 +    *(hsUint32*)(msgbuf +  4) = LESWAP32(kCli2File_FileDownloadChunkAck);   // Msg ID
    263 +    *(hsUint32*)(msgbuf +  8) = LESWAP32(transId);                          // Trans ID
    264 +    *(hsUint32*)(msgbuf + 12) = LESWAP32(readerId);                         // Reader ID
     254 void pnFileClient::sendFileDownloadChunkAck(uint32_t transId, uint32_t readerId)
     255 {
     256     uint8_t msgbuf[16];
     257-    *(uint32_t*)(msgbuf     ) = 16;                             // Msg size
     258-    *(uint32_t*)(msgbuf +  4) = kCli2File_FileDownloadChunkAck; // Msg ID
     259-    *(uint32_t*)(msgbuf +  8) = transId;                        // Trans ID
     260-    *(uint32_t*)(msgbuf + 12) = readerId;                       // Reader ID
     261+    *(uint32_t*)(msgbuf     ) = LESWAP32(16);                               // Msg size
     262+    *(uint32_t*)(msgbuf +  4) = LESWAP32(kCli2File_FileDownloadChunkAck);   // Msg ID
     263+    *(uint32_t*)(msgbuf +  8) = LESWAP32(transId);                          // Trans ID
     264+    *(uint32_t*)(msgbuf + 12) = LESWAP32(readerId);                         // Reader ID
    265265     fSock->send(msgbuf, 16);
    266266 }
    267267 
    268 --- net/game/pnGameClient.cpp.orig      Thu Nov 11 11:14:21 2010 -0800
    269 +++ net/game/pnGameClient.cpp   Thu Nov 18 15:52:46 2010 -0600
    270 @@ -35,6 +35,7 @@
    271      hsUint16 msgId;
    272  
    273      sock->recv(&msgId, sizeof(hsUint16));
     268--- net/game/pnGameClient.cpp.orig
     269+++ net/game/pnGameClient.cpp
     270@@ -35,6 +35,7 @@ bool pnGameClient::Dispatch::dispatch(pnSocket* sock)
     271     uint16_t msgId;
     272 
     273     sock->recv(&msgId, sizeof(uint16_t));
    274274+    msgId = LESWAP16(msgId);
    275275     const pnNetMsg* msgDesc = GET_Game2Cli(msgId);
    276276     if (msgDesc == NULL) {
    277277         plDebug::Error("Got invalid message ID (%u)", msgId);
    278 @@ -153,13 +154,13 @@
    279      hsUbyte connectHeader[67];  // ConnectHeader + GameConnectHeader
     278@@ -153,13 +154,13 @@ ENetError pnGameClient::performConnect()
     279     uint8_t connectHeader[67];  // ConnectHeader + GameConnectHeader
    280280     /* Begin ConnectHeader */
    281      *(hsUbyte* )(connectHeader     ) = kConnTypeCliToGame;
    282 -    *(hsUint16*)(connectHeader +  1) = 31;
    283 -    *(hsUint32*)(connectHeader +  3) = fBuildId;
    284 -    *(hsUint32*)(connectHeader +  7) = fBuildType;
    285 -    *(hsUint32*)(connectHeader + 11) = fBranchId;
    286 +    *(hsUint16*)(connectHeader +  1) = LESWAP16(31);
    287 +    *(hsUint32*)(connectHeader +  3) = LESWAP32(fBuildId);
    288 +    *(hsUint32*)(connectHeader +  7) = LESWAP32(fBuildType);
    289 +    *(hsUint32*)(connectHeader + 11) = LESWAP32(fBranchId);
     281     *(uint8_t* )(connectHeader     ) = kConnTypeCliToGame;
     282-    *(uint16_t*)(connectHeader +  1) = 31;
     283-    *(uint32_t*)(connectHeader +  3) = fBuildId;
     284-    *(uint32_t*)(connectHeader +  7) = fBuildType;
     285-    *(uint32_t*)(connectHeader + 11) = fBranchId;
     286+    *(uint16_t*)(connectHeader +  1) = LESWAP16(31);
     287+    *(uint32_t*)(connectHeader +  3) = LESWAP32(fBuildId);
     288+    *(uint32_t*)(connectHeader +  7) = LESWAP32(fBuildType);
     289+    *(uint32_t*)(connectHeader + 11) = LESWAP32(fBranchId);
    290290     fProductId.write(connectHeader + 15);
    291291     /* Begin GameConnectHeader */
    292 -    *(hsUint32*)(connectHeader + 31) = 36;
    293 +    *(hsUint32*)(connectHeader + 31) = LESWAP32(36);
     292-    *(uint32_t*)(connectHeader + 31) = 36;
     293+    *(uint32_t*)(connectHeader + 31) = LESWAP32(36);
    294294     fAccountId.write(connectHeader + 35);
    295295     fAgeId.write(connectHeader + 51);
    296296     fSock->send(connectHeader, 67);
    297 @@ -208,6 +209,7 @@
     297@@ -208,6 +209,7 @@ ENetError pnGameClient::performConnect()
    298298     } else if (msg == kNetCliSrv2CliError) {
    299          hsUint32 errorCode;
    300          fSock->recv(&errorCode, sizeof(hsUint32));
     299         uint32_t errorCode;
     300         fSock->recv(&errorCode, sizeof(uint32_t));
    301301+        errorCode = LESWAP32(errorCode);
    302302         delete fSock;
    303303         fSock = NULL;
    304304         plDebug::Error("Error connecting to Game server: %s",
    305 --- net/gate/pnGateKeeperClient.cpp.orig        Thu Nov 11 11:14:21 2010 -0800
    306 +++ net/gate/pnGateKeeperClient.cpp     Thu Nov 18 15:52:46 2010 -0600
    307 @@ -33,6 +33,7 @@
    308  {
    309      hsUint16 msgId;
    310      sock->recv(&msgId, sizeof(hsUint16));
     305--- net/gate/pnGateKeeperClient.cpp.orig
     306+++ net/gate/pnGateKeeperClient.cpp
     307@@ -33,6 +33,7 @@ bool pnGateKeeperClient::Dispatch::dispatch(pnSocket* sock)
     308 {
     309     uint16_t msgId;
     310     sock->recv(&msgId, sizeof(uint16_t));
    311311+    msgId = LESWAP16(msgId);
    312312     const pnNetMsg* msgDesc = GET_GateKeeper2Cli(msgId);
    313313     if (msgDesc == NULL) {
    314314         plDebug::Error("Got invalid message ID (%u)", msgId);
    315 @@ -121,13 +122,13 @@
    316      hsUbyte connectHeader[51];  // ConnectHeader + GateKeeperConnectHeader
     315@@ -121,13 +122,13 @@ ENetError pnGateKeeperClient::performConnect()
     316     uint8_t connectHeader[51];  // ConnectHeader + GateKeeperConnectHeader
    317317     /* Begin ConnectHeader */
    318      *(hsUbyte* )(connectHeader     ) = kConnTypeCliToGateKeeper;
    319 -    *(hsUint16*)(connectHeader +  1) = 31;
    320 -    *(hsUint32*)(connectHeader +  3) = fBuildId;
    321 -    *(hsUint32*)(connectHeader +  7) = fBuildType;
    322 -    *(hsUint32*)(connectHeader + 11) = fBranchId;
    323 +    *(hsUint16*)(connectHeader +  1) = LESWAP16(31);
    324 +    *(hsUint32*)(connectHeader +  3) = LESWAP32(fBuildId);
    325 +    *(hsUint32*)(connectHeader +  7) = LESWAP32(fBuildType);
    326 +    *(hsUint32*)(connectHeader + 11) = LESWAP32(fBranchId);
     318     *(uint8_t* )(connectHeader     ) = kConnTypeCliToGateKeeper;
     319-    *(uint16_t*)(connectHeader +  1) = 31;
     320-    *(uint32_t*)(connectHeader +  3) = fBuildId;
     321-    *(uint32_t*)(connectHeader +  7) = fBuildType;
     322-    *(uint32_t*)(connectHeader + 11) = fBranchId;
     323+    *(uint16_t*)(connectHeader +  1) = LESWAP16(31);
     324+    *(uint32_t*)(connectHeader +  3) = LESWAP32(fBuildId);
     325+    *(uint32_t*)(connectHeader +  7) = LESWAP32(fBuildType);
     326+    *(uint32_t*)(connectHeader + 11) = LESWAP32(fBranchId);
    327327     fProductId.write(connectHeader + 15);
    328328     /* Begin GateKeeperConnectHeader */
    329 -    *(hsUint32*)(connectHeader + 31) = 20;
    330 +    *(hsUint32*)(connectHeader + 31) = LESWAP32(20);
     329-    *(uint32_t*)(connectHeader + 31) = 20;
     330+    *(uint32_t*)(connectHeader + 31) = LESWAP32(20);
    331331     memset(connectHeader + 35, 0, 16);
    332332     fSock->send(connectHeader, 51);
    333333 
    334 @@ -175,6 +176,7 @@
     334@@ -175,6 +176,7 @@ ENetError pnGateKeeperClient::performConnect()
    335335     } else if (msg == kNetCliSrv2CliError) {
    336          hsUint32 errorCode;
    337          fSock->recv(&errorCode, sizeof(hsUint32));
     336         uint32_t errorCode;
     337         fSock->recv(&errorCode, sizeof(uint32_t));
    338338+        errorCode = LESWAP32(errorCode);
    339339         delete fSock;
Note: See TracChangeset for help on using the changeset viewer.