I'm trying to build a server plugin that restarts the weekend by itself, when for example, the session advances to qualy, thus returning to practice. My idea would be to use the chat by sending the message "/callvote restartweekend" or "/callvote nextrace". But to my surprise, this command only works in the in-game chat. In dedicated server chat, this command does not work. Maybe because the dedicated server has this function in buttons that just click? The "/callvote nextsession" command works both in-game chat and on the dedicated server. Does anyone know if exists any other commands to restart the weekend on the dedicated server?
When I've done server control I've "pressed" the server dialog buttons via the program/plugin. Easy enough to find the window (even multiple, identified by path and/or name) and the button IDs haven't changed in 15 years...
Yes. As I said above, the restartweekend and nextrace commands contained in this list do not work if used on the dedicated server. It only works if you are a client and use the in-game chat.
How boring is that. It would be much simpler for the internal command that already exists to work on the server.
Maybe make a plugin that crashes the server when going out practice. Make sure the dedicated is in auto-restart and you're done ... Very brutal way to do it but it should work We definitely need more commands that can be called in plugins ... editgrid, setmass work pretty well via chat inside a plugin. Welcome Plugin is a good example for that kind of actions.
I'll make a bug report about that. Edit: Actually, I don't know if it's a bug, I don't think admins are allowed to start votes. Normally when an admin is logged in, users are not allowed to start votes either, unless you change the server settings. Edit 2: Nevermind, I was wrong, I've made a bug report for it.
As an alternative to the plugin interface, you can use the rest API. If you get http://ip:port/navigation/state where ip is the IP address of the dedi and port is the WebUi port as defined in Player.json on the dedi, you'll get a return similar to: Code: { "state": { "internalStateCode": "OP_IN_OPTIONS", "navigationState": "NAV_MAIN_MENU", "settingMode": "SETTING_MULTIPLAYER", "user": { "admin": false, "userState": "DEFAULT" }, "gameState": "GSTATE_DYN", "gameSession": "QUALIFY1", "gamePhase": "GREEN", "appBuild": 1131 } } based on the 'gameSession' value, you can see the current session type. You can then post to http://ip:port/navigation/action/{navAction} where navAction is NAV_FINISH_SESSION or NAV_RESTART_WEEKEND or NAV_EXIT. Check out http://ip:port/swagger/index.html for more info.
Ok, I know we have palliative options. But the command running directly within the code is the cleanest and simplest way to use it. If we can use other commands like \restartwarmup directly inside the plugin, using the other existing commands via chat should not be a problem. Anyway, thanks for the tip.