Cuberite Forum
1.8 Changes - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: 1.8 Changes (/thread-1345.html)

Pages: 1 2 3


1.8 Changes - daniel0916 - 02-03-2014

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.


RE: 1.8 Changes - daniel0916 - 02-03-2014

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
}



RE: 1.8 Changes - xoft - 02-03-2014

Without the actual on-wire data, there's very little debugging we can do.


RE: 1.8 Changes - daniel0916 - 02-03-2014

https://github.com/daniel0916/MCServer/commit/2539af503846130b699fdd22a91cfe1fb56cf25c
I don't know if it's the ClientSetting Packet or the Entity Relative Move Packet. Maybe you find the problem.


RE: 1.8 Changes - daniel0916 - 02-04-2014

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)



RE: 1.8 Changes - worktycho - 02-04-2014

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.


RE: 1.8 Changes - daniel0916 - 02-04-2014

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?


RE: 1.8 Changes - worktycho - 02-04-2014

They already exist, there just called readBEInt64 and writeBEInt64


RE: 1.8 Changes - daniel0916 - 02-04-2014

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.


RE: 1.8 Changes - xoft - 02-04-2014

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.