mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 13:42:44 +00:00
*NIX Log files part 2.
CR+LF added to new lines, created a global variable log_end that can be used
on newlines
log_misc("blahblah...[log_end]\nMoreblahblah[log_end]")
put [log_end] prior to any \n and it will show up correctly in windows.
Also created log_misc() proc to log to diary, and removed a bunch of
diary << stuff all over the place.
This commit is contained in:
@@ -34,8 +34,8 @@ world/IsBanned(key,address,computer_id)
|
||||
var/ckeytext = ckey(key)
|
||||
|
||||
if(!establish_db_connection())
|
||||
world.log << "Ban database connection failure. Key [ckeytext] not checked"
|
||||
diary << "Ban database connection failure. Key [ckeytext] not checked"
|
||||
error("Ban database connection failure. Key [ckeytext] not checked")
|
||||
log_misc("Ban database connection failure. Key [ckeytext] not checked")
|
||||
return
|
||||
|
||||
var/failedcid = 1
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/proc/ToRban_update()
|
||||
spawn(0)
|
||||
diary << "Downloading updated ToR data...[world.system_type == UNIX ? ascii2text(13) :]"
|
||||
log_misc("Downloading updated ToR data...")
|
||||
var/http[] = world.Export("http://exitlist.torproject.org/exit-addresses")
|
||||
|
||||
var/list/rawlist = file2list(http["CONTENT"])
|
||||
@@ -36,10 +36,10 @@
|
||||
if(!cleaned) continue
|
||||
F[cleaned] << 1
|
||||
F["last_update"] << world.realtime
|
||||
diary << "ToR data updated![world.system_type == UNIX ? ascii2text(13) :]"
|
||||
log_misc("ToR data updated!")
|
||||
if(usr) usr << "ToRban updated."
|
||||
return 1
|
||||
diary << "ToR data update aborted: no data.[world.system_type == UNIX ? ascii2text(13) :]"
|
||||
log_misc("ToR data update aborted: no data.")
|
||||
return 0
|
||||
|
||||
/client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find"))
|
||||
|
||||
@@ -103,8 +103,8 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
world.log << "Failed to connect to database in load_admins(). Reverting to legacy system."
|
||||
diary << "Failed to connect to database in load_admins(). Reverting to legacy system."
|
||||
error("Failed to connect to database in load_admins(). Reverting to legacy system.")
|
||||
log_misc("Failed to connect to database in load_admins(). Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
load_admins()
|
||||
return
|
||||
@@ -123,8 +123,8 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
//find the client for a ckey if they are connected and associate them with the new admin datum
|
||||
D.associate(directory[ckey])
|
||||
if(!admin_datums)
|
||||
world.log << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
|
||||
diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
|
||||
error("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
|
||||
log_misc("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
load_admins()
|
||||
return
|
||||
|
||||
@@ -66,8 +66,8 @@ DEBUG
|
||||
log_admin("jobban_keylist was empty")
|
||||
else
|
||||
if(!establish_db_connection())
|
||||
world.log << "Database connection failed. Reverting to the legacy ban system.[world.system_type == UNIX ? ascii2text(13) :]"
|
||||
diary << "Database connection failed. Reverting to the legacy ban system.[world.system_type == UNIX ? ascii2text(13) :]"
|
||||
error("Database connection failed. Reverting to the legacy ban system.")
|
||||
log_misc("Database connection failed. Reverting to the legacy ban system.")
|
||||
config.ban_legacy_system = 1
|
||||
jobban_loadbanfile()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user