mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 15:46:37 +00:00
Merge remote-tracking branch 'remotes/origin/master' into blob_conversion
Conflicts: changelog.txt common/database.cpp world/client.cpp world/zoneserver.cpp zone/command.cpp
This commit is contained in:
@@ -3077,6 +3077,14 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType fil
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Client::Tell_StringID(uint32 string_id, const char *who, const char *message)
|
||||
{
|
||||
char string_id_str[10];
|
||||
snprintf(string_id_str, 10, "%d", string_id);
|
||||
|
||||
Message_StringID(MT_TellEcho, TELL_QUEUED_MESSAGE, who, string_id_str, message);
|
||||
}
|
||||
|
||||
void Client::SetTint(int16 in_slot, uint32 color) {
|
||||
Color_Struct new_color;
|
||||
new_color.color = color;
|
||||
|
||||
@@ -254,6 +254,7 @@ public:
|
||||
const char *message5 = nullptr, const char *message6 = nullptr,
|
||||
const char *message7 = nullptr, const char *message8 = nullptr,
|
||||
const char *message9 = nullptr);
|
||||
void Tell_StringID(uint32 string_id, const char *who, const char *message);
|
||||
void SendBazaarResults(uint32 trader_id,uint32 class_,uint32 race,uint32 stat,uint32 slot,uint32 type,char name[64],uint32 minprice,uint32 maxprice);
|
||||
void SendTraderItem(uint32 item_id,uint16 quantity);
|
||||
uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity);
|
||||
|
||||
@@ -9696,6 +9696,8 @@ void Client::CompleteConnect() {
|
||||
}
|
||||
|
||||
entity_list.RefreshClientXTargets(this);
|
||||
|
||||
worldserver.RequestTellQueue(GetName());
|
||||
}
|
||||
|
||||
void Client::Handle_OP_KeyRing(const EQApplicationPacket *app)
|
||||
|
||||
+71
-96
@@ -331,8 +331,6 @@ int command_init(void) {
|
||||
command_add("guilds",nullptr,0,command_guild) ||
|
||||
command_add("zonestatus","- Show connected zoneservers, synonymous with /servers",150,command_zonestatus) ||
|
||||
command_add("manaburn","- Use AA Wizard class skill manaburn on target",10,command_manaburn) ||
|
||||
command_add("viewmessage","[id] - View messages in your tell queue",100,command_viewmessage) ||
|
||||
command_add("viewmessages",nullptr,0,command_viewmessage) ||
|
||||
command_add("doanim","[animnum] [type] - Send an EmoteAnim for you or your target",50,command_doanim) ||
|
||||
command_add("randomfeatures","- Temporarily randomizes the Facial Features of your target",80,command_randomfeatures) ||
|
||||
command_add("rf",nullptr,80,command_randomfeatures) ||
|
||||
@@ -5191,53 +5189,6 @@ void command_manaburn(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
void command_viewmessage(Client *c, const Seperator *sep)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
if(sep->arg[1][0]==0)
|
||||
{
|
||||
if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT id,date,receiver,sender,message from tellque where receiver='%s'",c->GetName()), errbuf, &result))
|
||||
{
|
||||
if (mysql_num_rows(result)>0)
|
||||
{
|
||||
c->Message(0,"You have messages waiting for you to view.");
|
||||
c->Message(0,"Type #Viewmessage <Message ID> to view the message.");
|
||||
c->Message(0," ID , Message Sent Date, Message Sender");
|
||||
while ((row = mysql_fetch_row(result)))
|
||||
c->Message(0,"ID: %s Sent Date: %s Sender: %s ",row[0],row[1],row[3]);
|
||||
}
|
||||
else
|
||||
c->Message(0,"You have no new messages");
|
||||
mysql_free_result(result);
|
||||
}
|
||||
safe_delete_array(query);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT id,date,receiver,sender,message from tellque where id=%s",sep->argplus[1]), errbuf, &result))
|
||||
{
|
||||
if (mysql_num_rows(result)==1)
|
||||
{
|
||||
row = mysql_fetch_row(result);
|
||||
mysql_free_result(result);
|
||||
if (strcasecmp((const char *) c->GetName(), (const char *) row[2]) == 0)
|
||||
{
|
||||
c->Message(15,"ID: %s,Sent Date: %s,Sender: %s,Message: %s",row[0],row[1],row[3],row[4]);
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "Delete from tellque where id=%s",row[0]), errbuf);
|
||||
}
|
||||
else
|
||||
c->Message(13,"Invalid Message Number, check the number and try again.");
|
||||
}
|
||||
else
|
||||
c->Message(13,"Invalid Message Number, check the number and try again.");
|
||||
}
|
||||
safe_delete_array(query);
|
||||
}
|
||||
}
|
||||
|
||||
void command_doanim(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(1))
|
||||
@@ -6204,36 +6155,49 @@ void command_stun(Client *c, const Seperator *sep)
|
||||
c->Message(0, "Usage: #stun [duration]");
|
||||
}
|
||||
|
||||
|
||||
void command_ban(Client *c, const Seperator *sep)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if(sep->arg[1][0] == 0)
|
||||
if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0)
|
||||
{
|
||||
c->Message(0, "Usage: #ban [charname]");
|
||||
c->Message(0, "Usage: #ban <charname> <message>");
|
||||
}
|
||||
else
|
||||
{
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "SELECT account_id from `character_data` where name = '%s'", sep->arg[1]), errbuf, &result);
|
||||
if(query)
|
||||
{
|
||||
safe_delete_array(query);
|
||||
auto account_id = database.GetAccountIDByChar(sep->arg[1]);
|
||||
|
||||
std::string message;
|
||||
int i = 2;
|
||||
while(1) {
|
||||
if(sep->arg[i][0] == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(message.length() > 0) {
|
||||
message.push_back(' ');
|
||||
}
|
||||
|
||||
message += sep->arg[i];
|
||||
++i;
|
||||
}
|
||||
|
||||
if(mysql_num_rows(result))
|
||||
{
|
||||
row = mysql_fetch_row(result);
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "UPDATE account set status = -2 where id = %i", atoi(row[0])), errbuf, 0);
|
||||
c->Message(13,"Account number %i with the character %s has been banned.", atoi(row[0]), sep->arg[1]);
|
||||
if(message.length() == 0) {
|
||||
c->Message(0, "Usage: #ban <charname> <message>");
|
||||
return;
|
||||
}
|
||||
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_FlagUpdate, 6);
|
||||
*((uint32*) pack->pBuffer) = atoi(row[0]);
|
||||
*((int16*) &pack->pBuffer[4]) = -2;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
if(account_id > 0)
|
||||
{
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "UPDATE account set status = -2, ban_reason = '%s' where id = %i", EscapeString(message).c_str(), account_id), errbuf, 0);
|
||||
c->Message(13, "Account number %i with the character %s has been banned with message: \"%s\"", account_id, sep->arg[1], message.c_str());
|
||||
|
||||
ServerPacket pack(ServerOP_FlagUpdate, 6);
|
||||
*((uint32*)&pack.pBuffer[0]) = account_id;
|
||||
*((int16*)&pack.pBuffer[4]) = -2;
|
||||
worldserver.SendPacket(&pack);
|
||||
|
||||
Client *client = nullptr;
|
||||
client = entity_list.GetClientByName(sep->arg[1]);
|
||||
@@ -6243,25 +6207,20 @@ void command_ban(Client *c, const Seperator *sep)
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
|
||||
ServerPacket pack(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*)pack.pBuffer;
|
||||
strcpy(skp->adminname, c->GetName());
|
||||
strcpy(skp->name, sep->arg[1]);
|
||||
skp->adminrank = c->Admin();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
worldserver.SendPacket(&pack);
|
||||
}
|
||||
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->Message(13,"Character does not exist.");
|
||||
}
|
||||
if(query)
|
||||
{
|
||||
safe_delete_array(query);
|
||||
c->Message(13, "Character does not exist.");
|
||||
}
|
||||
|
||||
safe_delete_array(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6271,7 +6230,7 @@ void command_suspend(Client *c, const Seperator *sep)
|
||||
char *query = nullptr;
|
||||
|
||||
if((sep->arg[1][0] == 0) || (sep->arg[2][0] == 0))
|
||||
c->Message(0, "Usage: #suspend <charname> <days> (Specify 0 days to lift the suspension immediately)");
|
||||
c->Message(0, "Usage: #suspend <charname> <days>(Specify 0 days to lift the suspension immediately) <message>");
|
||||
else
|
||||
{
|
||||
int Duration = atoi(sep->arg[2]);
|
||||
@@ -6279,22 +6238,40 @@ void command_suspend(Client *c, const Seperator *sep)
|
||||
if(Duration < 0)
|
||||
Duration = 0;
|
||||
|
||||
char *EscName = new char[strlen(sep->arg[1]) * 2 + 1];
|
||||
std::string message;
|
||||
if(Duration > 0) {
|
||||
int i = 3;
|
||||
while(1) {
|
||||
if(sep->arg[i][0] == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
database.DoEscapeString(EscName, sep->arg[1], strlen(sep->arg[1]));
|
||||
if(message.length() > 0) {
|
||||
message.push_back(' ');
|
||||
}
|
||||
|
||||
message += sep->arg[i];
|
||||
++i;
|
||||
}
|
||||
|
||||
if(message.length() == 0) {
|
||||
c->Message(0, "Usage: #suspend <charname> <days>(Specify 0 days to lift the suspension immediately) <message>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int AccountID;
|
||||
|
||||
if((AccountID = database.GetAccountIDByChar(EscName)) > 0)
|
||||
if((AccountID = database.GetAccountIDByChar(sep->arg[1])) > 0)
|
||||
{
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "UPDATE `account` SET `suspendeduntil` = DATE_ADD(NOW(), INTERVAL %i DAY)"
|
||||
" WHERE `id` = %i", Duration, AccountID), errbuf, 0);
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "UPDATE `account` SET `suspendeduntil` = DATE_ADD(NOW(), INTERVAL %i DAY), "
|
||||
"suspend_reason = '%s' WHERE `id` = %i", Duration, EscapeString(message).c_str(), AccountID), errbuf, 0);
|
||||
|
||||
if(Duration)
|
||||
c->Message(13,"Account number %i with the character %s has been temporarily suspended for %i day(s).", AccountID, sep->arg[1],
|
||||
Duration);
|
||||
c->Message(13, "Account number %i with the character %s has been temporarily suspended for %i day(s) with the message: \"%s\"", AccountID, sep->arg[1],
|
||||
Duration, message.c_str());
|
||||
else
|
||||
c->Message(13,"Account number %i with the character %s is no longer suspended.", AccountID, sep->arg[1]);
|
||||
c->Message(13, "Account number %i with the character %s is no longer suspended.", AccountID, sep->arg[1]);
|
||||
|
||||
safe_delete_array(query);
|
||||
|
||||
@@ -6304,22 +6281,20 @@ void command_suspend(Client *c, const Seperator *sep)
|
||||
BannedClient->WorldKick();
|
||||
else
|
||||
{
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct* sks = (ServerKickPlayer_Struct*) pack->pBuffer;
|
||||
ServerPacket pack(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct* sks = (ServerKickPlayer_Struct*)pack.pBuffer;
|
||||
|
||||
strn0cpy(sks->adminname, c->GetName(), sizeof(sks->adminname));
|
||||
strn0cpy(sks->name, sep->arg[1], sizeof(sks->name));
|
||||
sks->adminrank = c->Admin();
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
|
||||
safe_delete(pack);
|
||||
worldserver.SendPacket(&pack);
|
||||
}
|
||||
|
||||
} else
|
||||
c->Message(13,"Character does not exist.");
|
||||
|
||||
safe_delete_array(EscName);
|
||||
}
|
||||
else {
|
||||
c->Message(13, "Character does not exist.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,6 @@ void command_guild(Client *c, const Seperator *sep);
|
||||
bool helper_guild_edit(Client *c, uint32 dbid, uint32 eqid, uint8 rank, const char* what, const char* value);
|
||||
void command_zonestatus(Client *c, const Seperator *sep);
|
||||
void command_manaburn(Client *c, const Seperator *sep);
|
||||
void command_viewmessage(Client *c, const Seperator *sep);
|
||||
void command_doanim(Client *c, const Seperator *sep);
|
||||
void command_randomfeatures(Client *c, const Seperator *sep);
|
||||
void command_face(Client *c, const Seperator *sep);
|
||||
|
||||
+16
-15
@@ -5598,28 +5598,29 @@ void Mob::CheckNumHitsRemaining(uint8 type, uint32 buff_slot, uint16 spell_id)
|
||||
}
|
||||
|
||||
//for some stupid reason SK procs return theirs one base off...
|
||||
uint16 Mob::GetProcID(uint16 spell_id, uint8 effect_index) {
|
||||
uint16 Mob::GetProcID(uint16 spell_id, uint8 effect_index)
|
||||
{
|
||||
if (!RuleB(Spells, SHDProcIDOffByOne)) // UF+ spell files
|
||||
return spells[spell_id].base[effect_index];
|
||||
|
||||
// We should actually just be checking if the mob is SHD, but to not force
|
||||
// custom servers to create new spells, we will still do this
|
||||
bool sk = false;
|
||||
bool other = false;
|
||||
for(int x = 0; x < 16; x++)
|
||||
{
|
||||
if(x == 4){
|
||||
if(spells[spell_id].classes[4] < 255)
|
||||
for (int x = 0; x < 16; x++) {
|
||||
if (x == 4) {
|
||||
if (spells[spell_id].classes[4] < 255)
|
||||
sk = true;
|
||||
}
|
||||
else{
|
||||
if(spells[spell_id].classes[x] < 255)
|
||||
} else {
|
||||
if (spells[spell_id].classes[x] < 255)
|
||||
other = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(sk && !other)
|
||||
{
|
||||
return(spells[spell_id].base[effect_index] + 1);
|
||||
}
|
||||
else{
|
||||
return(spells[spell_id].base[effect_index]);
|
||||
}
|
||||
if (sk && !other)
|
||||
return spells[spell_id].base[effect_index] + 1;
|
||||
else
|
||||
return spells[spell_id].base[effect_index];
|
||||
}
|
||||
|
||||
bool Mob::TryDivineSave()
|
||||
|
||||
@@ -249,6 +249,8 @@
|
||||
#define PLAYER_CHARMED 1461 //You lose control of yourself!
|
||||
#define TRADER_BUSY 1468 //That Trader is currently with a customer. Please wait until their transaction is finished.
|
||||
#define SENSE_CORPSE_DIRECTION 1563 //You sense a corpse in this direction.
|
||||
#define QUEUED_TELL 2458 //[queued]
|
||||
#define QUEUE_TELL_FULL 2459 //[zoing and queue is full]
|
||||
#define SUSPEND_MINION_UNSUSPEND 3267 //%1 tells you, 'I live again...'
|
||||
#define SUSPEND_MINION_SUSPEND 3268 //%1 tells you, 'By your command, master.'
|
||||
#define ONLY_SUMMONED_PETS 3269 //3269 This effect only works with summoned pets.
|
||||
@@ -269,6 +271,8 @@
|
||||
#define CORPSEDRAG_STOP 4066 //You stop dragging the corpse.
|
||||
#define TARGET_TOO_CLOSE 4602 //You are too close to your target. Get farther away.
|
||||
#define WHOALL_NO_RESULTS 5029 //There are no players in EverQuest that match those who filters.
|
||||
#define TELL_QUEUED_MESSAGE 5045 //You told %1 '%T2. %3'
|
||||
#define TOLD_NOT_ONLINE 5046 //%1 is not online at this time.
|
||||
#define PETITION_NO_DELETE 5053 //You do not have a petition in the queue.
|
||||
#define PETITION_DELETED 5054 //Your petition was successfully deleted.
|
||||
#define GAIN_RAIDEXP 5085 //You gained raid experience!
|
||||
|
||||
+31
-8
@@ -168,18 +168,24 @@ void WorldServer::Process() {
|
||||
break;
|
||||
}
|
||||
case ServerOP_ChannelMessage: {
|
||||
if (!ZoneLoaded) break;
|
||||
if (!ZoneLoaded)
|
||||
break;
|
||||
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
|
||||
if (scm->deliverto[0] == 0) {
|
||||
entity_list.ChannelMessageFromWorld(scm->from, scm->to, scm->chan_num, scm->guilddbid, scm->language, scm->message);
|
||||
}
|
||||
else {
|
||||
Client* client;
|
||||
client = entity_list.GetClientByName(scm->deliverto);
|
||||
if (client != 0) {
|
||||
} else {
|
||||
Client* client = entity_list.GetClientByName(scm->deliverto);
|
||||
if (client) {
|
||||
if (client->Connected()) {
|
||||
client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, scm->language, scm->message);
|
||||
if (!scm->noreply && scm->chan_num!=2) { //dont echo on group chat
|
||||
if (scm->queued == 1) // tell was queued
|
||||
client->Tell_StringID(QUEUED_TELL, scm->to, scm->message);
|
||||
else if (scm->queued == 2) // tell queue was full
|
||||
client->Tell_StringID(QUEUE_TELL_FULL, scm->to, scm->message);
|
||||
else if (scm->queued == 3) // person was offline
|
||||
client->Message_StringID(MT_TellEcho, TOLD_NOT_ONLINE, scm->to);
|
||||
else // normal stuff
|
||||
client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, scm->language, scm->message);
|
||||
if (!scm->noreply && scm->chan_num != 2) { //dont echo on group chat
|
||||
// if it's a tell, echo back so it shows up
|
||||
scm->noreply = true;
|
||||
scm->chan_num = 14;
|
||||
@@ -1874,6 +1880,7 @@ bool WorldServer::SendChannelMessage(Client* from, const char* to, uint8 chan_nu
|
||||
scm->chan_num = chan_num;
|
||||
scm->guilddbid = guilddbid;
|
||||
scm->language = language;
|
||||
scm->queued = 0;
|
||||
strcpy(scm->message, buffer);
|
||||
|
||||
pack->Deflate();
|
||||
@@ -2198,3 +2205,19 @@ void WorldServer::HandleLFPMatches(ServerPacket *pack) {
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldServer::RequestTellQueue(const char *who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_RequestTellQueue, sizeof(ServerRequestTellQueue_Struct));
|
||||
ServerRequestTellQueue_Struct* rtq = (ServerRequestTellQueue_Struct*) pack->pBuffer;
|
||||
|
||||
strn0cpy(rtq->name, who, sizeof(rtq->name));
|
||||
|
||||
SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ public:
|
||||
void HandleLFGMatches(ServerPacket *pack);
|
||||
void HandleLFPMatches(ServerPacket *pack);
|
||||
|
||||
void RequestTellQueue(const char *who);
|
||||
|
||||
private:
|
||||
virtual void OnConnected();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user