diff --git a/ElunaQueryMethods.h b/ElunaQueryMethods.h index 47c05d4..17da0ee 100644 --- a/ElunaQueryMethods.h +++ b/ElunaQueryMethods.h @@ -88,7 +88,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetBool()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -102,7 +102,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetUInt8()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -116,7 +116,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetUInt16()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -130,7 +130,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetUInt32()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -144,7 +144,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetUInt64()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -158,7 +158,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetInt8()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -172,7 +172,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetInt16()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -186,7 +186,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetInt32()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -200,7 +200,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetInt64()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -214,7 +214,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetFloat()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -228,7 +228,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - Eluna::Push(L, RESULT->Fetch()[col].GetDouble()); + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -242,12 +242,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); - -#ifndef TRINITY - Eluna::Push(L, RESULT->Fetch()[col].GetString()); -#else - Eluna::Push(L, RESULT->Fetch()[col].GetCString()); -#endif + Eluna::Push(L, RESULT->Fetch()[col].Get()); return 1; } @@ -300,7 +295,8 @@ namespace LuaQuery #if defined TRINITY || AZEROTHCORE Eluna::Push(L, RESULT->GetFieldName(i)); - const char* str = row[i].GetCString(); + std::string _str = row[i].Get(); + const char* str = _str.c_str(); if (row[i].IsNull() || !str) Eluna::Push(L); else diff --git a/PlayerMethods.h b/PlayerMethods.h index 0dc800f..4f06379 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -7,6 +7,8 @@ #ifndef PLAYERMETHODS_H #define PLAYERMETHODS_H +#include "GameTime.h" + /*** * Inherits all methods from: [Object], [WorldObject], [Unit] */ @@ -2246,11 +2248,9 @@ namespace LuaPlayer uint32 muteseconds = Eluna::CHECKVAL(L, 2); /*const char* reason = luaL_checkstring(E, 2);*/ // Mangos does not have a reason field in database. - time_t muteTime = time(NULL) + muteseconds; + time_t muteTime = GameTime::GetGameTime().count() + muteseconds; player->GetSession()->m_muteTime = muteTime; - std::ostringstream oss; - oss << "UPDATE account SET mutetime = " << muteTime << " WHERE id = " << player->GetSession()->GetAccountId(); - LoginDatabase.PExecute("%s", oss.str().c_str()); + LoginDatabase.Execute("UPDATE account SET mutetime = {} WHERE id = {}", muteTime, player->GetSession()->GetAccountId()); return 0; }