Skip to content

Commit

Permalink
Update by Lagius:
Browse files Browse the repository at this point in the history
Admins cat see if other admin has left the game.
The game actually checks for configuration variable guest_jobban  (still be turned on by default).
Added white list for heads and some non-heads (as in guest jobbans). Add keys to file data/whitelist.txt and turn on the option USEWHITELIST in config.txt.
Cyborgs were added to the list of important jobs (for guests jobbans and whitelist).


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1568 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
rastaf.zero@gmail.com committed May 11, 2011
1 parent 73e160c commit e84f4ad
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 39 deletions.
4 changes: 4 additions & 0 deletions code/datums/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
var/hostedby = null
var/respawn = 1
var/guest_jobban = 1
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players

var/server
Expand Down Expand Up @@ -178,6 +179,9 @@
if ("guest_jobban")
config.guest_jobban = text2num(value)

if ("usewhitelist")
config.usewhitelist = 1

if ("dont_del_newmob")
config.del_new_on_log = 0

Expand Down
3 changes: 2 additions & 1 deletion code/game/cellautomata.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
src.load_motd()
src.load_rules()
src.load_admins()

if (config.usewhitelist)
load_whitelist()
src.update_status()

makepowernets()
Expand Down
12 changes: 12 additions & 0 deletions code/game/jobs/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ var/list/occupations = list(

var/list/assistant_occupations = list(
"Assistant")

var/list/head_positions = list(
"Captain",
"Head of Personnel",
"Head of Security",
"Chief Engineer",
"Research Director",
"Chief Medical Officer",
)

/proc/is_important_job(var/job)
return (job in head_positions) || (job in list("AI", "Cyborg", "Warden", "Detective"))
16 changes: 16 additions & 0 deletions code/game/jobs/whitelist.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var/list/whitelist

#define WHITELISTFILE "data/whitelist.txt"
/proc/load_whitelist()
var/text = file2text(WHITELISTFILE)
if (!text)
diary << "Failed to [WHITELISTFILE]\n"
else
whitelist = dd_text2list(text, "\n")

/proc/check_whitelist(mob/M /*, var/rank*/)
if(!whitelist)
return 0
return ("[M.ckey]" in whitelist)

#undef WHITELISTFILE
6 changes: 4 additions & 2 deletions code/modules/admin/banjob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ var

/proc/jobban_isbanned(mob/M, rank)
if(M)
if (rank == "Captain" || rank == "AI" || rank == "Head of Personnel" || rank == "Head of Security" || rank == "Chief Engineer" || rank == "Research Director" || rank == "Warden" || rank == "Detective" || rank == "Chief Medical Officer")
if(IsGuestKey(M.key)/* && config.guest_jobban*/)
if (is_important_job(rank))
if(config.guest_jobban && IsGuestKey(M.key))
return 1
if(config.usewhitelist && check_whitelist(M))
return 1
if (jobban_keylist.Find(text("[M.ckey] - [rank]")))
return 1
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/logout.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/mob/Logout()
log_access("Logout: [key_name(src)]")
if (admins[src.ckey])
message_admins("Admin logout: [key_name(src)]")
src.logged_in = 0

..()
Expand Down
75 changes: 39 additions & 36 deletions config/config.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# log OOC channel
## log OOC channel
LOG_OOC

# log client Say
## log client Say
LOG_SAY

# log admin actions
## log admin actions
LOG_ADMIN

# log client access (logon/logoff)
## log client access (logon/logoff)
LOG_ACCESS

# log game actions (start of round, results, etc.)
## log game actions (start of round, results, etc.)
LOG_GAME

# log player votes
## log player votes
LOG_VOTE

# log client Whisper
## log client Whisper
LOG_WHISPER

# sql switching
## sql switching
# SQL_ENABLED

#disconnect players who did nothing during 10 minutes
## disconnect players who did nothing during 10 minutes
# KICK_INACTIVE

# probablities for game modes chosen in "secret" and "random" modes
#
# default probablity is 1, increase to make that mode more likely to be picked
# set to 0 to disable that mode
# Cult mode is in alpha test, enable at your own risk
## probablities for game modes chosen in "secret" and "random" modes
##
## default probablity is 1, increase to make that mode more likely to be picked
## set to 0 to disable that mode
## Cult mode is in alpha test, enable at your own risk
PROBABILITY EXTENDED 0
PROBABILITY TRAITOR 8
PROBABILITY METEOR 0
Expand All @@ -44,53 +44,56 @@ PROBABILITY CHANGELING 2
PROBABILITY CULT 0
PROBABILITY MONKEY 0

# if amount of traitors scales or not
## if amount of traitors scales or not
#TRAITOR_SCALING

# allow players to initiate a restart vote
## allow players to initiate a restart vote
ALLOW_VOTE_RESTART

# allow players to initate a mode-change start
## allow players to initate a mode-change start
ALLOW_VOTE_MODE

# min delay (seconds) between voting sessions (default 10 minutes)
## min delay (seconds) between voting sessions (default 10 minutes)
VOTE_DELAY 600

# time period (seconds) which voting session will last (default 1 minute)
## time period (seconds) which voting session will last (default 1 minute)
VOTE_PERIOD 60

# prevents dead players from voting or starting votes
## prevents dead players from voting or starting votes
# NO_DEAD_VOTE

# players' votes default to "No vote" (otherwise, default to "No change")
## players' votes default to "No vote" (otherwise, default to "No change")
# DEFAULT_NO_VOTE

# allow AI job
## allow AI job
ALLOW_AI

# goon authentication
## goon authentication
#AUTHENTICATION

# disable abandon mob
## disable abandon mob
NORESPAWN

#disables calling del(src) on newmobs if they logout before spawnin in
#DONT_DEL_NEWMOB
## disables calling del(src) on newmobs if they logout before spawnin in
# DONT_DEL_NEWMOB

# set a hosted by name for unix platforms
## set a hosted by name for unix platforms
HOSTEDBY Yournamehere

# Set to jobban "Guest-" accounts from Captain, HoS, HoP, CE, RD, CMO, Warden, Security, Detective, and AI positions.
# Set to 1 to jobban them from those positions, set to 0 to allow them.
## Set to jobban "Guest-" accounts from Captain, HoS, HoP, CE, RD, CMO, Warden, Security, Detective, and AI positions.
## Set to 1 to jobban them from those positions, set to 0 to allow them.
GUEST_JOBBAN 1

# set a server location for world reboot. Don't include the byond://, just give the address and port.
# SERVER ss13.example.com:2506
## Set to jobban everyone who's key is not listed in data/whitelist.txt from Captain, HoS, HoP, CE, RD, CMO, Warden, Security, Detective, and AI positions.
## Uncomment to 1 to jobban, leave commented out to allow these positions for everyone (but see GUEST_JOBBAN above and regular jobbans)
# USEWHITELIST

#Ban appeals URL - usually for a forum or wherever people should go to contact your admins.
#BANAPPEALS http://justanotherday.example.com
## set a server location for world reboot. Don't include the byond://, just give the address and port.
# SERVER ss13.example.com:2506

#In-game features
#spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
#FEATURE_OBJECT_SPELL_SYSTEM
## Ban appeals URL - usually for a forum or wherever people should go to contact your admins.
# BANAPPEALS http://justanotherday.example.com

## In-game features
## spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
# FEATURE_OBJECT_SPELL_SYSTEM
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
#include "code\game\jobs\access.dm"
#include "code\game\jobs\jobprocs.dm"
#include "code\game\jobs\jobs.dm"
#include "code\game\jobs\whitelist.dm"
#include "code\game\machinery\ai_slipper.dm"
#include "code\game\machinery\airlock_control.dm"
#include "code\game\machinery\alarm.dm"
Expand Down

0 comments on commit e84f4ad

Please sign in to comment.