feat: multiplayer feat/less hardcoded lists (#89)
* CustomPayloadPacket Changes commented all code for old equip packets cleaned up custom payload key creation added 2 new payload packet definitions for upcoming changes * server sided recipe list * code cleanup for recipes * add dtor for recipe classes to fix memory leak * forgot this part to the dtor commit * dtor changes tested and fixed * server side creative menu list
This commit is contained in:
@@ -61,6 +61,8 @@
|
||||
#include "Windows64/Network/WinsockNetLayer.h"
|
||||
#endif
|
||||
|
||||
#include "../Minecraft.World/Recipes.h"
|
||||
|
||||
|
||||
#ifdef _DURANGO
|
||||
#include "../Minecraft.World/DurangoStats.h"
|
||||
@@ -137,6 +139,9 @@ ClientConnection::ClientConnection(Minecraft *minecraft, Socket *socket, int iUs
|
||||
maxPlayers = 20;
|
||||
m_isForkServer = false;
|
||||
|
||||
m_recivedRecipeRegistyUpdate = false;
|
||||
m_recivedCreativeRegistyUpdate = false;
|
||||
|
||||
this->minecraft = minecraft;
|
||||
|
||||
if( iUserIndex < 0 )
|
||||
@@ -246,6 +251,14 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
||||
{
|
||||
if (done) return;
|
||||
|
||||
if (!m_recivedRecipeRegistyUpdate) {
|
||||
Recipes::getInstance()->loadFromLocal();
|
||||
}
|
||||
|
||||
if (!m_recivedCreativeRegistyUpdate) {
|
||||
IUIScene_CreativeMenu::loadFromLocal();
|
||||
}
|
||||
|
||||
PlayerUID OnlineXuid;
|
||||
ProfileManager.GetXUID(m_userIndex,&OnlineXuid,true); // online xuid
|
||||
MOJANG_DATA *pMojangData = nullptr;
|
||||
@@ -4025,6 +4038,16 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (CustomPayloadPacket::UPDATE_RECIPE_REGISTRY.compare(customPayloadPacket->identifier) == 0) {
|
||||
this->m_recivedRecipeRegistyUpdate = true;
|
||||
|
||||
Recipes::getInstance()->loadFromPacket(customPayloadPacket->data);
|
||||
}
|
||||
else if (CustomPayloadPacket::UPDATE_CREATIVE_REGISTRY.compare(customPayloadPacket->identifier) == 0) {
|
||||
this->m_recivedCreativeRegistyUpdate = true;
|
||||
|
||||
IUIScene_CreativeMenu::loadFromPacket(customPayloadPacket->data);
|
||||
}
|
||||
}
|
||||
|
||||
Connection *ClientConnection::getConnection()
|
||||
|
||||
Reference in New Issue
Block a user