mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 15:31:33 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server
This commit is contained in:
commit
40c835c576
@ -97,7 +97,7 @@ uint32 Database::CheckLogin(const char* name, const char* password, const char *
|
|||||||
DoEscapeString(tmpUN, name, strlen(name));
|
DoEscapeString(tmpUN, name, strlen(name));
|
||||||
DoEscapeString(tmpPW, password, strlen(password));
|
DoEscapeString(tmpPW, password, strlen(password));
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT id, status FROM account WHERE name='%s' AND ls_id='%s' AND password is not null "
|
std::string query = StringFormat("SELECT id, status FROM account WHERE `name`='%s' AND ls_id='%s' AND password is not null "
|
||||||
"and length(password) > 0 and (password='%s' or password=MD5('%s'))",
|
"and length(password) > 0 and (password='%s' or password=MD5('%s'))",
|
||||||
tmpUN, EscapeString(loginserver).c_str(), tmpPW, tmpPW);
|
tmpUN, EscapeString(loginserver).c_str(), tmpPW, tmpPW);
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ uint32 Database::CreateAccount(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Database::DeleteAccount(const char* name, const char *loginserver) {
|
bool Database::DeleteAccount(const char* name, const char *loginserver) {
|
||||||
std::string query = StringFormat("DELETE FROM account WHERE name='%s' AND ls_id='%s'", name, loginserver);
|
std::string query = StringFormat("DELETE FROM account WHERE `name`='%s' AND ls_id='%s'", name, loginserver);
|
||||||
LogInfo("Account Attempting to be deleted:'[{}]:[{}]'", loginserver, name);
|
LogInfo("Account Attempting to be deleted:'[{}]:[{}]'", loginserver, name);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@ -1226,7 +1226,7 @@ uint32 Database::GetAccountIDFromLSID(
|
|||||||
{
|
{
|
||||||
uint32 account_id = 0;
|
uint32 account_id = 0;
|
||||||
auto query = fmt::format(
|
auto query = fmt::format(
|
||||||
"SELECT id, name, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
"SELECT id, `name`, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
||||||
in_loginserver_account_id,
|
in_loginserver_account_id,
|
||||||
in_loginserver_id
|
in_loginserver_id
|
||||||
);
|
);
|
||||||
@ -1257,7 +1257,7 @@ uint32 Database::GetAccountIDFromLSID(
|
|||||||
|
|
||||||
void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) {
|
void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) {
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT name, status FROM account WHERE id=%i", id);
|
std::string query = StringFormat("SELECT `name`, status FROM account WHERE id=%i", id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()){
|
if (!results.Success()){
|
||||||
|
|||||||
@ -203,6 +203,10 @@ int EQ::Net::TCPConnection::LocalPort() const
|
|||||||
|
|
||||||
std::string EQ::Net::TCPConnection::RemoteIP() const
|
std::string EQ::Net::TCPConnection::RemoteIP() const
|
||||||
{
|
{
|
||||||
|
if (!m_socket) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
sockaddr_storage addr;
|
sockaddr_storage addr;
|
||||||
int addr_len = sizeof(addr);
|
int addr_len = sizeof(addr);
|
||||||
uv_tcp_getpeername(m_socket, (sockaddr*)&addr, &addr_len);
|
uv_tcp_getpeername(m_socket, (sockaddr*)&addr, &addr_len);
|
||||||
|
|||||||
@ -132,18 +132,36 @@ std::string SharedDatabase::GetMailKey(int CharID, bool key_only)
|
|||||||
{
|
{
|
||||||
std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", CharID);
|
std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
|
|
||||||
Log(Logs::Detail, Logs::MySQLError, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
Log(Logs::Detail, Logs::MySQLError, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
if (!results.RowCount()) {
|
||||||
std::string mail_key = row[0];
|
|
||||||
|
|
||||||
if (mail_key.length() > 8 && key_only)
|
Log(Logs::General, Logs::ClientLogin, "Error: Mailkey for character id [%i] does not exist or could not be found", CharID);
|
||||||
return mail_key.substr(8);
|
return std::string();
|
||||||
else
|
}
|
||||||
return mail_key;
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (row != results.end()) {
|
||||||
|
|
||||||
|
std::string mail_key = row[0];
|
||||||
|
|
||||||
|
if (mail_key.length() > 8 && key_only) {
|
||||||
|
return mail_key.substr(8);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return mail_key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
Log(Logs::General, Logs::MySQLError, "Internal MySQL error in SharedDatabase::GetMailKey(int, bool)");
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end)
|
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end)
|
||||||
|
|||||||
@ -3061,6 +3061,7 @@ void command_texture(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
|
|
||||||
uint16 texture;
|
uint16 texture;
|
||||||
|
|
||||||
if (sep->IsNumber(1) && atoi(sep->arg[1]) >= 0 && atoi(sep->arg[1]) <= 255) {
|
if (sep->IsNumber(1) && atoi(sep->arg[1]) >= 0 && atoi(sep->arg[1]) <= 255) {
|
||||||
texture = atoi(sep->arg[1]);
|
texture = atoi(sep->arg[1]);
|
||||||
uint8 helm = 0xFF;
|
uint8 helm = 0xFF;
|
||||||
@ -3072,9 +3073,9 @@ void command_texture(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
c->SendTextureWC(i, texture);
|
c->SendTextureWC(i, texture);
|
||||||
}
|
}
|
||||||
else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) ||
|
else if ((c->GetTarget()->GetModel() > 0 && c->GetTarget()->GetModel() <= 12) ||
|
||||||
c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 ||
|
c->GetTarget()->GetModel() == 128 || c->GetTarget()->GetModel() == 130 ||
|
||||||
c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) {
|
c->GetTarget()->GetModel() == 330 || c->GetTarget()->GetModel() == 522) {
|
||||||
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
||||||
{
|
{
|
||||||
c->GetTarget()->SendTextureWC(i, texture);
|
c->GetTarget()->SendTextureWC(i, texture);
|
||||||
@ -3093,7 +3094,7 @@ void command_texture(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((c->GetTarget()) && (c->Admin() >= commandTextureOthers))
|
if ((c->GetTarget()) && (c->Admin() >= commandTextureOthers))
|
||||||
c->GetTarget()->SendIllusionPacket(c->GetTarget()->GetRace(), 0xFF, texture, helm);
|
c->GetTarget()->SendIllusionPacket(c->GetTarget()->GetModel(), 0xFF, texture, helm);
|
||||||
else
|
else
|
||||||
c->SendIllusionPacket(c->GetRace(), 0xFF, texture, helm);
|
c->SendIllusionPacket(c->GetRace(), 0xFF, texture, helm);
|
||||||
}
|
}
|
||||||
@ -7430,11 +7431,11 @@ void command_roambox(Client *c, const Seperator *sep)
|
|||||||
delay = {}
|
delay = {}
|
||||||
WHERE id = {}
|
WHERE id = {}
|
||||||
),
|
),
|
||||||
box_size,
|
(box_size / 2),
|
||||||
npc->GetX() - 100,
|
npc->GetX() - (box_size / 2),
|
||||||
npc->GetX() + 100,
|
npc->GetX() + (box_size / 2),
|
||||||
npc->GetY() - 100,
|
npc->GetY() - (box_size / 2),
|
||||||
npc->GetY() + 100,
|
npc->GetY() + (box_size / 2),
|
||||||
delay,
|
delay,
|
||||||
spawn_group_id
|
spawn_group_id
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1736,7 +1736,11 @@ void Mob::SendIllusionPacket(
|
|||||||
uint32 new_drakkin_tattoo;
|
uint32 new_drakkin_tattoo;
|
||||||
uint32 new_drakkin_details;
|
uint32 new_drakkin_details;
|
||||||
|
|
||||||
race = (in_race) ? in_race : GetBaseRace();
|
race = in_race;
|
||||||
|
if (race == 0)
|
||||||
|
{
|
||||||
|
race = (use_model) ? use_model : GetBaseRace();
|
||||||
|
}
|
||||||
|
|
||||||
if (in_gender != 0xFF)
|
if (in_gender != 0xFF)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -449,6 +449,7 @@ public:
|
|||||||
virtual inline uint16 GetDeity() const { return deity; }
|
virtual inline uint16 GetDeity() const { return deity; }
|
||||||
virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityTypeToDeityTypeBit((EQEmu::deity::DeityType)deity); }
|
virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityTypeToDeityTypeBit((EQEmu::deity::DeityType)deity); }
|
||||||
inline uint16 GetRace() const { return race; }
|
inline uint16 GetRace() const { return race; }
|
||||||
|
inline uint16 GetModel() const { return (use_model == 0) ? race : use_model; }
|
||||||
inline uint8 GetGender() const { return gender; }
|
inline uint8 GetGender() const { return gender; }
|
||||||
inline uint8 GetTexture() const { return texture; }
|
inline uint8 GetTexture() const { return texture; }
|
||||||
inline uint8 GetHelmTexture() const { return helmtexture; }
|
inline uint8 GetHelmTexture() const { return helmtexture; }
|
||||||
|
|||||||
@ -973,10 +973,12 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
chance = mod_tradeskill_chance(chance, spec);
|
chance = mod_tradeskill_chance(chance, spec);
|
||||||
|
|
||||||
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {
|
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {
|
||||||
|
|
||||||
success_modifier = 1;
|
success_modifier = 1;
|
||||||
|
|
||||||
if(over_trivial < 0)
|
if (over_trivial < 0) {
|
||||||
CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill);
|
CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill);
|
||||||
|
}
|
||||||
|
|
||||||
MessageString(Chat::LightBlue, TRADESKILL_SUCCEED, spec->name.c_str());
|
MessageString(Chat::LightBlue, TRADESKILL_SUCCEED, spec->name.c_str());
|
||||||
|
|
||||||
@ -984,21 +986,43 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
|
|
||||||
itr = spec->onsuccess.begin();
|
itr = spec->onsuccess.begin();
|
||||||
while(itr != spec->onsuccess.end() && !spec->quest) {
|
while(itr != spec->onsuccess.end() && !spec->quest) {
|
||||||
//should we check this crap?
|
|
||||||
SummonItem(itr->first, itr->second);
|
SummonItem(itr->first, itr->second);
|
||||||
item = database.GetItem(itr->first);
|
item = database.GetItem(itr->first);
|
||||||
if (this->GetGroup()) {
|
if (item) {
|
||||||
entity_list.MessageGroup(this, true, Chat::Skills, "%s has successfully fashioned %s!", GetName(), item->Name);
|
if (GetGroup()) {
|
||||||
|
entity_list.MessageGroup(this, true, Chat::Skills, "%s has successfully fashioned %s!", GetName(), item->Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log(
|
||||||
|
Logs::General,
|
||||||
|
Logs::Tradeskills,
|
||||||
|
StringFormat(
|
||||||
|
"Failure (null item pointer [id: %u, qty: %u]) :: recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i",
|
||||||
|
itr->first,
|
||||||
|
itr->second,
|
||||||
|
spec->recipe_id,
|
||||||
|
spec->tradeskill,
|
||||||
|
spec->trivial,
|
||||||
|
chance,
|
||||||
|
this->GetZoneID(),
|
||||||
|
this->GetInstanceID()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QS: Player_Log_Trade_Skill_Events */
|
/* QS: Player_Log_Trade_Skill_Events */
|
||||||
if (RuleB(QueryServ, PlayerLogTradeSkillEvents)){
|
if (RuleB(QueryServ, PlayerLogTradeSkillEvents)) {
|
||||||
|
|
||||||
std::string event_desc = StringFormat("Success :: fashioned recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, this->GetZoneID(), this->GetInstanceID());
|
std::string event_desc = StringFormat("Success :: fashioned recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, this->GetZoneID(), this->GetInstanceID());
|
||||||
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, this->CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, this->CharacterID(), event_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
UpdateTasksForItem(ActivityTradeSkill, itr->first, itr->second);
|
UpdateTasksForItem(ActivityTradeSkill, itr->first, itr->second);
|
||||||
|
}
|
||||||
|
|
||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
return(true);
|
return(true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user