Merge pull request #686 from Howaner/GlobalFixes
Add Locale to ClientHandle
This commit is contained in:
commit
ec37e53465
@ -95,6 +95,7 @@ cClientHandle::cClientHandle(const cSocket * a_Socket, int a_ViewDistance) :
|
|||||||
m_ShouldCheckDownloaded(false),
|
m_ShouldCheckDownloaded(false),
|
||||||
m_NumExplosionsThisTick(0),
|
m_NumExplosionsThisTick(0),
|
||||||
m_UniqueID(0),
|
m_UniqueID(0),
|
||||||
|
m_Locale("en_GB"),
|
||||||
m_HasSentPlayerChunk(false)
|
m_HasSentPlayerChunk(false)
|
||||||
{
|
{
|
||||||
m_Protocol = new cProtocolRecognizer(this);
|
m_Protocol = new cProtocolRecognizer(this);
|
||||||
|
@ -156,6 +156,9 @@ public:
|
|||||||
void SetViewDistance(int a_ViewDistance); // tolua_export
|
void SetViewDistance(int a_ViewDistance); // tolua_export
|
||||||
int GetViewDistance(void) const { return m_ViewDistance; } // tolua_export
|
int GetViewDistance(void) const { return m_ViewDistance; } // tolua_export
|
||||||
|
|
||||||
|
void SetLocale(AString & a_Locale) { m_Locale = a_Locale; } // tolua_export
|
||||||
|
AString GetLocale(void) const { return m_Locale; } // tolua_export
|
||||||
|
|
||||||
int GetUniqueID() const { return m_UniqueID; } // tolua_export
|
int GetUniqueID() const { return m_UniqueID; } // tolua_export
|
||||||
|
|
||||||
/// Returns true if the client wants the chunk specified to be sent (in m_ChunksToSend)
|
/// Returns true if the client wants the chunk specified to be sent (in m_ChunksToSend)
|
||||||
@ -309,6 +312,8 @@ private:
|
|||||||
/// Set to true when the chunk where the player is is sent to the client. Used for spawning the player
|
/// Set to true when the chunk where the player is is sent to the client. Used for spawning the player
|
||||||
bool m_HasSentPlayerChunk;
|
bool m_HasSentPlayerChunk;
|
||||||
|
|
||||||
|
/// Client Settings
|
||||||
|
AString m_Locale;
|
||||||
|
|
||||||
|
|
||||||
/// Returns true if the rate block interactions is within a reasonable limit (bot protection)
|
/// Returns true if the rate block interactions is within a reasonable limit (bot protection)
|
||||||
|
@ -560,7 +560,7 @@ int cProtocol132::ParseLocaleViewDistance(void)
|
|||||||
HANDLE_PACKET_READ(ReadChar, char, ViewDistance);
|
HANDLE_PACKET_READ(ReadChar, char, ViewDistance);
|
||||||
HANDLE_PACKET_READ(ReadChar, char, ChatFlags);
|
HANDLE_PACKET_READ(ReadChar, char, ChatFlags);
|
||||||
HANDLE_PACKET_READ(ReadChar, char, ClientDifficulty);
|
HANDLE_PACKET_READ(ReadChar, char, ClientDifficulty);
|
||||||
// TODO: m_Client->HandleLocale(Locale);
|
m_Client->SetLocale(Locale);
|
||||||
// TODO: m_Client->HandleViewDistance(ViewDistance);
|
// TODO: m_Client->HandleViewDistance(ViewDistance);
|
||||||
// TODO: m_Client->HandleChatFlags(ChatFlags);
|
// TODO: m_Client->HandleChatFlags(ChatFlags);
|
||||||
// Ignoring client difficulty
|
// Ignoring client difficulty
|
||||||
|
@ -85,7 +85,7 @@ int cProtocol142::ParseLocaleViewDistance(void)
|
|||||||
HANDLE_PACKET_READ(ReadChar, char, ChatFlags);
|
HANDLE_PACKET_READ(ReadChar, char, ChatFlags);
|
||||||
HANDLE_PACKET_READ(ReadChar, char, ClientDifficulty);
|
HANDLE_PACKET_READ(ReadChar, char, ClientDifficulty);
|
||||||
HANDLE_PACKET_READ(ReadChar, char, ShouldShowCape); // <-- new in 1.4.2
|
HANDLE_PACKET_READ(ReadChar, char, ShouldShowCape); // <-- new in 1.4.2
|
||||||
// TODO: m_Client->HandleLocale(Locale);
|
m_Client->SetLocale(Locale);
|
||||||
// TODO: m_Client->HandleViewDistance(ViewDistance);
|
// TODO: m_Client->HandleViewDistance(ViewDistance);
|
||||||
// TODO: m_Client->HandleChatFlags(ChatFlags);
|
// TODO: m_Client->HandleChatFlags(ChatFlags);
|
||||||
// Ignoring client difficulty
|
// Ignoring client difficulty
|
||||||
|
@ -1598,6 +1598,8 @@ void cProtocol172::HandlePacketClientSettings(cByteBuffer & a_ByteBuffer)
|
|||||||
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ChatColors);
|
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ChatColors);
|
||||||
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Difficulty);
|
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Difficulty);
|
||||||
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ShowCape);
|
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, ShowCape);
|
||||||
|
|
||||||
|
m_Client->SetLocale(Locale);
|
||||||
// TODO: handle in m_Client
|
// TODO: handle in m_Client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user