Skip to content

Commit

Permalink
adds distinct server sql name config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordie0608 committed Feb 9, 2017
1 parent 996bec1 commit 631b734
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
var/name = "Configuration" // datum name

var/server_name = null // server name (the name of the game window)
var/server_sql_name = null // short form server name used for the DB
var/station_name = null // station name (the name of the station in-game)
var/server_suffix = 0 // generate numeric suffix based on server port
var/lobby_countdown = 120 // In between round countdown.
var/round_end_countdown = 25 // Post round murder death kill countdown
var/hub = 0
Expand Down Expand Up @@ -351,10 +351,10 @@
config.respawn = 0
if("servername")
config.server_name = value
if("serversqlname")
config.server_sql_name = 1
if("stationname")
config.station_name = value
if("serversuffix")
config.server_suffix = 1
if("hostedby")
config.hostedby = value
if("server")
Expand Down
8 changes: 4 additions & 4 deletions code/modules/admin/sql_message_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
if(!timestamp)
timestamp = SQLtime()
if(!server)
if (config && config.server_name)
server = config.server_name
if (config && config.server_sql_name)
server = config.server_sql_name
server = sanitizeSQL(server)
if(isnull(secret))
switch(alert("Hide note from being viewed by players?", "Secret note?","Yes","No","Cancel"))
Expand Down Expand Up @@ -352,8 +352,8 @@ proc/get_message_output(type, target_ckey)
var/notetext
notesfile >> notetext
var/server
if(config && config.server_name)
server = config.server_name
if(config && config.server_sql_name)
server = config.server_sql_name
var/regex/note = new("^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$", "i")
note.Find(notetext)
var/timestamp = note.group[1]
Expand Down
3 changes: 0 additions & 3 deletions code/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
LoadBans()
investigate_reset()

if(config && config.server_name != null && config.server_suffix && world.port > 0)
config.server_name += " #[(world.port % 1000) / 100]"

timezoneOffset = text2num(time2text(0,"hh")) * 36000

if(config.sql_enabled)
Expand Down
5 changes: 4 additions & 1 deletion config/config.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Server name: This appears at the top of the screen in-game. Remove the # infront of SERVERNAME and replace 'tgstation' with the name of your choice
## Server name: This appears at the top of the screen in-game and in the BYOND hub. Remove the # infront of SERVERNAME and replace 'tgstation' with the name of your choice.
# SERVERNAME tgstation

## Server SQL name: This is the name used to identify the server to the SQL DB, distinct from SERVERNAME as it must be at most 32 characters.
# SERVERSQLNAME tgstation

## Station name: The name of the station as it is referred to in-game. If commented out, the game will generate a random name instead.
STATIONNAME Space Station 13

Expand Down

0 comments on commit 631b734

Please sign in to comment.