mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-01 12:51:28 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server
This commit is contained in:
commit
6da0f84e18
@ -171,30 +171,27 @@ void Database::LoginIP(uint32 AccountID, const char* LoginIP) {
|
||||
QueryDatabase(query);
|
||||
}
|
||||
|
||||
int16 Database::CheckStatus(uint32 account_id) {
|
||||
std::string query = StringFormat("SELECT `status`, UNIX_TIMESTAMP(`suspendeduntil`) as `suspendeduntil`, UNIX_TIMESTAMP() as `current`"
|
||||
" FROM `account` WHERE `id` = %i", account_id);
|
||||
int16 Database::CheckStatus(uint32 account_id)
|
||||
{
|
||||
std::string query = StringFormat(
|
||||
"SELECT `status`, TIMESTAMPDIFF(SECOND, NOW(), `suspendeduntil`) FROM `account` WHERE `id` = %i",
|
||||
account_id);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() != 1)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
int16 status = atoi(row[0]);
|
||||
int32 suspendeduntil = 0;
|
||||
|
||||
// MariaDB initalizes with NULL if unix_timestamp() is out of range
|
||||
if (row[1] != nullptr) {
|
||||
suspendeduntil = atoi(row[1]);
|
||||
}
|
||||
auto row = results.begin();
|
||||
int16 status = atoi(row[0]);
|
||||
int32 date_diff = 0;
|
||||
|
||||
int32 current = atoi(row[2]);
|
||||
if (row[1] != nullptr)
|
||||
date_diff = atoi(row[1]);
|
||||
|
||||
if(suspendeduntil > current)
|
||||
if (date_diff > 0)
|
||||
return -1;
|
||||
|
||||
return status;
|
||||
|
||||
@ -100,6 +100,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
#include "bot.h"
|
||||
#endif
|
||||
|
||||
#include "mob_movement_manager.h"
|
||||
|
||||
|
||||
extern Zone* zone;
|
||||
@ -4818,7 +4819,22 @@ void Mob::Spin() {
|
||||
safe_delete(outapp);
|
||||
}
|
||||
else {
|
||||
GMMove(GetX(), GetY(), GetZ(), GetHeading()+5);
|
||||
float x,y,z,h;
|
||||
|
||||
x=GetX();
|
||||
y=GetY();
|
||||
z=GetZ();
|
||||
h=GetHeading()+5;
|
||||
|
||||
if (IsCorpse() || (IsClient() && !IsAIControlled())) {
|
||||
m_Position.x = x;
|
||||
m_Position.y = y;
|
||||
m_Position.z = z;
|
||||
mMovementManager->SendCommandToClients(this, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeAny);
|
||||
}
|
||||
else {
|
||||
Teleport(glm::vec4(x, y, z, h));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user