MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CreateMPMissionBank

Function CreateMPMissionBank

engine/Poseidon/Network/Network.cpp:327–350  ·  view source on GitHub ↗

Create file bank for multiplayer mission

Source from the content-addressed store, hash-verified

325
326// Create file bank for multiplayer mission
327RString CreateMPMissionBank(RString filename, RString island)
328{
329 // remove bank
330 const std::string prefix = GameDirs::MPCurrentPrefix();
331 RemoveBank(prefix.c_str());
332
333 // prefer mod directory PBO over base game
334 FindMissionPboContext ctx;
335 ctx.relPath = filename;
336 RString openPath = filename;
337 if (EnumModDirectories(FindMissionPboCallback, &ctx))
338 {
339 openPath = ctx.result;
340 }
341
342 // create bank
343 int index = GFileBanks.Add();
344 QFBank& bank = GFileBanks[index];
345 bank.open(openPath);
346 RString str = RString(prefix.c_str()) + island + RString("/");
347 str.Lower();
348 bank.SetPrefix(str);
349 return str;
350}
351
352NetworkMessageType NetworkSimpleObject::GetNMType(NetworkMessageClass cls) const
353{

Callers 3

CheckMissionFileFunction · 0.85
OnMessageMethod · 0.85
CreateMissionMethod · 0.85

Calls 8

MPCurrentPrefixFunction · 0.85
RemoveBankFunction · 0.85
EnumModDirectoriesFunction · 0.85
LowerMethod · 0.80
SetPrefixMethod · 0.80
RStringClass · 0.50
AddMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected