[gunzemulator] r360 committed - Fixed MUID recieving. Sending is still broken though.

0 views
Skip to first unread message

gunzem...@googlecode.com

unread,
Jun 30, 2010, 7:20:28 PM6/30/10
to gogo-dev...@googlegroups.com
Revision: 360
Author: cg.wowus.cg
Date: Wed Jun 30 16:20:06 2010
Log: Fixed MUID recieving. Sending is still broken though.
http://code.google.com/p/gunzemulator/source/detail?r=360

Modified:
/trunk/cockpit/src/packet/security.cpp
/trunk/cockpit/test/test_param_extraction.cpp

=======================================
--- /trunk/cockpit/src/packet/security.cpp Wed Jun 23 14:56:27 2010
+++ /trunk/cockpit/src/packet/security.cpp Wed Jun 30 16:20:06 2010
@@ -115,7 +115,13 @@

uint64_t extract_MUID(const uint8_t* paramStart, const uint8_t**
currentParam, uint16_t packetLength)
{
- return extract_arbitrary_integer<uint64_t>(paramStart, currentParam,
packetLength);
+ uint64_t highBytes = extract_arbitrary_integer<uint32_t>(paramStart,
currentParam, packetLength);
+ uint64_t lowBytes = extract_arbitrary_integer<uint32_t>(paramStart,
currentParam, packetLength);
+
+ highBytes <<= sizeof(uint32_t) * 8;
+ highBytes &= 0xFFFFFFFF00000000;
+
+ return highBytes | lowBytes;
}

tuple<Buffer /* data */, size_t /* count */, size_t /* size */>
=======================================
--- /trunk/cockpit/test/test_param_extraction.cpp Wed Jun 23 14:51:22 2010
+++ /trunk/cockpit/test/test_param_extraction.cpp Wed Jun 30 16:20:06 2010
@@ -453,8 +453,8 @@
try {
const uint8_t* ptr = buffer;

- check_equal(extract_MUID(buffer, &ptr, countof(buffer)),
static_cast<uint64_t>(0x4433221100EFCDAB));
- check_equal(extract_MUID(buffer, &ptr, countof(buffer)),
static_cast<uint64_t>(0xCCBBAA9988776655));
+ check_equal(extract_MUID(buffer, &ptr, countof(buffer)),
static_cast<uint64_t>(0x00EFCDAB44332211));
+ check_equal(extract_MUID(buffer, &ptr, countof(buffer)),
static_cast<uint64_t>(0x88776655CCBBAA99));

check_equal(ptr, buffer + sizeof(buffer) - 4);

@@ -495,8 +495,8 @@
0x10, 0x00, 0x00, 0x00, // totalSize
0x04, 0x00, 0x00, 0x00, // elementSize
0x02, 0x00, 0x00, 0x00, // elementCount
- 0x11, 0x22, 0x33, 0x44,
- 0x55, 0x66, 0x77, 0x88
+ 0x11, 0x22, 0x33, 0x44,
+ 0x55, 0x66, 0x77, 0x88
};

const uint8_t* ptr = buffer;

Reply all
Reply to author
Forward
0 new messages