Support at this time does not allow setting the server password for access (Must be done through the Web interface using Username and Password auth), nor adding users to ban list / kicking players (must be done inside the Chivalry console itself during gameplay).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
#https://doc.nitrado.net/ #https://server.nitrado.net/en-GB/guides/chivalry-2-map-rotation-server-guide # Define the necessary variables $LifeLongToken = "Put your Lifelong Token here" $ServiceID = "Put your serviceId here (7-8 digits)" $ServerDetails = "https://api.nitrado.net/services/$ServiceID/gameservers" $SettingsURL = "https://api.nitrado.net/services/$ServiceID/gameservers/settings" $RestartURL = "https://api.nitrado.net/services/$ServiceID/gameservers/restart" $ListPlayers = "https://api.nitrado.net/services/$ServiceID/gameservers/games/players" $headers = @{ 'Authorization' = 'Bearer ' + $LifeLongToken 'User-Agent' = 'PostmanRuntime/7.40.0' 'Accept' = '*/*' 'Host' = 'api.nitrado.net' } $token_response = Invoke-RestMethod -Method GET -Uri ($ServerDetails) -Headers $headers $token_response.data.gameserver $token_response = Invoke-RestMethod -Method GET -Uri ($ListPlayers) -Headers $headers write-host "Total players current in server: " $token_response.data.players.Count write-host $token_response.data.players $token_response = Invoke-RestMethod -Method GET -Uri ($SettingsURL+"/sets") -Headers $headers $token_response #$token_response.data.sets.data.settings.config."map-rotation" $token_response = Invoke-RestMethod -Method POST -Uri ($SettingsURL+"?category=settings&key=admin-list&value={PutPlayerAdminIDHere}`r`n{PutPlayerAdminIDHere}`r`n{PutPlayerAdminIDHere}") -Headers $headers $token_response $token_response = Invoke-RestMethod -Method POST -Uri ($SettingsURL+"?category=settings&key=map-rotation&value= TO_Raid FFA_Duelyard TO_DarkForest TO_RudhelmSiege TO_Citadel TO_Galencourt TO_Stronghold TO_Lionspire TO_Falmire") -Headers $headers $token_response $token_response = Invoke-RestMethod -Method POST -Uri ($SettingsURL+"?category=settings&key=map-rotation&value= FFA_Duelyard ") -Headers $headers $token_response $token_response = Invoke-RestMethod -Method POST -Uri ($RestartURL+"?message=Restarting Via Powershell&restart_message=Server Restarting...") -Headers $headers $token_response #Server will take 180 seconds to reestablish write-host "Restarting server, please wait 180 seconds" sleep 180 write-host "Server is expected to be up and running..." |