diff --git a/Minecraft.World/GameEventPacket.cpp b/Minecraft.World/GameEventPacket.cpp index 6ed5324d6..56dc6c3a1 100644 --- a/Minecraft.World/GameEventPacket.cpp +++ b/Minecraft.World/GameEventPacket.cpp @@ -3,7 +3,7 @@ #include "InputOutputStream.h" #include "PacketListener.h" #include "GameEventPacket.h" - +#include "../Minecraft.Client/PS3Media/strings.h" const int GameEventPacket::NO_RESPAWN_BED_AVAILABLE = 0; diff --git a/Minecraft.World/InteractPacket.cpp b/Minecraft.World/InteractPacket.cpp index fadeee300..fe2236c1f 100644 --- a/Minecraft.World/InteractPacket.cpp +++ b/Minecraft.World/InteractPacket.cpp @@ -27,14 +27,14 @@ void InteractPacket::read(DataInputStream *dis) //throws IOException { source = dis->readInt(); target = dis->readInt(); - action = dis->readByte(); + action = (int)dis->readByte(); } void InteractPacket::write(DataOutputStream *dos) // throws IOException { dos->writeInt(source); dos->writeInt(target); - dos->writeByte(action); + dos->writeByte((std::byte)action); } void InteractPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/KickPlayerPacket.cpp b/Minecraft.World/KickPlayerPacket.cpp index cfef71e0b..dc6576a05 100644 --- a/Minecraft.World/KickPlayerPacket.cpp +++ b/Minecraft.World/KickPlayerPacket.cpp @@ -23,12 +23,12 @@ void KickPlayerPacket::handle(PacketListener *listener) void KickPlayerPacket::read(DataInputStream *dis) //throws IOException { - m_networkSmallId = dis->readByte(); + m_networkSmallId = (int)dis->readByte(); } void KickPlayerPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte(m_networkSmallId); + dos->writeByte((std::byte)m_networkSmallId); } int KickPlayerPacket::getEstimatedSize() diff --git a/Minecraft.World/LevelEventPacket.cpp b/Minecraft.World/LevelEventPacket.cpp index a044aded8..53644f3a0 100644 --- a/Minecraft.World/LevelEventPacket.cpp +++ b/Minecraft.World/LevelEventPacket.cpp @@ -28,7 +28,7 @@ void LevelEventPacket::read(DataInputStream *dis) //throws IOException { type = dis->readInt(); x = dis->readInt(); - y = dis->readByte() & 0xff; + y = (int)(dis->readByte() & (std::byte)0xff); z = dis->readInt(); data = dis->readInt(); } @@ -37,7 +37,7 @@ void LevelEventPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(type); dos->writeInt(x); - dos->writeByte(y & 0xff); + dos->writeByte((std::byte)(y & 0xff)); dos->writeInt(z); dos->writeInt(data); } diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index bfe692264..935c5e8b7 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -5,7 +5,7 @@ #include "PacketListener.h" #include "LoginPacket.h" #include "LevelType.h" - +#include "../Minecraft.Client/Windows64/Windows64_App.h" LoginPacket::LoginPacket() @@ -106,16 +106,16 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException } seed = dis->readLong(); gameType = dis->readInt(); - dimension = dis->readByte(); - mapHeight = dis->readByte(); - maxPlayers = dis->readByte(); + dimension = (int)dis->readByte(); + mapHeight = (int)dis->readByte(); + maxPlayers = (int)dis->readByte(); m_offlineXuid = dis->readPlayerUID(); m_onlineXuid = dis->readPlayerUID(); m_friendsOnlyUGC = dis->readBoolean(); m_ugcPlayersVersion = dis->readInt(); - difficulty = dis->readByte(); + difficulty = (int)dis->readByte(); m_multiplayerInstanceId = dis->readInt(); - m_playerIndex = dis->readByte(); + m_playerIndex = (int)dis->readByte(); INT skinId = dis->readInt(); m_playerSkinId = *(DWORD *)&skinId; INT capeId = dis->readInt(); @@ -145,16 +145,16 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException } dos->writeLong(seed); dos->writeInt(gameType); - dos->writeByte(dimension); - dos->writeByte(mapHeight); - dos->writeByte(maxPlayers); + dos->writeByte((std::byte)dimension); + dos->writeByte((std::byte)mapHeight); + dos->writeByte((std::byte)maxPlayers); dos->writePlayerUID(m_offlineXuid); dos->writePlayerUID(m_onlineXuid); dos->writeBoolean(m_friendsOnlyUGC); dos->writeInt(m_ugcPlayersVersion); - dos->writeByte(difficulty); + dos->writeByte((std::byte)difficulty); dos->writeInt(m_multiplayerInstanceId); - dos->writeByte(m_playerIndex); + dos->writeByte((std::byte)m_playerIndex); dos->writeInt(m_playerSkinId); dos->writeInt(m_playerCapeId); dos->writeBoolean(m_isGuest); diff --git a/Minecraft.World/MoveEntityPacket.cpp b/Minecraft.World/MoveEntityPacket.cpp index b52482f5e..f2c648ed2 100644 --- a/Minecraft.World/MoveEntityPacket.cpp +++ b/Minecraft.World/MoveEntityPacket.cpp @@ -82,21 +82,21 @@ MoveEntityPacket::PosRot::PosRot(int id, char xa, char ya, char za, char yRot, c void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - xa = dis->readByte(); - ya = dis->readByte(); - za = dis->readByte(); - yRot = dis->readByte(); - xRot = dis->readByte(); + xa = (int)dis->readByte(); + ya = (int)dis->readByte(); + za = (int)dis->readByte(); + yRot = (int)dis->readByte(); + xRot = (int)dis->readByte(); } void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte(xa); - dos->writeByte(ya); - dos->writeByte(za); - dos->writeByte(yRot); - dos->writeByte(xRot); + dos->writeByte((std::byte)xa); + dos->writeByte((std::byte)ya); + dos->writeByte((std::byte)za); + dos->writeByte((std::byte)yRot); + dos->writeByte((std::byte)xRot); } int MoveEntityPacket::PosRot::getEstimatedSize() @@ -118,17 +118,17 @@ MoveEntityPacket::Pos::Pos(int id, char xa, char ya, char za) : MoveEntityPacket void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - xa = dis->readByte(); - ya = dis->readByte(); - za = dis->readByte(); + xa = (int)dis->readByte(); + ya = (int)dis->readByte(); + za = (int)dis->readByte(); } void MoveEntityPacket::Pos::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte(xa); - dos->writeByte(ya); - dos->writeByte(za); + dos->writeByte((std::byte)xa); + dos->writeByte((std::byte)ya); + dos->writeByte((std::byte)za); } int MoveEntityPacket::Pos::getEstimatedSize() @@ -151,15 +151,15 @@ MoveEntityPacket::Rot::Rot(int id, char yRot, char xRot) : MoveEntityPacket(id) void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - yRot = dis->readByte(); - xRot = dis->readByte(); + yRot = (int)dis->readByte(); + xRot = (int)dis->readByte(); } void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte(yRot); - dos->writeByte(xRot); + dos->writeByte((std::byte)yRot); + dos->writeByte((std::byte)xRot); } int MoveEntityPacket::Rot::getEstimatedSize() diff --git a/Minecraft.World/MoveEntityPacketSmall.cpp b/Minecraft.World/MoveEntityPacketSmall.cpp index 8216478fa..c45997110 100644 --- a/Minecraft.World/MoveEntityPacketSmall.cpp +++ b/Minecraft.World/MoveEntityPacketSmall.cpp @@ -146,7 +146,7 @@ void MoveEntityPacketSmall::Pos::write(DataOutputStream *dos) //throws IOExcepti short idAndY = id | ya << 11; dos->writeShort(idAndY); char XandZ = ( xa << 4 ) | ( za & 0x0f ); - dos->writeByte(XandZ); + dos->writeByte((std::byte)XandZ); } int MoveEntityPacketSmall::Pos::getEstimatedSize()