2016-01-12 03:41:44 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 29.04.16.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::sendMessage(unsigned short pid, const char *message, bool broadcast) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
*player->ChatMessage() = message;
|
|
|
|
|
|
|
|
DEBUG_PRINTF("System: %s", message);
|
|
|
|
|
2016-11-16 00:05:14 +00:00
|
|
|
mwmp::Networking::get().getPlayerController()->GetPacket(ID_CHAT_MESSAGE)->Send(player, false);
|
2016-08-17 15:20:36 +00:00
|
|
|
if (broadcast)
|
2016-11-16 00:05:14 +00:00
|
|
|
mwmp::Networking::get().getPlayerController()->GetPacket(ID_CHAT_MESSAGE)->Send(player, true);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::cleanChat(unsigned short pid)
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::cleanChat()
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|