mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 10:05:44 -04:00
Implement reading of BlockDefinitions packet, but no actual support yet.
This commit is contained in:
parent
5fb2f45189
commit
8a531558ff
@ -39,6 +39,8 @@ namespace ClassicalSharp {
|
|||||||
CpeHackControl = 32,
|
CpeHackControl = 32,
|
||||||
CpeExtAddEntity2 = 33,
|
CpeExtAddEntity2 = 33,
|
||||||
CpePlayerClick = 34,
|
CpePlayerClick = 34,
|
||||||
|
CpeDefineBlock = 35,
|
||||||
|
CpeDefineLiquid = 36,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CpeMessage {
|
public enum CpeMessage {
|
||||||
|
@ -116,7 +116,7 @@ namespace ClassicalSharp {
|
|||||||
readonly int[] packetSizes = {
|
readonly int[] packetSizes = {
|
||||||
131, 1, 1, 1028, 7, 9, 8, 74, 10, 7, 5, 4, 2,
|
131, 1, 1, 1028, 7, 9, 8, 74, 10, 7, 5, 4, 2,
|
||||||
66, 65, 2, 67, 69, 3, 2, 3, 134, 196, 130, 3,
|
66, 65, 2, 67, 69, 3, 2, 3, 134, 196, 130, 3,
|
||||||
8, 86, 2, 4, 66, 69, 2, 8, 138,
|
8, 86, 2, 4, 66, 69, 2, 8, 138, 0, 76, 78,
|
||||||
};
|
};
|
||||||
|
|
||||||
static string[] clientExtensions = {
|
static string[] clientExtensions = {
|
||||||
@ -638,6 +638,31 @@ namespace ClassicalSharp {
|
|||||||
AddEntity( entityId, displayName, skinName, true );
|
AddEntity( entityId, displayName, skinName, true );
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case PacketId.CpeDefineBlock:
|
||||||
|
case PacketId.CpeDefineLiquid:
|
||||||
|
{
|
||||||
|
byte block = reader.ReadUInt8();
|
||||||
|
string name = reader.ReadAsciiString();
|
||||||
|
byte solidity = reader.ReadUInt8();
|
||||||
|
byte movementSpeed = reader.ReadUInt8();
|
||||||
|
byte topTexId = reader.ReadUInt8();
|
||||||
|
byte sidesTexId = reader.ReadUInt8();
|
||||||
|
byte bottomTexId = reader.ReadUInt8();
|
||||||
|
reader.ReadUInt8(); // opacity hint, but we ignore this.
|
||||||
|
bool transmitsLight = reader.ReadUInt8() != 0;
|
||||||
|
reader.ReadUInt8(); // walk sound, but we ignore this.
|
||||||
|
|
||||||
|
if( opcode == (byte)PacketId.CpeDefineBlock ) {
|
||||||
|
byte shape = reader.ReadUInt8();
|
||||||
|
byte blockDraw = reader.ReadUInt8();
|
||||||
|
} else {
|
||||||
|
byte fogDensity = reader.ReadUInt8();
|
||||||
|
byte fogR = reader.ReadUInt8();
|
||||||
|
byte fogG = reader.ReadUInt8();
|
||||||
|
byte fogB = reader.ReadUInt8();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new NotImplementedException( "Unsupported packet:" + (PacketId)opcode );
|
throw new NotImplementedException( "Unsupported packet:" + (PacketId)opcode );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user