1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

[Client] Print all esm/esp files in load queue with idx & CRC32 checksum

This commit is contained in:
Koncord 2017-03-04 13:23:26 +08:00
parent 9199446edd
commit a10cf4360c
3 changed files with 23 additions and 3 deletions

View file

@ -149,7 +149,7 @@ bool Main::init(std::vector<std::string> &content, Files::Collections &collectio
}
get().mLocalPlayer->passw = passw;
pMain->mNetworking->connect(pMain->server, pMain->port);
pMain->mNetworking->connect(pMain->server, pMain->port, content, collections);
RestoreMgr(mgr);
return pMain->mNetworking->isConnected();
}

View file

@ -23,6 +23,8 @@
#include "../mwstate/statemanagerimp.hpp"
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/Version.hpp>
#include <components/files/configurationmanager.hpp>
#include <components/openmw-mp/Utils.hpp>
#include "DedicatedPlayer.hpp"
#include "LocalPlayer.hpp"
#include "GUIController.hpp"
@ -101,7 +103,7 @@ void Networking::update()
}
}
void Networking::connect(const std::string &ip, unsigned short port)
void Networking::connect(const std::string &ip, unsigned short port, std::vector<string> &content, Files::Collections &collections)
{
RakNet::SystemAddress master;
master.SetBinaryAddress(ip.c_str());
@ -160,6 +162,23 @@ void Networking::connect(const std::string &ip, unsigned short port)
}
}
vector<string>::const_iterator it(content.begin());
for (int idx = 0; it != content.end(); ++it, ++idx)
{
boost::filesystem::path filename(*it);
const Files::MultiDirCollection& col = collections.getCollection(filename.extension().string());
if (col.doesExist(*it))
{
unsigned int crc32 = Utils::crc32checksum(col.getPath(*it).string());
printf("idx: %d\tchecksum: %x\tfile:%s\n", idx, crc32, col.getPath(*it).c_str());
}
else
{
throw std::runtime_error("Plugin doesn't exists.");
}
}
if (!errmsg.empty())
{
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, errmsg.c_str());

View file

@ -13,6 +13,7 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
#include <components/openmw-mp/Controllers/WorldPacketController.hpp>
#include <components/files/collections.hpp>
namespace mwmp
{
@ -23,7 +24,7 @@ namespace mwmp
public:
Networking();
~Networking();
void connect(const std::string& ip, unsigned short port);
void connect(const std::string& ip, unsigned short port, std::vector<std::string> &content, Files::Collections &collections);
void update();
PlayerPacket *getPlayerPacket(RakNet::MessageID id);