mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-15 12:53:52 +00:00
Merge branch 'main' into feat/64x64-skins
This commit is contained in:
commit
0c50f9982c
925 changed files with 4906 additions and 3697 deletions
|
|
@ -9,46 +9,46 @@
|
|||
#include "TakeAnimationParticle.h"
|
||||
#include "CritParticle.h"
|
||||
#include "User.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.storage.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.chunk.h"
|
||||
#include "..\Minecraft.World\net.minecraft.stats.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.ai.attributes.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.player.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.npc.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.item.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.global.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.boss.enderdragon.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.monster.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.item.trading.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.saveddata.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.dimension.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.effect.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.food.h"
|
||||
#include "..\Minecraft.World\SharedConstants.h"
|
||||
#include "..\Minecraft.World\AABB.h"
|
||||
#include "..\Minecraft.World\Pos.h"
|
||||
#include "..\Minecraft.World\Socket.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.storage.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.chunk.h"
|
||||
#include "../Minecraft.World/net.minecraft.stats.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.ai.attributes.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.player.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.npc.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.item.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.projectile.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.global.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.boss.enderdragon.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.monster.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.item.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.item.trading.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.inventory.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.saveddata.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.dimension.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.effect.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.food.h"
|
||||
#include "../Minecraft.World/SharedConstants.h"
|
||||
#include "../Minecraft.World/AABB.h"
|
||||
#include "../Minecraft.World/Pos.h"
|
||||
#include "../Minecraft.World/Socket.h"
|
||||
#include "Minecraft.h"
|
||||
#include "ProgressRenderer.h"
|
||||
#include "LevelRenderer.h"
|
||||
#include "Options.h"
|
||||
#include "MinecraftServer.h"
|
||||
#include "ClientConstants.h"
|
||||
#include "..\Minecraft.World\SoundTypes.h"
|
||||
#include "..\Minecraft.World\BasicTypeContainers.h"
|
||||
#include "../Minecraft.World/SoundTypes.h"
|
||||
#include "../Minecraft.World/BasicTypeContainers.h"
|
||||
#include "TexturePackRepository.h"
|
||||
#ifdef _XBOX
|
||||
#include "Common\XUI\XUI_Scene_Trading.h"
|
||||
#include "Common/XUI/XUI_Scene_Trading.h"
|
||||
#else
|
||||
#include "Common\UI\UI.h"
|
||||
#include "Common/UI/UI.h"
|
||||
#endif
|
||||
#ifdef __PS3__
|
||||
#include "PS3/Network/SonyVoiceChat.h"
|
||||
|
|
@ -56,15 +56,16 @@
|
|||
#include "DLCTexturePack.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include "Xbox\Network\NetworkPlayerXbox.h"
|
||||
#include "Common\Network\PlatformNetworkManagerStub.h"
|
||||
#include "Xbox/Network/NetworkPlayerXbox.h"
|
||||
#include "Common/Network/PlatformNetworkManagerStub.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _DURANGO
|
||||
#include "..\Minecraft.World\DurangoStats.h"
|
||||
#include "..\Minecraft.World\GenericStats.h"
|
||||
#include "../Minecraft.World/DurangoStats.h"
|
||||
#include "../Minecraft.World/GenericStats.h"
|
||||
#endif
|
||||
#include <regex>
|
||||
|
||||
ClientConnection::ClientConnection(Minecraft *minecraft, const wstring& ip, int port)
|
||||
{
|
||||
|
|
@ -1546,17 +1547,35 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
|||
bool replaceEntitySource = false;
|
||||
bool replaceItem = false;
|
||||
|
||||
static std::wregex IDS_Pattern(LR"(\{\*IDS_(\d+)\*\})"); //maybe theres a better way to do translateable IDS
|
||||
|
||||
int stringArgsSize = packet->m_stringArgs.size();
|
||||
|
||||
wstring playerDisplayName = L"";
|
||||
wstring sourceDisplayName = L"";
|
||||
|
||||
// On platforms other than Xbox One this just sets display name to gamertag
|
||||
if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
|
||||
if (packet->m_stringArgs.size() >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
|
||||
if (stringArgsSize >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
|
||||
if (stringArgsSize >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
|
||||
|
||||
switch(packet->m_messageType)
|
||||
{
|
||||
case ChatPacket::e_ChatCustom:
|
||||
message = (packet->m_stringArgs.size() >= 1) ? packet->m_stringArgs[0] : L"";
|
||||
case ChatPacket::e_ChatActionBar:
|
||||
if (stringArgsSize >= 1) {
|
||||
message = packet->m_stringArgs[0];
|
||||
|
||||
std::wsmatch match;
|
||||
while (std::regex_search(message, match, IDS_Pattern)) {
|
||||
message = replaceAll(message, match[0], app.GetString(std::stoi(match[1].str())));
|
||||
}
|
||||
|
||||
message = app.EscapeHTMLString(message); //do this to enforce escaped string
|
||||
message = app.FormatChatMessage(message); //this needs to be last cause it converts colors to html colors that would have been escaped
|
||||
} else {
|
||||
message = L"empty message";
|
||||
}
|
||||
displayOnGui = (packet->m_messageType == ChatPacket::e_ChatCustom);
|
||||
break;
|
||||
case ChatPacket::e_ChatBedOccupied:
|
||||
message = app.GetString(IDS_TILE_BED_OCCUPIED);
|
||||
|
|
@ -1906,7 +1925,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
|||
|
||||
if(replacePlayer)
|
||||
{
|
||||
message = replaceAll(message,L"{*PLAYER*}",playerDisplayName);
|
||||
message = replaceAll(message,L"{*PLAYER*}", playerDisplayName);
|
||||
}
|
||||
|
||||
if(replaceEntitySource)
|
||||
|
|
@ -1941,7 +1960,9 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
|||
// flag that a message is a death message
|
||||
bool bIsDeathMessage = (packet->m_messageType>=ChatPacket::e_ChatDeathInFire) && (packet->m_messageType<=ChatPacket::e_ChatDeathIndirectMagicItem);
|
||||
|
||||
if( displayOnGui ) minecraft->gui->addMessage(message,m_userIndex, bIsDeathMessage);
|
||||
if( displayOnGui ) minecraft->gui->addMessage(message, m_userIndex, bIsDeathMessage);
|
||||
|
||||
if (!displayOnGui && !message.empty()) minecraft->gui->setActionBarMessage(message);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAnimate(shared_ptr<AnimatePacket> packet)
|
||||
|
|
@ -4034,7 +4055,8 @@ void ClientConnection::handleSetPlayerTeamPacket(shared_ptr<SetPlayerTeamPacket>
|
|||
|
||||
void ClientConnection::handleParticleEvent(shared_ptr<LevelParticlesPacket> packet)
|
||||
{
|
||||
ePARTICLE_TYPE particleId = (ePARTICLE_TYPE)Integer::parseInt(packet->getName());
|
||||
wstring particleName = packet->getName();
|
||||
ePARTICLE_TYPE particleId = (ePARTICLE_TYPE)Integer::parseInt(particleName);
|
||||
|
||||
for (int i = 0; i < packet->getCount(); i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue