openmultiplayer / open.mp

Open Multiplayer, a multiplayer mod fully backwards compatible with SA-MP
https://open.mp
Mozilla Public License 2.0
453 stars 92 forks source link

OnPlayerConnect behaviour after gmx #884

Closed NexiusTailer closed 6 months ago

NexiusTailer commented 7 months ago

Describe the bug After the recent changes from commit 59c5b09, there are still a bug: if gmx command was used, omp server calls OnPlayerDisconnect (for gamemode only), but does not call OnPlayerConnect at all after the gamemode was fully restarted.

To Reproduce Log OnPlayerConnect and OnPlayerDisconnect calls

public OnPlayerConnect(playerid)
{
    printf("[GM] OnPlayerConnect(playerid %d)", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    printf("[GM] OnPlayerDisconnect(playerid %d, reason %d)", playerid, reason);
    return 1;
}

And join a server, then make restart with gmx. There will be called OnPlayerDisconnect only.

Screenshots and/or logs

[17:05:34] [Info] [connection] incoming connection: 127.0.0.1:57690 id: 0
[17:05:34] [Info] [join] Nexius has joined the server (0:127.0.0.1)
[17:05:34] [Info] [GM] OnPlayerConnect(playerid 0)
[17:05:34] [Info] OnPlayerRequestClass(playerid 0, classid 0)
[17:05:37] [Info] OnPlayerRequestSpawn(playerid 0)
[17:05:37] [Info] OnPlayerSpawn(playerid 0)
[17:05:47] [Warning] RCON (In-Game): Player #0 (Nexius) has logged in.
[17:05:51] [Warning] RCON (In-Game): Player [Nexius] sent command: gmx
[17:05:51] [Info] [GM] OnPlayerDisconnect(playerid 0, reason 1)

[17:06:03] [Warning] Deprecated console variable "rcon", use "rcon.enable" instead.
[17:06:03] [Warning] Legacy key `rcon` supplied, using `rcon.enable`
[17:06:03] [Info] OnPlayerRequestClass(playerid 0, classid 0)
[17:06:09] [Info] OnPlayerRequestSpawn(playerid 0)
[17:06:09] [Info] OnPlayerSpawn(playerid 0)
[17:06:12] [Info] [GM] OnPlayerDisconnect(playerid 0, reason 1)
[17:06:12] [Info] [part] Nexius has left the server (0:1)
AmyrAhmady commented 7 months ago

Yes, should have fully tested it, my bad I added the code for it but apparently based on your logs it's not getting executed, I'll check it today

NexiusTailer commented 7 months ago

btw this is now probably unneeded https://github.com/openmultiplayer/open.mp/blob/59c5b09e6379df2482297f19ec181b1684c13f09/SDK/include/network.hpp#L32-L35

Y-Less commented 7 months ago

Reverted. Not happening.

NexiusTailer commented 7 months ago

Reverted. Not happening.

Why?

pushline commented 7 months ago

->community wants thing ->thing is added ->one guy decides (on a community codebase) that isnt happening and try to be the final decision

NexiusTailer commented 7 months ago

@Y-Less so, why not go and make a fork with all needed changes if you personally need it? The community already decided that this is not what should be enabled in the omp server by default. Or does the hypocrisy of covering up one’s projects with the word "community" still continue?