491 char* filterStr = strtok((
char*)args,
" ");
495 std::string filter(filterStr);
512 Field* fields = result->Fetch();
514 stmt2->
setUInt64(0, fields[0].GetUInt64());
519 while (result->NextRow());
525 handler->
SendSysMessage(
" =============================================================================== ");
529 handler->
SendSysMessage(
"-------------------------------------------------------------------------------");
531 Field* fields = result->Fetch();
533 std::string char_name = fields[1].
GetString();
536 stmt2->
setUInt64(0, fields[0].GetUInt64());
540 Field* banFields = banInfo->Fetch();
543 time_t timeBan = time_t(banFields[0].GetUInt32());
547 if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
549 handler->
PSendSysMessage(
"|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
550 char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
555 time_t timeUnban = time_t(banFields[1].GetUInt32());
558 handler->
PSendSysMessage(
"|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
559 char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
560 tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
564 while (banInfo->NextRow());
567 while (result->NextRow());
568 handler->
SendSysMessage(
" =============================================================================== ");
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: Language.h:936
Class used to access individual fields of database query result.
Definition: Field.h:56
Definition: Language.h:934
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
Definition: Language.h:935
Definition: PreparedStatement.h:74
char const * GetCString() const
Definition: Field.h:260
Definition: CharacterDatabase.h:46
Definition: CharacterDatabase.h:47
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
TC_COMMON_API struct tm * localtime_r(const time_t *time, struct tm *result)
Definition: CharacterDatabase.h:45
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
WorldSession * GetSession()
Definition: Chat.h:59
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:427
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
std::string GetString() const
Definition: Field.h:276