migrate ALMOST everything from source tree into client

This commit is contained in:
riall
2023-08-05 05:00:55 -04:00
committed by GitHub
parent 458a857569
commit ebe5f127e6
189 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#include "Packet.hpp"
AddPlayerPacket::AddPlayerPacket(const RakNet::RakNetGUID& guid, RakNet::RakString name, int id, float x, float y, float z)
{
m_guid = guid;
m_name = name;
m_id = id;
m_x = x;
m_y = y;
m_z = z;
}
void AddPlayerPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback)
{
pCallback->handle(guid, this);
}
void AddPlayerPacket::write(RakNet::BitStream* bs)
{
bs->Write(PACKET_ADD_PLAYER);
bs->Write(m_guid);
bs->Write(m_name);
bs->Write(m_id);
bs->Write(m_x);
bs->Write(m_y);
bs->Write(m_z);
}
void AddPlayerPacket::read(RakNet::BitStream* bs)
{
bs->Read(m_guid);
bs->Read(m_name);
bs->Read(m_id);
bs->Read(m_x);
bs->Read(m_y);
bs->Read(m_z);
}