mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-07 03:53:19 -04:00
34 lines
906 B
C++
34 lines
906 B
C++
#include "Settings.hpp"
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
#include <components/openmw-mp/Log.hpp>
|
|
|
|
#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);
|
|
}
|