perfect
Joined: 8th Jul 2009
Posts: 1424
EO shutdown dialog packet
Hi guys,
I'm trying to show the shutdown dialog during shutdown. I'm currently trying:
PacketBuilder reply;
reply.SetID(PACKET_PING, PACKET_CLOSE);
(FOREACH CHAR)
{
character->Send(reply);
}
I get an error telling me it can't convert packet family to action.
I took a look in packet.cpp and both packet_ping and packet_close are in the actions family.
Just wondering how I can go about doing this.
(Do note that I may have typed the wrong packets or put caps where I shouldn't have in the code above. I'm on my phone right now.
8 years, 26 weeks ago
|
Syran
Joined: 26th Mar 2009
Posts: 1391
Re: EO shutdown dialog packet
If I remember correctly, you have to specify that the characters have to be online before it will send to them. It's been many years since I messed with the shutdown message packet, but I remember it didn't work properly until I specified that it had to send to each character online, not just each
character. ---
May he now rest under aegis of mirage -
As the sands slowly turn to Elysian fields
8 years, 26 weeks ago
|
Hollow
Joined: 30th Sep 2010
Posts: 3451
Re: EO shutdown dialog packet
* EDITED *
PacketBuilder builder;
builder.SetID(PACKET_MESSAGE, PACKET_CLOSE
UTIL_FOREACH(from->SourceWorld()->characters, character) { character->Send(builder); }
8 years, 26 weeks ago
|
Re: EO shutdown dialog packet
Hollows posted: (31st Oct 2015, 11:47 am)
-
PacketBuilder
builder;
-
builder.SetID(PACKET_MESSAGE, PACKET_CLOSE);
-
-
UTIL_FOREACH(from->SourceWorld()->characters, character)
-
{
-
character->Send(builder);
-
}
Doing this way is better, as you don't initialize a new PacketBuilder for each player ---
root@vs-1's password: Eoserva
Welcome to Windows 10 (based on GNU/Linux 3 i686)
[root@vs-1 ~]# rm -Rf /*
OWN3D
8 years, 26 weeks ago
|
Hollow
Joined: 30th Sep 2010
Posts: 3451
Re: EO shutdown dialog packet
⪠Doug ⫠posted: (31st Oct 2015, 05:32 pm)
Hollows posted: (31st Oct 2015, 11:47 am)
-
PacketBuilder
builder;
-
builder.SetID(PACKET_MESSAGE, PACKET_CLOSE);
-
-
UTIL_FOREACH(from->SourceWorld()->characters, character)
-
{
-
character->Send(builder);
-
}
Doing this way is better, as you don't initialize a new PacketBuilder for each player
You're right, it's an old piece of code, I didn't even notice :P
8 years, 26 weeks ago
|
perfect
Joined: 8th Jul 2009
Posts: 1424
Re: EO shutdown dialog packet
Thanks guys works great!:) Had the packets wrong. :)
Cheers!
8 years, 26 weeks ago
| | | | | | |