EOSERV Forum > EOSERV > EO shutdown dialog packet
Page: << 1 >>
EO shutdown dialog packet
Author Message
Post #198767 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
Post #198768 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
Post #198770 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
Post #198773 Re: EO shutdown dialog packet
Hollows posted: (31st Oct 2015, 11:47 am)

  1. PacketBuilder builder;
  2. builder.SetID(PACKET_MESSAGE, PACKET_CLOSE);
  3.  
  4. UTIL_FOREACH(from->SourceWorld()->characters, character)
  5. {
  6.         character->Send(builder);
  7. }

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
Post #198774 Re: EO shutdown dialog packet
♪ Doug ♫ posted: (31st Oct 2015, 05:32 pm)

Hollows posted: (31st Oct 2015, 11:47 am)

  1. PacketBuilder builder;
  2. builder.SetID(PACKET_MESSAGE, PACKET_CLOSE);
  3.  
  4. UTIL_FOREACH(from->SourceWorld()->characters, character)
  5. {
  6.         character->Send(builder);
  7. }

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
Post #198777 Re: EO shutdown dialog packet

Thanks guys works great!:)  Had the packets wrong. :)

Cheers!

8 years, 26 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > EO shutdown dialog packet