#include "tileanimation.h"
#include "mesh_generator_thread.h"
+#define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
+
struct MeshMakeData;
class MapBlockMesh;
class IWritableTextureSource;
IrrlichtDevice *device,
const char *playername,
const std::string &password,
+ const std::string &address_name,
MapDrawControl &control,
IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc,
The name of the local player should already be set when
calling this, as it is sent in the initialization.
*/
- void connect(Address address,
- const std::string &address_name,
- bool is_local_server);
+ void connect(Address address, bool is_local_server);
/*
Stuff that references the environment is valid only as
const StringMap &fields);
void sendInventoryAction(InventoryAction *a);
void sendChatMessage(const std::wstring &message);
+ void clearOutChatQueue();
void sendChangePassword(const std::string &oldpassword,
const std::string &newpassword);
void sendDamage(u8 damage);
Minimap* getMinimap() { return m_minimap; }
void setCamera(Camera* camera) { m_camera = camera; }
- Camera* getCamera ()
- { return m_camera; }
+ Camera* getCamera () { return m_camera; }
bool shouldShowMinimap() const;
IrrlichtDevice *getDevice() const { return m_device; }
+ const Address getServerAddress()
+ {
+ return m_con.GetPeerAddress(PEER_ID_SERVER);
+ }
+
+ const std::string &getAddressName() const
+ {
+ return m_address_name;
+ }
+
private:
// Virtual methods from con::PeerHandler
inline std::string getPlayerName()
{ return m_env.getLocalPlayer()->getName(); }
+ bool canSendChatMessage() const;
+
float m_packetcounter_timer;
float m_connection_reinit_timer;
float m_avg_rtt_timer;
ClientEnvironment m_env;
ParticleManager m_particle_manager;
con::Connection m_con;
+ std::string m_address_name;
IrrlichtDevice *m_device;
Camera *m_camera;
Minimap *m_minimap;
//s32 m_daynight_i;
//u32 m_daynight_ratio;
std::queue<std::wstring> m_chat_queue;
+ std::queue<std::wstring> m_out_chat_queue;
+ u32 m_last_chat_message_sent;
+ float m_chat_message_allowance;
// The authentication methods we can use to enter sudo mode (=change password)
u32 m_sudo_auth_methods;