Use 1.15.2 for now

This commit is contained in:
Joshua Ashton 2020-08-03 07:31:33 +01:00
parent 4b6646d8a0
commit 5f1af9226a
5 changed files with 215 additions and 28 deletions

View File

@ -104,12 +104,35 @@ namespace Feather
template <>
void DedicatedServer::HandlePacket(MinecraftClient& client, const Login::ServerboundStart& start)
{
Login::ClientboundSuccess message =
//Login::ClientboundSuccess success =
//{
// .uuid = { 4658857991808325907ull, 7518717155607718277ull },
// .username = start.username
//};
std::string uuid = "ecb99913-96a8-40a7-8529-a2ca6ad95768";
Login::ClientboundSuccess success =
{
.uuid = { 4658857991808325907ull, 7518717155607718277ull },
.uuid = uuid,
.username = start.username
};
client.SendMessage(message);
client.SendMessage(success);
client.GetContext().SetState(ProtocolState::Play);
std::string type = "default";
Play::ClientboundJoinGame join =
{
.entityId = 0,
.gamemode = 0,
.dimension = 0,
.seedHash = 0,
.maxPlayers = uint8_t(m_properties->maxPlayers.GetValue()),
.levelType = type,
.viewDistance = m_properties->viewDistance,
.reducedDebugInfo = false,
.enableRespawnScreen = true
};
client.SendMessage(join);
}
}

View File

@ -15,8 +15,8 @@ namespace Feather
public:
// Version
string versionName = "1.16.1";
int protocol = 736;
string versionName = "1.15.2";//"1.16.1";
int protocol = 578;//736;
// Players
int maxPlayers;

View File

@ -53,7 +53,7 @@ def get_type_size(type):
return 4
elif type == 'int16' or type == 'uint16':
return 2
elif type == 'int8' or type == 'uint8':
elif type == 'int8' or type == 'uint8' or type == 'bool':
return 1
elif type == 'string':
return count

View File

@ -20,6 +20,7 @@
int16 : int16_t
uint8 : uint8_t
int8 : int8_t
bool : uint8_t
}
}
@ -53,26 +54,6 @@
status :
{
serverbound :
{
Request :
{
id : 0
vars :
{
}
}
Ping :
{
id : 1
vars :
{
timestamp : uint64
}
}
}
clientbound :
{
Response :
@ -93,6 +74,26 @@
}
}
}
serverbound :
{
Request :
{
id : 0
vars :
{
}
}
Ping :
{
id : 1
vars :
{
timestamp : uint64
}
}
}
}
login :
@ -104,7 +105,7 @@
id : 0
vars :
{
username : string[32767]
reason : string[32767]
}
}
@ -113,7 +114,7 @@
id : 2
vars :
{
uuid : uuid
uuid : string[32]
username : string[16]
}
}
@ -131,5 +132,28 @@
}
}
}
play :
{
clientbound :
{
JoinGame :
{
id : 38
vars :
{
entityId : int32
gamemode : uint8
dimension : int32
seedHash : uint64
maxPlayers : uint8
levelType : string[16]
viewDistance : varint
reducedDebugInfo : bool
enableRespawnScreen : bool
}
}
}
}
}
}

View File

@ -0,0 +1,140 @@
{
types :
{
aliases :
{
ProtocolState : varint
}
primitives :
{
varint : int32_t
string : std::string
uuid : MinecraftUUID
uint64 : uint64_t
int64 : int64_t
uint32 : uint32_t
int32 : int32_t
uint16 : uint16_t
int16 : int16_t
uint8 : uint8_t
int8 : int8_t
bool : uint8_t
}
}
states :
{
Handholding : -1
Play : 0
Status : 1
Login : 2
}
messages :
{
handholding :
{
serverbound :
{
Handshake :
{
id : 0
vars :
{
protocolVersion : varint
serverIP : string[255]
port : uint16
intention : ProtocolState
}
}
}
}
status :
{
clientbound :
{
Response :
{
id : 0
vars :
{
jsonResponse : string[32767]
}
}
Pong :
{
id : 1
vars :
{
timestamp : uint64
}
}
}
serverbound :
{
Request :
{
id : 0
vars :
{
}
}
Ping :
{
id : 1
vars :
{
timestamp : uint64
}
}
}
}
login :
{
clientbound :
{
Disconnect :
{
id : 0
vars :
{
reason : string[32767]
}
}
Success :
{
id : 2
vars :
{
uuid : uuid
username : string[16]
}
}
}
serverbound :
{
Start :
{
id : 0
vars :
{
username : string[16]
}
}
}
}
play :
{
}
}
}