GMX, Stop server -
Sime30 - 29.01.2015
Hi guys!
Back with some new questions!
I've read some threads about GMX not working properly and OnPlayerDisconnect not calling when should. I knew about these "bugs" but now I want to fullfill my knowledge.
Let's say I disabled RCON commands in my server. There are only 2 ways of stopping/restarting the server.
Windows
Server.exe started -> Running -> Press "X" at the console and stop the server.
What was called? By order?
Linux
1.
START button pressed via game panel -> Server started -> Running -> STOP button pressed via game panel.
What was called? By order?
2.
START button pressed via game panel -> Server started -> Running -> RESTART button pressed via game panel.
What was called? By order?
Regards!
Re: GMX, Stop server -
CalvinC - 29.01.2015
Well you can use
SendRconCommand to turn off the server too.
Re: GMX, Stop server -
Sime30 - 29.01.2015
I know, I will use that function to customly restart my server.
Can you answer me the questions?
Re: GMX, Stop server -
Jefff - 29.01.2015
OnGameModeExit is called always except server crash
Re: GMX, Stop server -
Sime30 - 29.01.2015
Quote:
Originally Posted by Jefff
OnGameModeExit is called always except server crash
|
Okay and which one has priority? OnGameModeExit vs OnPlayerDisconnect?
Re: GMX, Stop server -
Jefff - 29.01.2015
? Those are 2 different callbacks
OnGameModeExit - called when you use X button or STOP button pressed via game panel or RESTART button pressed via game panel
OnPlayerDisconnect - called when player disconnet
Re: GMX, Stop server -
Sime30 - 29.01.2015
I noticed once when I stopped my server by pressing X button, the callback OnPlayerDisconnect wasn't executed!
Re: GMX, Stop server -
Schneider - 29.01.2015
When using GMX OnPlayerDisconnect gets called first and then OnGameModeExit.
When closing the server by pressing the X button neither OnPlayerDisconnect nor OnGameModeExits gets called.
Re: GMX, Stop server -
Sime30 - 29.01.2015
Thanks
Quote:
When closing the server by pressing the X button neither OnPlayerDisconnect nor OnGameModeExits gets called.
|
Are you 100% sure about that?
And what about linux?
Re: GMX, Stop server -
Schneider - 29.01.2015
I don't know about linux, i'm using Windows and sa:mP 0.3.7
And yeah, i'm sure. Just tested it with this plain script, no filterscrips or plugins were loaded:
pawn Код:
#include <a_samp>
main(){}
public OnGameModeInit(){
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
print("OnGameModeInit Called");
return 1;
}
public OnGameModeExit(){
print("OnGameModeExit Called");
return 1;
}
public OnPlayerConnect(playerid){
print("OnPlayerConnect Called");
return 1;
}
public OnPlayerDisconnect(playerid, reason){
print("OnPlayerDisconnect Called");
return 1;
}
And this was in the serverlog.txt:
Quote:
[23:19:04] OnGameModeInit Called
[23:19:04] Number of vehicle models: 0
[23:19:35] Incoming connection: 127.0.0.1:63187 id: 0
[23:19:35] [join] Schneider has joined the server (0:127.0.0.1)
[23:19:35] OnPlayerConnect Called
Console input: gmx
[23:19:49] OnPlayerDisconnect Called
[23:19:49] OnGameModeExit Called
[23:20:01] OnGameModeInit Called
[23:20:01] Number of vehicle models: 0
[23:20:01] OnPlayerConnect Called
//Here I shut down the server by pressing the X-button.
|
Edit: If you type "
exit" in the server console to shut the server down, OnGameModeExit
does get called, but OnPlayerDisconnect not:
Quote:
[23:26:17] OnGameModeInit Called
[23:26:17] Number of vehicle models: 0
[23:26:45] Incoming connection: 127.0.0.1:65122 id: 0
[23:26:45] [join] Schneider has joined the server (0:127.0.0.1)
[23:26:45] OnPlayerConnect Called
Console input: exit
[23:26:56] --- Server Shutting Down.
[23:26:56] OnGameModeExit Called
[23:26:56] [part] Schneider has left the server (0:0)
|