From 64d6012399012b5b3d8a06baad8de47bd6d88e42 Mon Sep 17 00:00:00 2001 From: errorage Date: Tue, 16 Jul 2013 07:26:51 +0200 Subject: [PATCH] Added the ability to define the ip and computer id for a manual ban (in the banning panel). This is so mirroring bans or banning people who were not online during the round in progress does not require admins to spawn a mob, set their variables and then ban the mob. If however an admin attempts to add a manual ban for a player who was present during the current round, a player who still has a mob somewhere in the game world, the proc will prioritize the mob's ip and computer id variables, not the things entered in the banning panel form. --- code/modules/admin/DB ban/functions.dm | 7 ++++++- code/modules/admin/topic.dm | 13 ++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 804116fede..50f229ceaf 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -1,5 +1,6 @@ -datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null) +//Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional. +datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null, var/banip = null, var/bancid = null) if(!check_rights(R_MOD,0) && !check_rights(R_BAN)) return @@ -40,6 +41,8 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = ip = banned_mob.client.address else if(banckey) ckey = ckey(banckey) + computerid = bancid + ip = banip var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_player WHERE ckey = '[ckey]'") query.Execute() @@ -290,6 +293,8 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) output += "" output += "" output += "Ckey: " + output += "IP: " + output += "Computer id: " output += "Duration: " output += "Job: