mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
Process converted to QueryDatabase
This commit is contained in:
parent
87efd22394
commit
e2d85337d0
@ -446,31 +446,34 @@ bool ZoneServer::Process() {
|
|||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
||||||
}
|
}
|
||||||
else if (cle->Online() == CLE_Status_Zoning) {
|
else if (cle->Online() == CLE_Status_Zoning) {
|
||||||
if (!scm->noreply) {
|
if (!scm->noreply)
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
{
|
||||||
char *query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
//MYSQL_ROW row; Trumpcard - commenting. Currently unused.
|
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm * timeinfo;
|
struct tm * timeinfo;
|
||||||
time ( &rawtime );
|
time ( &rawtime );
|
||||||
timeinfo = localtime ( &rawtime );
|
timeinfo = localtime ( &rawtime );
|
||||||
char *telldate=asctime(timeinfo);
|
char *telldate=asctime(timeinfo);
|
||||||
if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT name from character_ where name='%s'",scm->deliverto), errbuf, &result)) {
|
|
||||||
safe_delete(query);
|
std::string query = StringFormat("SELECT name FROM character_ WHERE name = '%s'",scm->deliverto);
|
||||||
if (result!=0) {
|
auto results = database.QueryDatabase(query);
|
||||||
if (database.RunQuery(query, MakeAnyLenString(&query, "INSERT INTO tellque (Date,Receiver,Sender,Message) values('%s','%s','%s','%s')",telldate,scm->deliverto,scm->from,scm->message), errbuf, &result))
|
if (!results.Success())
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (results.RowCount() == 0) {
|
||||||
|
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
query = StringFormat("INSERT INTO tellque "
|
||||||
|
"(Date, Receiver, Sender, Message) "
|
||||||
|
"VALUES('%s', '%s', '%s', '%s')",
|
||||||
|
telldate, scm->deliverto, scm->from, scm->message);
|
||||||
|
results = database.QueryDatabase(query);
|
||||||
|
if (results.Success())
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "Your message has been added to the %s's que.", scm->to);
|
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "Your message has been added to the %s's que.", scm->to);
|
||||||
else
|
else
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
||||||
safe_delete(query);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
safe_delete(query);
|
|
||||||
}
|
}
|
||||||
// zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
// zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user