You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3coop/apps/openmw-mp/Script/Functions/Chat.hpp

45 lines
1.3 KiB
C++

#ifndef OPENMW_CHATAPI_HPP
#define OPENMW_CHATAPI_HPP
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define CHATAPI \
{"SendMessage", ChatFunctions::SendMessage},\
{"CleanChatForPid", ChatFunctions::CleanChat},\
{"CleanChat", ChatFunctions::CleanChatForPid}
namespace ChatFunctions
{
/**
* \brief Send a message to a certain player.
*
* \param pid The player ID.
* \param message The contents of the message.
* \param sendToOtherPlayers Whether this packet should be sent to players other than the
* player attached to the packet (false by default).
* \param skipAttachedPlayer Whether the packet should skip being sent to the player attached
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Remove all messages from chat for a certain player.
*
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL CleanChatForPid(unsigned short pid);
/**
* \brief Remove all messages from chat for everyone on the server.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL CleanChat();
}
#endif //OPENMW_CHATAPI_HPP