Merge pull request #266 from TES3MP/0.6.0

Add hotfix commits for 0.6.0 up to 18 Aug 2017
This commit is contained in:
David Cernat 2017-08-18 07:45:36 +03:00 committed by GitHub
commit cffd985038
15 changed files with 92 additions and 33 deletions

View file

@ -1,6 +1,8 @@
#include "Books.hpp" #include "Books.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -1,9 +1,11 @@
#include "Cells.hpp" #include "Cells.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Player.hpp> #include <apps/openmw-mp/Player.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/Log.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;

View file

@ -3,9 +3,11 @@
// //
#include "CharClass.hpp" #include "CharClass.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp> #include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace std; using namespace std;
using namespace ESM; using namespace ESM;

View file

@ -1,6 +1,8 @@
#include "Dialogue.hpp" #include "Dialogue.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -1,8 +1,10 @@
#include "Factions.hpp" #include "Factions.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -3,9 +3,11 @@
// //
#include "GUI.hpp" #include "GUI.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp> #include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
void GUIFunctions::_MessageBox(unsigned short pid, int id, const char *label) noexcept void GUIFunctions::_MessageBox(unsigned short pid, int id, const char *label) noexcept
{ {

View file

@ -3,11 +3,13 @@
// //
#include "Items.hpp" #include "Items.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw/mwworld/inventorystore.hpp> #include <apps/openmw/mwworld/inventorystore.hpp>
#include <components/misc/stringops.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -1,9 +1,11 @@
#include "Mechanics.hpp" #include "Mechanics.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/Log.hpp> #include <components/openmw-mp/Log.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;

View file

@ -1,11 +1,33 @@
#include "Miscellaneous.hpp" #include "Miscellaneous.hpp"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/Log.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp> #include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/Log.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;
static std::string tempFilename;
const char *MiscellaneousFunctions::GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept
{
if (!boost::filesystem::exists(folderPath)) return "invalid";
boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
for (boost::filesystem::directory_iterator itr(folderPath); itr != end_itr; ++itr)
{
if (Misc::StringUtils::ciEqual(itr->path().filename().string(), filename))
{
tempFilename = itr->path().filename().string();
return tempFilename.c_str();
}
}
return "invalid";
}
unsigned int MiscellaneousFunctions::GetLastPlayerId() noexcept unsigned int MiscellaneousFunctions::GetLastPlayerId() noexcept
{ {
return Players::getLastPlayerId(); return Players::getLastPlayerId();

View file

@ -4,6 +4,8 @@
#include "../Types.hpp" #include "../Types.hpp"
#define MISCELLANEOUSAPI \ #define MISCELLANEOUSAPI \
{"GetCaseInsensitiveFilename", MiscellaneousFunctions::GetCaseInsensitiveFilename},\
\
{"GetLastPlayerId", MiscellaneousFunctions::GetLastPlayerId},\ {"GetLastPlayerId", MiscellaneousFunctions::GetLastPlayerId},\
\ \
{"GetCurrentMpNum", MiscellaneousFunctions::GetCurrentMpNum},\ {"GetCurrentMpNum", MiscellaneousFunctions::GetCurrentMpNum},\
@ -15,6 +17,17 @@
class MiscellaneousFunctions class MiscellaneousFunctions
{ {
public: public:
/**
* \brief Get the first filename in a folder that has a case insensitive match with the filename
* argument.
*
* This is used to retain case insensitivity when opening data files on Linux.
*
* \return The filename that matches.
*/
static const char *GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept;
/** /**
* \brief Get the last player ID currently connected to the server. * \brief Get the last player ID currently connected to the server.
* *

View file

@ -1,8 +1,10 @@
#include "Quests.hpp" #include "Quests.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -1,9 +1,11 @@
#include "Settings.hpp" #include "Settings.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/Log.hpp> #include <components/openmw-mp/Log.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;

View file

@ -1,8 +1,10 @@
#include "Spells.hpp" #include "Spells.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
using namespace mwmp; using namespace mwmp;

View file

@ -3,14 +3,16 @@
// //
#include "Stats.hpp" #include "Stats.hpp"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp> #include <iostream>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/esm/attr.hpp> #include <components/esm/attr.hpp>
#include <components/esm/loadskil.hpp> #include <components/esm/loadskil.hpp>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/openmw-mp/Log.hpp> #include <components/openmw-mp/Log.hpp>
#include <iostream> #include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
using namespace std; using namespace std;
using namespace ESM; using namespace ESM;

View file

@ -592,7 +592,7 @@ namespace MWScript
*/ */
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{ {
if (!ref.getRefData().isEnabled()) if (!ref.getRefData().isEnabled() && ref.getCell() != nullptr)
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset(); worldEvent->reset();
@ -620,7 +620,7 @@ namespace MWScript
*/ */
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{ {
if (ref.getRefData().isEnabled()) if (ref.getRefData().isEnabled() && ref.getCell() != nullptr)
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset(); worldEvent->reset();