mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Cleanup & bugfix
* ObjectRef::set_local_animation: fix wrong lua return (should push a boolean, currently returns nil) * ObjectRef::set_eye_offset: fix wrong lua return (should push a boolean, currently returns nil) * Fix various Server functions which depends on RemotePlayer objet and return true/false when player object is nil whereas it's a caller implementation error. Change those bool functions to void and add sanitize_check call instead. Current callers are always checking player object validity * Optimize Server::setClouds : use CloudParams object ref instead of attribute deserialization from structure & perform RemotePlayer::setCloudParams directly in server class like many other calls * Optimize Server::SendCloudParams: use CloudParams object ref instead of deserialized attributes
This commit is contained in:
21
src/server.h
21
src/server.h
@@ -59,6 +59,7 @@ class EmergeManager;
|
||||
class ServerScripting;
|
||||
class ServerEnvironment;
|
||||
struct SimpleSoundSpec;
|
||||
struct CloudParams;
|
||||
class ServerThread;
|
||||
|
||||
enum ClientDeletionReason {
|
||||
@@ -295,19 +296,14 @@ public:
|
||||
|
||||
Address getPeerAddress(session_t peer_id);
|
||||
|
||||
bool setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4],
|
||||
void setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4],
|
||||
f32 frame_speed);
|
||||
bool setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third);
|
||||
void setPlayerEyeOffset(RemotePlayer *player, const v3f &first, const v3f &third);
|
||||
|
||||
bool setSky(RemotePlayer *player, const video::SColor &bgcolor,
|
||||
void setSky(RemotePlayer *player, const video::SColor &bgcolor,
|
||||
const std::string &type, const std::vector<std::string> ¶ms,
|
||||
bool &clouds);
|
||||
bool setClouds(RemotePlayer *player, float density,
|
||||
const video::SColor &color_bright,
|
||||
const video::SColor &color_ambient,
|
||||
float height,
|
||||
float thickness,
|
||||
const v2f &speed);
|
||||
void setClouds(RemotePlayer *player, const CloudParams ¶ms);
|
||||
|
||||
bool overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);
|
||||
|
||||
@@ -389,12 +385,7 @@ private:
|
||||
void SendSetSky(session_t peer_id, const video::SColor &bgcolor,
|
||||
const std::string &type, const std::vector<std::string> ¶ms,
|
||||
bool &clouds);
|
||||
void SendCloudParams(session_t peer_id, float density,
|
||||
const video::SColor &color_bright,
|
||||
const video::SColor &color_ambient,
|
||||
float height,
|
||||
float thickness,
|
||||
const v2f &speed);
|
||||
void SendCloudParams(session_t peer_id, const CloudParams ¶ms);
|
||||
void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio);
|
||||
void broadcastModChannelMessage(const std::string &channel,
|
||||
const std::string &message, session_t from_peer);
|
||||
|
Reference in New Issue
Block a user