diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 294599d8023..aacebfe6e44 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -20,14 +20,17 @@ /proc/testing(msg) world.log << "## TESTING: [msg][log_end]" +/proc/game_log(category, text) + diary << "\[[time_stamp()]] [game_id] [category]: [text][log_end]" + /proc/log_admin(text) admin_log.Add(text) if (config.log_admin) - diary << "\[[time_stamp()]]ADMIN: [text][log_end]" + game_log("ADMIN", text) /proc/log_debug(text) if (config.log_debug) - diary << "\[[time_stamp()]]DEBUG: [text][log_end]" + game_log("DEBUG", text) for(var/client/C in admins) if(C.prefs.toggles & CHAT_DEBUGLOGS) @@ -35,55 +38,55 @@ /proc/log_game(text) if (config.log_game) - diary << "\[[time_stamp()]]GAME: [text][log_end]" + game_log("GAME", text) /proc/log_vote(text) if (config.log_vote) - diary << "\[[time_stamp()]]VOTE: [text][log_end]" + game_log("VOTE", text) /proc/log_access(text) if (config.log_access) - diary << "\[[time_stamp()]]ACCESS: [text][log_end]" + game_log("ACCESS", text) /proc/log_say(text) if (config.log_say) - diary << "\[[time_stamp()]]SAY: [text][log_end]" + game_log("SAY", text) /proc/log_ooc(text) if (config.log_ooc) - diary << "\[[time_stamp()]]OOC: [text][log_end]" + game_log("OOC", text) /proc/log_whisper(text) if (config.log_whisper) - diary << "\[[time_stamp()]]WHISPER: [text][log_end]" + game_log("WHISPER", text) /proc/log_emote(text) if (config.log_emote) - diary << "\[[time_stamp()]]EMOTE: [text][log_end]" + game_log("EMOTE", text) /proc/log_attack(text) if (config.log_attack) - diary << "\[[time_stamp()]]ATTACK: [text][log_end]" //Seperate attack logs? Why? FOR THE GLORY OF SATAN! + game_log("ATTACK", text) /proc/log_adminsay(text) if (config.log_adminchat) - diary << "\[[time_stamp()]]ADMINSAY: [text][log_end]" + game_log("ADMINSAY", text) /proc/log_adminwarn(text) if (config.log_adminwarn) - diary << "\[[time_stamp()]]ADMINWARN: [text][log_end]" + game_log("ADMINWARN", text) /proc/log_pda(text) if (config.log_pda) - diary << "\[[time_stamp()]]PDA: [text][log_end]" + game_log("PDA", text) /proc/log_to_dd(text) world.log << text //this comes before the config check because it can't possibly runtime if(config.log_world_output) - diary << "\[[time_stamp()]]DD_OUTPUT: [text][log_end]" + game_log("DD_OUTPUT", text) /proc/log_misc(text) - diary << "\[[time_stamp()]]MISC: [text][log_end]" + game_log("MISC", text) /proc/log_unit_test(text) world.log << "## UNIT_TEST ##: [text]" diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 1686416bcce..1de1353db91 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -25,6 +25,7 @@ update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying if(join_motd) src << "
[join_motd]
" + src << "
Game ID:
[game_id]
" if(!mind) mind = new /datum/mind(key) diff --git a/code/world.dm b/code/world.dm index 57006ec5b4c..590b3871851 100644 --- a/code/world.dm +++ b/code/world.dm @@ -15,6 +15,7 @@ var/global/datum/global_init/init = new () Pre-map initialization stuff should go here. */ /datum/global_init/New() + generate_gameid() makeDatumRefLists() load_configuration() @@ -30,6 +31,20 @@ var/global/datum/global_init/init = new () /datum/global_init/destroy_observers() return FALSE +/var/game_id = null +/proc/generate_gameid() + if(game_id != null) + return + game_id = "" + + var/list/c = list("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0") + var/l = c.len + + var/t = world.realtime + while(t != 0) + game_id += c[(t % l) + 1] + t = round(t / l) + /world mob = /mob/new_player turf = /turf/space @@ -38,14 +53,13 @@ var/global/datum/global_init/init = new () cache_lifespan = 0 //stops player uploaded stuff from being kept in the rsc past the current session - #define RECOMMENDED_VERSION 509 /world/New() //logs var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") href_logfile = file("data/logs/[date_string] hrefs.htm") diary = file("data/logs/[date_string].log") - diary << "[log_end]\n[log_end]\nStarting up. [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" + diary << "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently if(byond_version < RECOMMENDED_VERSION)