1.8 Changes
#11
When i decode x, y, z and then encode that. The x, y, z aren't the same.

void WritePosition(int x, int y, int z)
		{
			long encoded_x = (x & 0x3FFFFFF) << 38;
			long encoded_y = (y & 0xFFF) << 26;
			long encoded_z = (z & 0x3FFFFFF);
			long value = encoded_x | encoded_y | encoded_z;

			LOGWARN(std::to_string(x).c_str());
			LOGWARN(std::to_string(y).c_str());
			LOGWARN(std::to_string(z).c_str());

			LOGWARN(std::to_string(encoded_x).c_str());
			LOGWARN(std::to_string(encoded_y).c_str());
			LOGWARN(std::to_string(encoded_z).c_str());
			LOGWARN(std::to_string(value).c_str());

			long x2 = value >> 38;
			long y2 = value << 26 >> 52;
			long z2 = value << 38 >> 38;
			LOGWARN(std::to_string(x2).c_str());
			LOGWARN(std::to_string(y2).c_str());
			LOGWARN(std::to_string(z2).c_str());

			m_Out.WriteBEInt64(value);
		}

LOGWARN("Spawn Position");
		cPacketizer Pkt(*this, 0x05);  // Spawn Position packet
		Pkt.WritePosition(100, 100, 80);

LOG:
Code:
[2a8c|18:01:09] Spawn Position
[2a8c|18:01:09] 100
[2a8c|18:01:09] 100
[2a8c|18:01:09] 80
[2a8c|18:01:09] 6400
[2a8c|18:01:09] -1879048192
[2a8c|18:01:09] 80
[2a8c|18:01:09] -1879041712
[2a8c|18:01:09] -29360027
[2a8c|18:01:09] 1024
[2a8c|18:01:09] 6480

Edit: Maybe the encode value from the client is not the same like my encode value. I will try it.
Reply
Thanks given by:


Messages In This Thread
1.8 Changes - by daniel0916 - 02-03-2014, 01:37 AM
RE: 1.8 Changes - by daniel0916 - 02-03-2014, 05:04 AM
RE: 1.8 Changes - by xoft - 02-03-2014, 05:18 AM
RE: 1.8 Changes - by daniel0916 - 02-03-2014, 05:38 AM
RE: 1.8 Changes - by daniel0916 - 02-04-2014, 12:41 AM
RE: 1.8 Changes - by worktycho - 02-04-2014, 02:56 AM
RE: 1.8 Changes - by daniel0916 - 02-04-2014, 04:12 AM
RE: 1.8 Changes - by worktycho - 02-04-2014, 04:27 AM
RE: 1.8 Changes - by daniel0916 - 02-04-2014, 05:00 AM
RE: 1.8 Changes - by xoft - 02-04-2014, 05:04 AM
RE: 1.8 Changes - by daniel0916 - 02-05-2014, 03:00 AM
RE: 1.8 Changes - by FakeTruth - 02-05-2014, 07:03 AM
RE: 1.8 Changes - by daniel0916 - 02-05-2014, 04:05 PM
RE: 1.8 Changes - by FakeTruth - 02-05-2014, 11:07 PM
RE: 1.8 Changes - by xoft - 02-06-2014, 01:30 AM
RE: 1.8 Changes - by daniel0916 - 02-07-2014, 03:20 AM
RE: 1.8 Changes - by daniel0916 - 02-09-2014, 05:42 AM
RE: 1.8 Changes - by xoft - 02-09-2014, 06:55 AM
RE: 1.8 Changes - by tigerw - 02-09-2014, 07:05 AM
RE: 1.8 Changes - by xoft - 02-09-2014, 07:07 AM
RE: 1.8 Changes - by daniel0916 - 02-09-2014, 08:41 PM



Users browsing this thread: 6 Guest(s)