forked from teamnwah/openmw-tes3coop
[Server] Add GetCurrentMpNum() and SetCurrentMpNum() script functions
This commit is contained in:
parent
8b8c01f389
commit
2716078a30
2 changed files with 16 additions and 0 deletions
|
@ -11,6 +11,16 @@ unsigned int MiscellaneousFunctions::GetLastPlayerId() noexcept
|
|||
return Players::getLastPlayerId();
|
||||
}
|
||||
|
||||
int MiscellaneousFunctions::GetCurrentMpNum() noexcept
|
||||
{
|
||||
return mwmp::Networking::getPtr()->getCurrentMpNum();
|
||||
}
|
||||
|
||||
void MiscellaneousFunctions::SetCurrentMpNum(int mpNum) noexcept
|
||||
{
|
||||
mwmp::Networking::getPtr()->setCurrentMpNum(mpNum);
|
||||
}
|
||||
|
||||
void MiscellaneousFunctions::LogMessage(unsigned short level, const char *message) noexcept
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(level, "[Script]: %s", message);
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
#define MISCELLANEOUSAPI \
|
||||
{"GetLastPlayerId", MiscellaneousFunctions::GetLastPlayerId},\
|
||||
\
|
||||
{"GetCurrentMpNum", MiscellaneousFunctions::GetCurrentMpNum},\
|
||||
{"SetCurrentMpNum", MiscellaneousFunctions::SetCurrentMpNum},\
|
||||
|
|
||||
{"LogMessage", MiscellaneousFunctions::LogMessage},\
|
||||
{"LogAppend", MiscellaneousFunctions::LogAppend}
|
||||
|
||||
|
@ -14,6 +17,9 @@ class MiscellaneousFunctions
|
|||
public:
|
||||
static unsigned int GetLastPlayerId() noexcept;
|
||||
|
||||
static int GetCurrentMpNum() noexcept;
|
||||
static void SetCurrentMpNum(int mpNum) noexcept;
|
||||
|
||||
static void LogMessage(unsigned short level, const char *message) noexcept;
|
||||
static void LogAppend(unsigned short level, const char *message) noexcept;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue