mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/DBLayer: Add GetCString method for PreparedResultSet (dynamic copy is responsibility of the high level code)
--HG-- branch : trunk
This commit is contained in:
@@ -389,7 +389,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
{
|
||||
sLog.outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), res2->GetString(3));
|
||||
sLog.outStaticDebug("[AuthChallenge] Player address is '%s'", ip_address.c_str());
|
||||
if (strcmp(res2->GetString(3).c_str(), ip_address.c_str()))
|
||||
if (strcmp(res2->GetCString(3), ip_address.c_str()))
|
||||
{
|
||||
sLog.outStaticDebug("[AuthChallenge] Account IP differs");
|
||||
pkt << (uint8) WOW_FAIL_SUSPENDED;
|
||||
@@ -753,7 +753,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
return false;
|
||||
}
|
||||
|
||||
K.SetHexStr (result->GetString(0).c_str());
|
||||
K.SetHexStr (result->GetCString(0));
|
||||
|
||||
///- Sending response
|
||||
ByteBuffer pkt;
|
||||
|
||||
@@ -260,6 +260,14 @@ std::string PreparedResultSet::GetString(uint32 index)
|
||||
return std::string(static_cast<char const*>(rbind->m_rBind[index].buffer), *rbind->m_rBind[index].length);
|
||||
}
|
||||
|
||||
const char* PreparedResultSet::GetCString(uint32 index)
|
||||
{
|
||||
if (!CheckFieldIndex(index))
|
||||
return '\0';
|
||||
|
||||
return static_cast<char const*>(rbind->m_rBind[index].buffer);
|
||||
}
|
||||
|
||||
bool PreparedResultSet::NextRow()
|
||||
{
|
||||
if (row_position >= num_rows)
|
||||
|
||||
@@ -211,6 +211,7 @@ class PreparedResultSet
|
||||
int64 GetInt64(uint32 index);
|
||||
float GetFloat(uint32 index);
|
||||
std::string GetString(uint32 index);
|
||||
const char* GetCString(uint32 index);
|
||||
|
||||
bool NextRow();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user