mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
SERVER HOSTS: This commit replaces the existing admin-rank system. It is now more customizable. Admin.txt essentially works the same as it always has. Each line should look like: ckey - admin rank There is now however, an admin_ranks.txt. This textfile allows you to define ranks like so: admin rank +ADMIN +FUN +BUILD the +KEYWORD are flags adding permissions to that rank. There are brief descriptions in the text-file explaining what they do. You can now name the ranks anything you like, and give them the permissions you want them to have. This allows, for instance, ranks like: Game Admin on disciplinary +ADMIN +BAN This would give that game admin only the tools they need to admin. They would not have access to 'fun' verbs which control events and antags. There's lots of things you can do. For instance, a coder rank whom can debug stuff but cannot do admin tasks: Codermin +DEBUG +VAREDIT +SERVER There's lots you can do. As it evolves it will hopefully become more flexible. admin_ranks.txt defaults to use the old admin rank names. Apologies in advance as there will be a lot of anomalies, such as ranks losing verbs they once had. Please let me know about any problems. I can fix them quite easily simply by moving verbs between the lists or splitting the lists up into new flags. CODERS: There is now a check_rights(flags) proc. It check is usr is and admin and has -at least one of- the rights specified. It checks > usr < not src, so keep that in mind! If you need to check if something other than usr has specific tights, you can do if(holder.rights & R_ADMIN) etc. KNOWN ISSUES: +FUN probably needs to be split up into +MOBS and +EVENTS In-game promotion/demotion is currently disabled. It will be readded after everything else works ok. Erro's sql rights changes stuff is currently commented out. It will be re-added. There are still many many verbs which need updating. Apologies in advance for any inconvenience. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4991 316c924e-a436-60f5-8080-3fe189b3f50e
54 lines
1.8 KiB
Plaintext
54 lines
1.8 KiB
Plaintext
#define MEMOFILE "data/memo.sav" //where the memos are saved
|
|
#define ENABLE_MEMOS 1 //using a define because screw making a config variable for it. This is more efficient and purty.
|
|
|
|
//switch verb so we don't spam up the verb lists with like, 3 verbs for this feature.
|
|
/client/proc/admin_memo(task in list("write","show","delete"))
|
|
set name = "Memo"
|
|
set category = "Server"
|
|
if(!ENABLE_MEMOS) return
|
|
if(!check_rights(0)) return
|
|
switch(task)
|
|
if("write") admin_memo_write()
|
|
if("show") admin_memo_show()
|
|
if("delete") admin_memo_delete()
|
|
|
|
//write a message
|
|
/client/proc/admin_memo_write()
|
|
var/savefile/F = new(MEMOFILE)
|
|
if(F)
|
|
var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message
|
|
switch(memo)
|
|
if(null)
|
|
return
|
|
if("")
|
|
F.dir.Remove(ckey)
|
|
src << "<b>Memo removed</b>"
|
|
return
|
|
if( findtext(memo,"<script",1,0) )
|
|
return
|
|
F[ckey] << "[key] on [time2text(world.realtime,"(DDD) DD MMM hh:mm")]<br>[memo]"
|
|
message_admins("[key] set an admin memo:<br>[memo]")
|
|
|
|
//show all memos
|
|
/client/proc/admin_memo_show()
|
|
if(ENABLE_MEMOS)
|
|
var/savefile/F = new(MEMOFILE)
|
|
if(F)
|
|
for(var/ckey in F.dir)
|
|
src << "<center><span class='motd'><b>Admin Memo</b><i> by [F[ckey]]</i></span></center>"
|
|
|
|
//delete your own or somebody else's memo
|
|
/client/proc/admin_memo_delete()
|
|
var/savefile/F = new(MEMOFILE)
|
|
if(F)
|
|
var/ckey
|
|
if(check_rights(R_SERVER,0)) //high ranking admins can delete other admin's memos
|
|
ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir
|
|
else
|
|
ckey = src.ckey
|
|
if(ckey)
|
|
F.dir.Remove(ckey)
|
|
src << "<b>Removed Memo created by [ckey].</b>"
|
|
|
|
#undef MEMOFILE
|
|
#undef ENABLE_MEMOS |