No there is no casting, I simply store ENetPeer as it is, and when packet
arrives back, I simply compare and they are not equivalent..
Probably there is a mistaken within my code, but the code is very simple.. that
is the reason why I emailed just in case anyone has ever encountered something
similar..
________________________________
From: Jay Sprenkle <[email protected]>
To: Syed Setia Pernama <[email protected]>; Discussion of the ENet library
<[email protected]>
Sent: Sunday, March 31, 2013 11:18 PM
Subject: Re: [ENet-discuss] ENetPeer pointer comparison..
If you are using c++ and casting an object to it's base type you will get a
different pointer than if you cast the object to the derived type. Both are
valid pointers to the same object but can't be compared.
On Fri, Mar 29, 2013 at 9:43 AM, Syed Setia Pernama <[email protected]> wrote:
Hi,
>
>
>I am 80% sure nothing wrong is with my code. Here I copy+paste the log:-
>
>
>22:12:48: Pinging peer (pointer=29411384, ip = 10.1.1.10)
>22:12:48: Pinging peer (pointer=29411764, ip = 10.1.1.30)
>22:12:48: ID_GENERAL_PINGĀ (pointer=29412144)
>
>
>
>What happened is I ping (using my own structure) two peers which has ENetPeer
>pointer address = 29411384 & 29411764. And then the peer is supposed to reply
>back, and I compare the ENetPeer
>stored in ENetEvent, and they are not the same! 29412144 is not the same with
>both (29411384 & 29411764). What I was hoping is the ENetPeer stored in
>ENetEvent should equal to either one,
>and therefore my code works.
>
>
>Question:
>Can anyone confirm that ENet indeed create a new copy of ENetPeer (not reusing
>it) for the above case?
>
>
>TIA.
>
>
>_______________________________________________
>ENet-discuss mailing list
>[email protected]
>http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
--
http://xkcd.com/1156/
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss