[ANet] Send Event Extention?

Posted By: Rasch

[ANet] Send Event Extention? - 01/01/11 23:54

Hi Dark_samurai,

i canīt write you a pm cause your personal limit is reached grin

1) First i have a question. In the manual it says you can send an event to yourself.

Does this cost traffic or not?

2) Could you think about implenting another "function" like BROADCAST, SERVER maybe ALL to send it to all + sender?

Otherwise we need to do it like this.

Code:
enet_clsend_event(20,daten,25,BROADCAST);
enet_clsend_event(20,daten,25,enet_get_clientid());



Or is there already something new? laugh

Would be great laugh

Thanks
Posted By: Dark_samurai

Re: [ANet] Send Event Extention? - 01/02/11 10:52

Quote:
1) First i have a question. In the manual it says you can send an event to yourself.


Yes this will require traffic. This is ment to do some sort of ping to test the connection. Because the packet will travel from the client to the server and back.

Better do it this way:

Code:
enet_clsend_event(20, daten, 25, BROADCAST);
event_function(MY_CLIENTID, (String*)daten, 25); //the event function that is registered for event 20



This costs no traffic and is easy to implement. Another sending option would be too much work for too less advantages because the workaround is that easy.
Posted By: Rasch

Re: [ANet] Send Event Extention? - 01/03/11 13:15

Allright thanks laugh
© 2024 lite-C Forums