mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Adds admin memos. It allows admins to leave all the other admins little messages which they can see when they log in. It is available to Game Admin rank and upwards.
type "memo" to access the memo features: >write: write a memo >show: shows memos from all admins >delete: delete your own. (Game Masters may delete other admins' memos) Typing "memo write" etc works too. Feature can be disabled by defining ENABLE_MEMOS as 0 MOTD moved to new_player/Login so peole don't see that big motd everytime they DC git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3650 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
54
code/modules/admin/admin_memo.dm
Normal file
54
code/modules/admin/admin_memo.dm
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#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(!holder) 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( holder.rank == "Game Master" )
|
||||||
|
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>"
|
||||||
@@ -249,6 +249,7 @@
|
|||||||
verbs += /client/proc/toggle_random_events
|
verbs += /client/proc/toggle_random_events
|
||||||
verbs += /client/proc/deadmin_self
|
verbs += /client/proc/deadmin_self
|
||||||
verbs += /client/proc/Set_Holiday //Force-set a Holiday
|
verbs += /client/proc/Set_Holiday //Force-set a Holiday
|
||||||
|
if(ENABLE_MEMOS) verbs += /client/proc/admin_memo
|
||||||
//verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables
|
//verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables
|
||||||
//verbs += /client/proc/cmd_admin_explosion --Merged with view variables
|
//verbs += /client/proc/cmd_admin_explosion --Merged with view variables
|
||||||
//verbs += /client/proc/cmd_admin_emp --Merged with view variables
|
//verbs += /client/proc/cmd_admin_emp --Merged with view variables
|
||||||
@@ -402,6 +403,7 @@
|
|||||||
verbs -= /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
verbs -= /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
||||||
verbs -= /client/proc/getserverlog
|
verbs -= /client/proc/getserverlog
|
||||||
verbs -= /client/proc/cinematic //show a cinematic sequence
|
verbs -= /client/proc/cinematic //show a cinematic sequence
|
||||||
|
verbs -= /client/proc/admin_memo
|
||||||
verbs -= /proc/possess
|
verbs -= /proc/possess
|
||||||
verbs -= /proc/release
|
verbs -= /proc/release
|
||||||
//verbs -= /client/proc/give_spell --Merged with view variables
|
//verbs -= /client/proc/give_spell --Merged with view variables
|
||||||
|
|||||||
@@ -651,20 +651,20 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/client/New()
|
/client/New()
|
||||||
if(findtextEx(key, "Telnet @"))
|
if( connection != "seeker" )
|
||||||
src << "Sorry, this game does not support Telnet."
|
src << "Sorry, this game does not support [connection] connections." //doesn't work
|
||||||
del(src)
|
del(src)
|
||||||
var/isbanned = CheckBan(src)
|
var/isbanned = CheckBan(src)
|
||||||
if (isbanned)
|
if (isbanned)
|
||||||
log_access("Failed Login: [src] - Banned")
|
log_access("Failed Login: [src] - Banned")
|
||||||
message_admins("\blue Failed Login: [src] - Banned")
|
message_admins("\blue Failed Login: [src] - Banned")
|
||||||
alert(src,"You have been banned.\nReason : [isbanned]","Ban","Ok")
|
alert(src,"You have been banned.\nReason : [isbanned]","Ban","Ok") //doesn't work
|
||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
if (!guests_allowed && IsGuestKey(key))
|
if (!guests_allowed && IsGuestKey(key))
|
||||||
log_access("Failed Login: [src] - Guests not allowed")
|
log_access("Failed Login: [src] - Guests not allowed")
|
||||||
message_admins("\blue Failed Login: [src] - Guests not allowed")
|
message_admins("\blue Failed Login: [src] - Guests not allowed")
|
||||||
alert(src,"You cannot play here.\nReason : Guests not allowed","Guests not allowed","Ok")
|
alert(src,"You cannot play here.\nReason : Guests not allowed","Guests not allowed","Ok") //doesn't work
|
||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
if (((world.address == address || !(address)) && !(host)))
|
if (((world.address == address || !(address)) && !(host)))
|
||||||
@@ -673,15 +673,13 @@
|
|||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
if (join_motd)
|
|
||||||
src << "<div class=\"motd\">[join_motd]</div>"
|
|
||||||
|
|
||||||
// authorize() //old gooncode
|
// authorize() //old gooncode
|
||||||
|
|
||||||
if(admins.Find(ckey))
|
if( ckey in admins )
|
||||||
holder = new /obj/admins(src)
|
holder = new /obj/admins(src)
|
||||||
holder.rank = admins[ckey]
|
holder.rank = admins[ckey]
|
||||||
update_admins(admins[ckey])
|
update_admins(admins[ckey])
|
||||||
|
admin_memo_show()
|
||||||
|
|
||||||
if(ticker && ticker.mode && ticker.mode.name =="sandbox")
|
if(ticker && ticker.mode && ticker.mode.name =="sandbox")
|
||||||
mob.CanBuild()
|
mob.CanBuild()
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
anchored = 1 // don't get pushed around
|
anchored = 1 // don't get pushed around
|
||||||
|
|
||||||
Login()
|
Login()
|
||||||
|
if (join_motd)
|
||||||
|
src << "<div class=\"motd\">[join_motd]</div>"
|
||||||
|
|
||||||
if(!preferences)
|
if(!preferences)
|
||||||
preferences = new
|
preferences = new
|
||||||
|
|
||||||
|
|||||||
@@ -179,8 +179,6 @@
|
|||||||
#define FILE_DIR "icons/vending_icons"
|
#define FILE_DIR "icons/vending_icons"
|
||||||
#define FILE_DIR "interface"
|
#define FILE_DIR "interface"
|
||||||
#define FILE_DIR "maps"
|
#define FILE_DIR "maps"
|
||||||
#define FILE_DIR "maps/backup"
|
|
||||||
#define FILE_DIR "maps/backup/backup"
|
|
||||||
#define FILE_DIR "maps/RandomZLevels"
|
#define FILE_DIR "maps/RandomZLevels"
|
||||||
#define FILE_DIR "sound"
|
#define FILE_DIR "sound"
|
||||||
#define FILE_DIR "sound/AI"
|
#define FILE_DIR "sound/AI"
|
||||||
@@ -740,6 +738,7 @@
|
|||||||
#include "code\js\byjax.dm"
|
#include "code\js\byjax.dm"
|
||||||
#include "code\js\menus.dm"
|
#include "code\js\menus.dm"
|
||||||
#include "code\modules\admin\admin.dm"
|
#include "code\modules\admin\admin.dm"
|
||||||
|
#include "code\modules\admin\admin_memo.dm"
|
||||||
#include "code\modules\admin\admin_verbs.dm"
|
#include "code\modules\admin\admin_verbs.dm"
|
||||||
#include "code\modules\admin\banjob.dm"
|
#include "code\modules\admin\banjob.dm"
|
||||||
#include "code\modules\admin\create_mob.dm"
|
#include "code\modules\admin\create_mob.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user