mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
This commit is contained in:
parent
b66a5d2f88
commit
155288ee98
13 changed files with 63 additions and 99 deletions
16
src/server.h
16
src/server.h
|
@ -157,7 +157,7 @@ struct ServerSoundParams
|
|||
struct ServerPlayingSound
|
||||
{
|
||||
ServerSoundParams params;
|
||||
std::set<u16> clients; // peer ids
|
||||
UNORDERED_SET<u16> clients; // peer ids
|
||||
};
|
||||
|
||||
class Server : public con::PeerHandler, public MapEventReceiver,
|
||||
|
@ -243,11 +243,9 @@ public:
|
|||
std::wstring getStatusString();
|
||||
|
||||
// read shutdown state
|
||||
inline bool getShutdownRequested()
|
||||
{ return m_shutdown_requested; }
|
||||
inline bool getShutdownRequested() const { return m_shutdown_requested; }
|
||||
|
||||
// request server to shutdown
|
||||
inline void requestShutdown() { m_shutdown_requested = true; }
|
||||
void requestShutdown(const std::string &msg, bool reconnect)
|
||||
{
|
||||
m_shutdown_requested = true;
|
||||
|
@ -323,8 +321,7 @@ public:
|
|||
const ModSpec* getModSpec(const std::string &modname) const;
|
||||
void getModNames(std::vector<std::string> &modlist);
|
||||
std::string getBuiltinLuaPath();
|
||||
inline std::string getWorldPath() const
|
||||
{ return m_path_world; }
|
||||
inline std::string getWorldPath() const { return m_path_world; }
|
||||
|
||||
inline bool isSingleplayer()
|
||||
{ return m_simple_singleplayer_mode; }
|
||||
|
@ -356,8 +353,7 @@ public:
|
|||
bool setSky(Player *player, const video::SColor &bgcolor,
|
||||
const std::string &type, const std::vector<std::string> ¶ms);
|
||||
|
||||
bool overrideDayNightRatio(Player *player, bool do_override,
|
||||
float brightness);
|
||||
bool overrideDayNightRatio(Player *player, bool do_override, float brightness);
|
||||
|
||||
/* con::PeerHandler implementation. */
|
||||
void peerAdded(con::Peer *peer);
|
||||
|
@ -654,12 +650,12 @@ private:
|
|||
u16 m_ignore_map_edit_events_peer_id;
|
||||
|
||||
// media files known to server
|
||||
std::map<std::string,MediaInfo> m_media;
|
||||
UNORDERED_MAP<std::string, MediaInfo> m_media;
|
||||
|
||||
/*
|
||||
Sounds
|
||||
*/
|
||||
std::map<s32, ServerPlayingSound> m_playing_sounds;
|
||||
UNORDERED_MAP<s32, ServerPlayingSound> m_playing_sounds;
|
||||
s32 m_next_sound_id;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue