1.8 Changes
#1
I will start working to add the 1.8 changes (It's only a nextproject. Enchanting is more important.).

Now i will make the protocol. I will use the 1.7 Protocol and override the new things (like in older protocols. 1.6 or so..).


Okay, my code is shit.
But now i have it. I removed my old question.
Reply
Thanks given by: Antonio
#2
Little problem.
Code:
Protocol 1.7: Wrong number of bytes read for packet 0x15, state 3. Read 12 bytes, packet contained 11 bytes
0x15 is the ClientSettings packet or?

void cProtocol180::HandlePacketClientSettings(cByteBuffer & a_ByteBuffer)
{
	LOGWARN("Client Settings");
	HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Locale);
	HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ViewDistance);
	HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ChatFlags);
	HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ChatColors);
	HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ShowCape);
	// TODO: handle in m_Client
}
Reply
Thanks given by:
#3
Without the actual on-wire data, there's very little debugging we can do.
Reply
Thanks given by:
#4
https://github.com/daniel0916/MCServer/c...1fb56cf25c
I don't know if it's the ClientSetting Packet or the Entity Relative Move Packet. Maybe you find the problem.
Reply
Thanks given by:
#5
I found the problem.
I use:
void HandlePacketClientSettings(cByteBuffer & a_ByteBuffer);
But i need to override it.
void HandlePacketClientSettings(cByteBuffer & a_ByteBuffer) override;
But this don't work.

Error:
Code:
error C3668: "cProtocol180::HandlePacketClientSettings": The method with override specifier 'override' did not override any base class methods. (Protocol\Protocol18x.cpp)
Reply
Thanks given by:
#6
You need to make it virtual if you want any non-overirden methods to use it. If you dont want to use it in non-overriden methods then you need to remove the override keyword.
Reply
Thanks given by: daniel0916
#7
Okay. Now i will start working with 14w03a.
The new datatype position is long. So i need a ReadLong and WriteLong in the ByteBuffer.
But i don't know how can i create this. Can someone help me there?
Reply
Thanks given by:
#8
They already exist, there just called readBEInt64 and writeBEInt64
Reply
Thanks given by: daniel0916
#9
Code:
cPacketizer Pkt(*this, 0x05);  // Spawn Position packet
		Pkt.WriteLong(((int)a_World.GetSpawnX() & 0x3FFFFFF) << 38 | ((int)a_World.GetSpawnY() & 0xFFF) << 26 | ((int)a_World.GetSpawnZ() & 0x3FFFFFF));

And in the Protocol17x.h:
void WriteLong(long a_Value)
		{
			m_Out.WriteBEInt64(a_Value);
		}

The error from the client is in the attachment.


Attached Files Thumbnail(s)
   
Reply
Thanks given by:
#10
I think you should instead make a cPacketizer::WritePosition(x, y, z) and inside it compose and write the 64-bit value. I think you're overflowing the arithmetic here, but that's just a wild guess.
Reply
Thanks given by: daniel0916




Users browsing this thread: 1 Guest(s)