Made game url a convar

This commit is contained in:
Samuel Williams 2020-12-21 22:28:08 +00:00 committed by Brandon Sturgeon
parent ebb525cc39
commit 0b638561f6
4 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,9 @@ You get to play the Dinosaur Game from Google Chrome!
```
- `cfc_disconnect_interface_restart_time` - (Int) The number of seconds that will be displayed as the average restart time for the server.
Defaults to `180`
- `cfc_disconnect_interface_game_url` - (String) The url to the dinosaur game.
Defaults to `https://cdn.cfcservers.org/media/dinosaur/index.html`
## Commands (Client-side)
- `cfc_disconnect_interface_test_crash` - Mimics the server crashing, showing the interface.
- `cfc_disconnect_interface_test_nointernet` - Mimics your internet disconnecting, showing the interface.

View File

@ -1,5 +1,6 @@
CreateConVar( "cfc_disconnect_interface_status_endpoint", "https://nanny.cfcservers.org/cfc3-ping", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
CreateConVar( "cfc_disconnect_interface_restart_time", 180, FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
CreateConVar( "cfc_disconnect_interface_game_url", "https://cdn.cfcservers.org/media/dinosaur/index.html", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
local minTimeout = CreateConVar( "sv_mintimeout", 900, FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED ):GetInt()
local timeout = GetConVar( "cl_timeout" )

View File

@ -4,6 +4,7 @@ util.AddNetworkString( "CFC_DisconnectInterface_Shutdown" )
CreateConVar( "cfc_disconnect_interface_status_endpoint", "https://nanny.cfcservers.org/cfc3-ping", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
CreateConVar( "cfc_disconnect_interface_restart_time", 180, FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
CreateConVar( "cfc_disconnect_interface_game_url", "https://cdn.cfcservers.org/media/dinosaur/index.html", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
CreateConVar( "sv_mintimeout", 900, FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_PROTECTED )
AddCSLuaFile( "cfc_disconnect_interface/client/cl_ponger.lua" )

View File

@ -32,9 +32,7 @@ surface.CreateFont( "CFC_Button",
}
)
-- local GAME_CODE
local GAME_URL = "https://cdn.cfcservers.org/media/dinosaur/index.html"
-- local GAME_URL = "http://local:8000/"
local GAME_URL = GetConVar( "cfc_disconnect_interface_game_url" ):GetString()
-- Width of the game on the website in pixels, needed as I didn't write the dinosaur game, and it doesn't like centering nicely
local GAME_WIDTH = 1256