Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disconnect event has no peer data #270

Open
winsvega opened this issue Nov 25, 2024 · 0 comments
Open

disconnect event has no peer data #270

winsvega opened this issue Nov 25, 2024 · 0 comments

Comments

@winsvega
Copy link

winsvega commented Nov 25, 2024

Apparently when using

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. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant