You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while (enet_host_service(m_server, &event, 0) > 0)
{
switch (event.type)
{
case ENET_EVENT_TYPE_DISCONNECT:
}
}
``
an event comes with peer data removed.
so event.peer->data is 0
event.peer->connectionID is 0
all is nulled and I have no way to tell who has disconnected.
the workaround is to store a map of peer pointers in memory itself represented as int or str.
The text was updated successfully, but these errors were encountered:
I think event.peer ->data should still be valid on disconnect; you still need to clean up if you have modified it.
An event of type ENET_EVENT_TYPE_DISCONNECT is returned when a connected peer has either explicitly disconnected or timed out. Only the "peer" field of the event structure is valid for this event and contains the peer that disconnected. Only the "data" field of the peer is still valid on a disconnect event and must be explicitly reset.
from http://enet.bespin.org/Tutorial.html
Apparently when using
The text was updated successfully, but these errors were encountered: