mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-01 15:32:25 +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);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Database::CheckStatus(uint32 account_id) {
|
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);
|
std::string query = StringFormat(
|
||||||
|
"SELECT `status`, TIMESTAMPDIFF(SECOND, NOW(), `suspendeduntil`) FROM `account` WHERE `id` = %i",
|
||||||
|
account_id);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success())
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (results.RowCount() != 1)
|
if (results.RowCount() != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
int16 status = atoi(row[0]);
|
int16 status = atoi(row[0]);
|
||||||
int32 suspendeduntil = 0;
|
int32 date_diff = 0;
|
||||||
|
|
||||||
// MariaDB initalizes with NULL if unix_timestamp() is out of range
|
if (row[1] != nullptr)
|
||||||
if (row[1] != nullptr) {
|
date_diff = atoi(row[1]);
|
||||||
suspendeduntil = atoi(row[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 current = atoi(row[2]);
|
if (date_diff > 0)
|
||||||
|
|
||||||
if(suspendeduntil > current)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@ -100,6 +100,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|||||||
#include "bot.h"
|
#include "bot.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "mob_movement_manager.h"
|
||||||
|
|
||||||
|
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
@ -4818,7 +4819,22 @@ void Mob::Spin() {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
else {
|
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