openmultiplayer / openmultiplayer/open.mp
IsPlayerConnected return 'true' before OnPlayerConnect (in OnIncomingConnection)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 641
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Compat with original SA:MP problem.
native IsPlayerConnected return 'true' before OnPlayerConnect (in OnIncomingConnection state).
In original SA:MP IsPlayerConnected return true on OnPlayerConnect stage, not OnIncomingConnection.
To Reproduce
Steps to reproduce the behavior:
Put to OnIncomingConnection callback:
printf("IsPlayerConnected(%d): %s", playerid, IsPlayerConnected(playerid) ? "Yes" : "No");
Expected behavior
IsPlayerConnected return true on OnPlayerConnect stage.
Screenshots and/or logs
Original SA:MP:
[28/07/2024 05:03:24] IsPlayerConnected(1): No
OPEN.MP:
[28/07/2024 04:53:43] [Info] IsPlayerConnected(0): Yes
Release version
Starting open.mp server (1.2.0.2670) from commit 41ebf182bf73dc9cb11841bfe6b0179ba31f9dd5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the connection lifecycle around the OnIncomingConnection and OnPlayerConnect callbacks, then inspect the implementation of IsPlayerConnected. Reproduce the logged behavior and confirm that the native reports the expected state at each callback stage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100