mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Correct tell queue related messages
This commit is contained in:
parent
8e43134bda
commit
9b70b73759
@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
|||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
== 09/19/2014 ==
|
== 09/19/2014 ==
|
||||||
demonstar55: Added Client::Tell_StringID (used in tell queue messages)
|
demonstar55: Added Client::Tell_StringID (used in tell queue messages)
|
||||||
|
demonstar55: Tell queues (and offline) messages now show correctly
|
||||||
|
|
||||||
== 09/18/2014==
|
== 09/18/2014==
|
||||||
demonstar55: Implement tell queues
|
demonstar55: Implement tell queues
|
||||||
|
|||||||
@ -347,6 +347,7 @@ struct ServerChannelMessage_Struct {
|
|||||||
uint16 chan_num;
|
uint16 chan_num;
|
||||||
uint32 guilddbid;
|
uint32 guilddbid;
|
||||||
uint16 language;
|
uint16 language;
|
||||||
|
uint8 queued; // 0 = not queued, 1 = queued, 2 = queue full, 3 = offline
|
||||||
char message[0];
|
char message[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -443,14 +443,26 @@ bool ZoneServer::Process() {
|
|||||||
ClientListEntry* cle = client_list.FindCharacter(scm->deliverto);
|
ClientListEntry* cle = client_list.FindCharacter(scm->deliverto);
|
||||||
if (cle == 0 || cle->Online() < CLE_Status_Zoning ||
|
if (cle == 0 || cle->Online() < CLE_Status_Zoning ||
|
||||||
(cle->TellsOff() && ((cle->Anon() == 1 && scm->fromadmin < cle->Admin()) || scm->fromadmin < 80))) {
|
(cle->TellsOff() && ((cle->Anon() == 1 && scm->fromadmin < cle->Admin()) || scm->fromadmin < 80))) {
|
||||||
if (!scm->noreply)
|
if (!scm->noreply) {
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0,
|
ClientListEntry* sender = client_list.FindCharacter(scm->from);
|
||||||
"%s is not online at this time.", scm->to);
|
if (!sender)
|
||||||
|
break;
|
||||||
|
scm->noreply = true;
|
||||||
|
scm->queued = 3; // offline
|
||||||
|
strcpy(scm->deliverto, scm->from);
|
||||||
|
// ideally this would be trimming off the message too, oh well
|
||||||
|
sender->Server()->SendPacket(pack);
|
||||||
|
}
|
||||||
} else if (cle->Online() == CLE_Status_Zoning) {
|
} else if (cle->Online() == CLE_Status_Zoning) {
|
||||||
if (!scm->noreply) {
|
if (!scm->noreply) {
|
||||||
|
ClientListEntry* sender = client_list.FindCharacter(scm->from);
|
||||||
if (cle->TellQueueFull()) {
|
if (cle->TellQueueFull()) {
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0,
|
if (!sender)
|
||||||
"%s's tell queue is full.", scm->to);
|
break;
|
||||||
|
scm->noreply = true;
|
||||||
|
scm->queued = 2; // queue full
|
||||||
|
strcpy(scm->deliverto, scm->from);
|
||||||
|
sender->Server()->SendPacket(pack);
|
||||||
} else {
|
} else {
|
||||||
size_t struct_size = sizeof(ServerChannelMessage_Struct) + strlen(scm->message) + 1;
|
size_t struct_size = sizeof(ServerChannelMessage_Struct) + strlen(scm->message) + 1;
|
||||||
ServerChannelMessage_Struct *temp = (ServerChannelMessage_Struct *) new uchar[struct_size];
|
ServerChannelMessage_Struct *temp = (ServerChannelMessage_Struct *) new uchar[struct_size];
|
||||||
@ -458,8 +470,13 @@ bool ZoneServer::Process() {
|
|||||||
memcpy(temp, scm, struct_size);
|
memcpy(temp, scm, struct_size);
|
||||||
temp->noreply = true;
|
temp->noreply = true;
|
||||||
cle->PushToTellQueue(temp); // deallocation is handled in processing or deconstructor
|
cle->PushToTellQueue(temp); // deallocation is handled in processing or deconstructor
|
||||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0,
|
|
||||||
"Your message has been added to %s's queue.", scm->to);
|
if (!sender)
|
||||||
|
break;
|
||||||
|
scm->noreply = true;
|
||||||
|
scm->queued = 1; // queued
|
||||||
|
strcpy(scm->deliverto, scm->from);
|
||||||
|
sender->Server()->SendPacket(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,18 +168,24 @@ void WorldServer::Process() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_ChannelMessage: {
|
case ServerOP_ChannelMessage: {
|
||||||
if (!ZoneLoaded) break;
|
if (!ZoneLoaded)
|
||||||
|
break;
|
||||||
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
|
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
|
||||||
if (scm->deliverto[0] == 0) {
|
if (scm->deliverto[0] == 0) {
|
||||||
entity_list.ChannelMessageFromWorld(scm->from, scm->to, scm->chan_num, scm->guilddbid, scm->language, scm->message);
|
entity_list.ChannelMessageFromWorld(scm->from, scm->to, scm->chan_num, scm->guilddbid, scm->language, scm->message);
|
||||||
}
|
} else {
|
||||||
else {
|
Client* client = entity_list.GetClientByName(scm->deliverto);
|
||||||
Client* client;
|
if (client) {
|
||||||
client = entity_list.GetClientByName(scm->deliverto);
|
|
||||||
if (client != 0) {
|
|
||||||
if (client->Connected()) {
|
if (client->Connected()) {
|
||||||
client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, scm->language, scm->message);
|
if (scm->queued == 1) // tell was queued
|
||||||
if (!scm->noreply && scm->chan_num!=2) { //dont echo on group chat
|
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);
|
||||||
|
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
|
// if it's a tell, echo back so it shows up
|
||||||
scm->noreply = true;
|
scm->noreply = true;
|
||||||
scm->chan_num = 14;
|
scm->chan_num = 14;
|
||||||
@ -1856,6 +1862,7 @@ bool WorldServer::SendChannelMessage(Client* from, const char* to, uint8 chan_nu
|
|||||||
scm->chan_num = chan_num;
|
scm->chan_num = chan_num;
|
||||||
scm->guilddbid = guilddbid;
|
scm->guilddbid = guilddbid;
|
||||||
scm->language = language;
|
scm->language = language;
|
||||||
|
scm->queued = 0;
|
||||||
strcpy(scm->message, buffer);
|
strcpy(scm->message, buffer);
|
||||||
|
|
||||||
pack->Deflate();
|
pack->Deflate();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user