1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improved server commands and added player permissions.

--HG--
extra : rebase_source : 178fe08f10b7de3ebaba088bd24faad795114216
This commit is contained in:
Ciaran Gultnieks 2011-05-16 10:41:19 +01:00
parent dadac0e79f
commit 248d7c8469
8 changed files with 454 additions and 70 deletions

View file

@ -387,6 +387,12 @@ public:
return time_to_daynight_ratio(m_time_of_day.get());
}
void setTimeOfDay(u32 time)
{
m_time_of_day.set(time);
m_time_of_day_send_timer = 0;
}
bool getShutdownRequested()
{
return m_shutdown_requested.get();
@ -405,6 +411,19 @@ public:
Inventory* getInventory(InventoryContext *c, std::string id);
void inventoryModified(InventoryContext *c, std::string id);
// Connection must be locked when called
std::wstring getStatusString();
void requestShutdown(void)
{
m_shutdown_requested.set(true);
}
// Envlock and conlock should be locked when calling this
void SendMovePlayer(Player *player);
private:
// Virtual methods from con::PeerHandler.
@ -429,7 +448,6 @@ private:
void SendChatMessage(u16 peer_id, const std::wstring &message);
void BroadcastChatMessage(const std::wstring &message);
void SendPlayerHP(Player *player);
void SendMovePlayer(Player *player);
/*
Send a node removal/addition event to all clients except ignore_id.
Additionally, if far_players!=NULL, players further away than
@ -455,9 +473,6 @@ private:
// When called, connection mutex should be locked
RemoteClient* getClient(u16 peer_id);
// Connection must be locked when called
std::wstring getStatusString();
/*
Get a player from memory or creates one.
If player is already connected, return NULL