2017-06-20 04:24:15 +00:00
|
|
|
#include "Settings.hpp"
|
2017-08-18 04:13:08 +00:00
|
|
|
|
2017-06-20 04:24:15 +00:00
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include <components/openmw-mp/Log.hpp>
|
|
|
|
|
2017-08-18 04:13:08 +00:00
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
|
|
|
2017-06-20 04:24:15 +00:00
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void SettingFunctions::SetConsoleAllow(unsigned short pid, bool state)
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->consoleAllowed = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SettingFunctions::SetDifficulty(unsigned short pid, int difficulty)
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->difficulty = difficulty;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SettingFunctions::SendSettings(unsigned short pid) noexcept
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_SETTINGS)->setPlayer(player);
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_SETTINGS)->Send(false);
|
|
|
|
}
|