mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Merge pull request #1766 from Markolie/adminbus
Admin jump overhaul, add watchlist functionality, other admin updates
This commit is contained in:
@@ -311,13 +311,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(jobban_isbanned(M, "AntagHUD"))
|
||||
src << "\red <B>You have been banned from using this feature</B>"
|
||||
return
|
||||
if(config.antag_hud_restricted && !M.has_enabled_antagHUD &&!client.holder)
|
||||
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && !check_rights(R_MOD,0))
|
||||
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
|
||||
if(response == "No") return
|
||||
M.can_reenter_corpse = 0
|
||||
if(M in respawnable_list)
|
||||
respawnable_list -= M
|
||||
if(!M.has_enabled_antagHUD && !client.holder)
|
||||
if(!M.has_enabled_antagHUD && !check_rights(R_MOD,0))
|
||||
M.has_enabled_antagHUD = 1
|
||||
if(M.antagHUD)
|
||||
M.antagHUD = 0
|
||||
@@ -598,4 +598,5 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
|
||||
client.images |= ghost_darkness_images
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
client.images -= ghostimage //remove ourself
|
||||
|
||||
@@ -452,9 +452,9 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
var/start_T_descriptor = "<font color='#6b5d00'>tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]</font>"
|
||||
var/end_T_descriptor = "<font color='#6b4400'>tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]</font>"
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been thrown by [usr.name] ([usr.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Has thrown [M.name] ([M.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
msg_admin_attack("[usr.name] ([usr.ckey])[isAntag(usr) ? "(ANTAG)" : ""] has thrown [M.name] ([M.ckey]) from [start_T_descriptor] with the target [end_T_descriptor] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[usr.x];Y=[usr.y];Z=[usr.z]'>JMP</a>)")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been thrown by [key_name(usr)] from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Has thrown [key_name(M)] from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
msg_admin_attack("[key_name_admin(usr)] has thrown [key_name_admin(M)] from [start_T_descriptor] with the target [end_T_descriptor]")
|
||||
|
||||
if(!iscarbon(usr))
|
||||
M.LAssailant = null
|
||||
|
||||
@@ -239,9 +239,9 @@ emp_act
|
||||
--src.meatleft
|
||||
user << "\red You hack off a chunk of meat from [src.name]"
|
||||
if(!src.meatleft)
|
||||
src.attack_log += "\[[time_stamp()]\] Was chopped up into meat by <b>[user]/[user.ckey]</b>"
|
||||
user.attack_log += "\[[time_stamp()]\] Chopped up <b>[src]/[src.ckey]</b> into meat</b>"
|
||||
msg_admin_attack("[user.name] ([user.ckey])[isAntag(user) ? "(ANTAG)" : ""] chopped up [src] ([src.ckey]) into meat (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
src.attack_log += "\[[time_stamp()]\] Was chopped up into meat by <b>[key_name(user)]</b>"
|
||||
user.attack_log += "\[[time_stamp()]\] Chopped up <b>[key_name(src)]</b> into meat</b>"
|
||||
msg_admin_attack("[key_name_admin(user)] chopped up [key_name_admin(src)] into meat")
|
||||
if(!iscarbon(user))
|
||||
LAssailant = null
|
||||
else
|
||||
@@ -394,12 +394,11 @@ emp_act
|
||||
|
||||
if(ismob(O.thrower))
|
||||
var/mob/M = O.thrower
|
||||
var/client/assailant = M.client
|
||||
if(assailant)
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [M.name] ([assailant.ckey])</font>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [src.name] ([src.ckey]) with a thrown [O]</font>")
|
||||
if(M)
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [key_name(M)]</font>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [O]</font>")
|
||||
if(!istype(src,/mob/living/simple_animal/mouse))
|
||||
msg_admin_attack("[src.name] ([src.ckey]) was hit by a [O], thrown by [M.name] ([assailant.ckey])[isAntag(M) ? "(ANTAG)" : ""] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)")
|
||||
msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
|
||||
|
||||
//thrown weapon embedded object code.
|
||||
if(dtype == BRUTE && istype(O,/obj/item))
|
||||
@@ -497,8 +496,11 @@ emp_act
|
||||
M.occupant_message("<span class='danger'>You hit [src].</span>")
|
||||
visible_message("<span class='danger'>[src] has been hit by [M.name].</span>", \
|
||||
"<span class='userdanger'>[src] has been hit by [M.name].</span>")
|
||||
add_logs(M.occupant, src, "attacked", object=M, addition="(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
|
||||
|
||||
attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked by \the [M] controlled by [key_name(M.occupant)] (INTENT: [uppertext(M.occupant.a_intent)])</font>")
|
||||
M.occupant.attack_log += text("\[[time_stamp()]\] <font color='red'>Attacked [src] with \the [M] (INTENT: [uppertext(M.occupant.a_intent)])</font>")
|
||||
msg_admin_attack("[key_name_admin(M.occupant)] attacked [key_name_admin(src)] with \the [M] (INTENT: [uppertext(M.occupant.a_intent)])")
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -115,12 +115,11 @@
|
||||
|
||||
if(ismob(O.thrower))
|
||||
var/mob/M = O.thrower
|
||||
var/client/assailant = M.client
|
||||
if(assailant)
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [M.name] ([assailant.ckey])</font>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [src.name] ([src.ckey]) with a thrown [O]</font>")
|
||||
if(M)
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [key_name(M)]</font>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [O]</font>")
|
||||
if(!istype(src,/mob/living/simple_animal/mouse))
|
||||
msg_admin_attack("[src.name] ([src.ckey]) was hit by a [O], thrown by [M.name] ([assailant.ckey])[isAntag(M) ? "(ANTAG)" : ""] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)")
|
||||
msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
|
||||
|
||||
// Begin BS12 momentum-transfer code.
|
||||
if(O.throw_source && speed >= 15)
|
||||
@@ -166,13 +165,16 @@
|
||||
M.occupant_message("<span class='danger'>You hit [src].</span>")
|
||||
visible_message("<span class='danger'>[src] has been hit by [M.name].</span>", \
|
||||
"<span class='userdanger'>[src] has been hit by [M.name].</span>")
|
||||
add_logs(M.occupant, src, "attacked", object=M, addition="(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
|
||||
attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked by \the [M] controlled by [key_name(M.occupant)] (INTENT: [uppertext(M.occupant.a_intent)])</font>")
|
||||
M.occupant.attack_log += text("\[[time_stamp()]\] <font color='red'>Attacked [src] with \the [M] (INTENT: [uppertext(M.occupant.a_intent)])</font>")
|
||||
msg_admin_attack("[key_name_admin(M.occupant)] attacked [key_name_admin(src)] with \the [M] (INTENT: [uppertext(M.occupant.a_intent)])")
|
||||
|
||||
else
|
||||
|
||||
step_away(src,M)
|
||||
add_logs(M.occupant, src, "pushed", object=M, admin=0)
|
||||
M.occupant_message("<span class='warning'>You push [src] out of the way.</span>")
|
||||
visible_message("<span class='warning'>[M] pushes [src] out of the way.</span>")
|
||||
|
||||
return
|
||||
|
||||
//Mobs on Fire
|
||||
|
||||
@@ -196,8 +196,8 @@
|
||||
src << "\red <B>You plunge your probosci deep into the cortex of the host brain, interfacing directly with their nervous system.</B>"
|
||||
host << "\red <B>You feel a strange shifting sensation behind your eyes as an alien consciousness displaces yours.</B>"
|
||||
var/borer_key = src.key
|
||||
host.attack_log += text("\[[time_stamp()]\] <font color='blue'>[src.name] ([src.ckey]) has assumed control of [host.name] ([host.ckey])</font>")
|
||||
msg_admin_attack("[src.name] ([src.ckey]) has assumed control of [host.name] ([host.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[host.x];Y=[host.y];Z=[host.z]'>JMP</a>)")
|
||||
host.attack_log += text("\[[time_stamp()]\] <font color='blue'>[key_name(src)] has assumed control of [key_name(host)]</font>")
|
||||
msg_admin_attack("[key_name_admin(src)] has assumed control of [key_name_admin(host)]")
|
||||
// host -> brain
|
||||
var/h2b_id = host.computer_id
|
||||
var/h2b_ip= host.lastKnownIP
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
|
||||
if(ckey in deadmins)
|
||||
verbs += /client/proc/readmin
|
||||
|
||||
//Clear ability list and update from mob.
|
||||
client.verbs -= ability_verbs
|
||||
|
||||
@@ -57,27 +60,3 @@
|
||||
client.verbs |= H.species.abilities
|
||||
|
||||
CallHook("Login", list("client" = src.client, "mob" = src))
|
||||
|
||||
//Update morgues on login/logout
|
||||
if (stat == DEAD)
|
||||
var/obj/structure/morgue/Morgue = null
|
||||
var/mob/living/carbon/human/C = null
|
||||
if (istype(src,/mob/dead/observer)) //We're a ghost, let's find our corpse
|
||||
var/mob/dead/observer/G = src
|
||||
if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
|
||||
return
|
||||
if (G.can_reenter_corpse && G.mind.current)
|
||||
C = G.mind.current
|
||||
else if (istype(src,/mob/living/carbon/human))
|
||||
C = src
|
||||
|
||||
if (C) //We found our corpse, is it inside a morgue?
|
||||
if (istype(C.loc,/obj/structure/morgue))
|
||||
Morgue = C.loc
|
||||
else if (istype(C.loc,/obj/structure/closet/body_bag))
|
||||
var/obj/structure/closet/body_bag/B = C.loc
|
||||
if (istype(B.loc,/obj/structure/morgue))
|
||||
Morgue = B.loc
|
||||
if (Morgue)
|
||||
Morgue.update()
|
||||
|
||||
|
||||
@@ -10,28 +10,7 @@
|
||||
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
|
||||
send2adminirc("[key_name(src)] logged out - no more admins online.")
|
||||
..()
|
||||
|
||||
//Update morgues on login/logout
|
||||
if (stat == DEAD)
|
||||
var/obj/structure/morgue/Morgue = null
|
||||
var/mob/living/carbon/human/C = null
|
||||
if (istype(src,/mob/dead/observer)) //We're a ghost, let's find our corpse
|
||||
var/mob/dead/observer/G = src
|
||||
if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
|
||||
return 1
|
||||
if (G.can_reenter_corpse && G.mind.current)
|
||||
C = G.mind.current
|
||||
else if (istype(src,/mob/living/carbon/human))
|
||||
C = src
|
||||
|
||||
if (C) //We found our corpse, is it inside a morgue?
|
||||
if (istype(C.loc,/obj/structure/morgue))
|
||||
Morgue = C.loc
|
||||
else if (istype(C.loc,/obj/structure/closet/body_bag))
|
||||
var/obj/structure/closet/body_bag/B = C.loc
|
||||
if (istype(B.loc,/obj/structure/morgue))
|
||||
Morgue = B.loc
|
||||
if (Morgue)
|
||||
Morgue.update()
|
||||
|
||||
|
||||
CallHook("Logout", list("client" = src.client, "mob" = src))
|
||||
|
||||
return 1
|
||||
@@ -470,7 +470,7 @@ var/list/intents = list("help","disarm","grab","harm")
|
||||
name = realname
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && (M.client.holder.rights & R_MOD))) && (M.client.prefs.toggles & CHAT_DEAD))
|
||||
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || check_rights(R_MOD,0)) && (M.client.prefs.toggles & CHAT_DEAD))
|
||||
var/follow
|
||||
var/lname
|
||||
if(subject)
|
||||
@@ -481,7 +481,7 @@ var/list/intents = list("help","disarm","grab","harm")
|
||||
var/mob/dead/observer/DM
|
||||
if(istype(subject, /mob/dead/observer))
|
||||
DM = subject
|
||||
if(M.client.holder) // What admins see
|
||||
if(check_rights(R_MOD,0)) // What admins see
|
||||
lname = "[keyname][(DM && DM.anonsay) ? "*" : (DM ? "" : "^")] ([name])"
|
||||
else
|
||||
if(DM && DM.anonsay) // If the person is actually observer they have the option to be anonymous
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
CallHook("Login", list("client" = src.client, "mob" = src))
|
||||
|
||||
new_player_panel()
|
||||
if(ckey in deadmins)
|
||||
verbs += /client/proc/readmin
|
||||
spawn(40)
|
||||
if(client)
|
||||
handle_privacy_poll()
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
var/isadmin = 0
|
||||
if(src.client && src.client.holder)
|
||||
isadmin = 1
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")")
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
|
||||
query.Execute()
|
||||
var/newpoll = 0
|
||||
while(query.NextRow())
|
||||
@@ -178,7 +178,7 @@
|
||||
var/voted = 0
|
||||
|
||||
//First check if the person has not voted yet.
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM erro_privacy WHERE ckey='[src.ckey]'")
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]'")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
voted = 1
|
||||
@@ -203,7 +203,7 @@
|
||||
return
|
||||
|
||||
if(!voted)
|
||||
var/sql = "INSERT INTO erro_privacy VALUES (null, Now(), '[src.ckey]', '[option]')"
|
||||
var/sql = "INSERT INTO [format_table_name("privacy")] VALUES (null, Now(), '[src.ckey]', '[option]')"
|
||||
var/DBQuery/query_insert = dbcon.NewQuery(sql)
|
||||
query_insert.Execute()
|
||||
usr << "<b>Thank you for your vote!</b>"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
return
|
||||
var/voted = 0
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM erro_privacy WHERE ckey='[src.ckey]'")
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]'")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
voted = 1
|
||||
@@ -53,7 +53,7 @@
|
||||
if(src.client && src.client.holder)
|
||||
isadmin = 1
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
|
||||
select_query.Execute()
|
||||
|
||||
var/output = "<div align='center'><B>Player polls</B>"
|
||||
@@ -84,7 +84,7 @@
|
||||
establish_db_connection()
|
||||
if(dbcon.IsConnected())
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM erro_poll_question WHERE id = [pollid]")
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
|
||||
select_query.Execute()
|
||||
|
||||
var/pollstarttime = ""
|
||||
@@ -109,7 +109,7 @@
|
||||
switch(polltype)
|
||||
//Polls that have enumerated options
|
||||
if("OPTION")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
var/voted = 0
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
var/list/datum/polloption/options = list()
|
||||
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
options_query.Execute()
|
||||
while(options_query.NextRow())
|
||||
var/datum/polloption/PO = new()
|
||||
@@ -162,7 +162,7 @@
|
||||
|
||||
//Polls with a text input
|
||||
if("TEXT")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
var/voted = 0
|
||||
@@ -204,7 +204,7 @@
|
||||
|
||||
//Polls with a text input
|
||||
if("NUMVAL")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM erro_poll_option o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[usr.ckey]' AND o.id = v.optionid")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[usr.ckey]' AND o.id = v.optionid")
|
||||
voted_query.Execute()
|
||||
|
||||
var/output = "<div align='center'><B>Player poll</B>"
|
||||
@@ -230,7 +230,7 @@
|
||||
var/minid = 999999
|
||||
var/maxid = 0
|
||||
|
||||
var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM erro_poll_option WHERE pollid = [pollid]")
|
||||
var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
option_query.Execute()
|
||||
while(option_query.NextRow())
|
||||
var/optionid = text2num(option_query.item[1])
|
||||
@@ -273,7 +273,7 @@
|
||||
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if("MULTICHOICE")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
var/list/votedfor = list()
|
||||
@@ -286,7 +286,7 @@
|
||||
var/maxoptionid = 0
|
||||
var/minoptionid = 0
|
||||
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
options_query.Execute()
|
||||
while(options_query.NextRow())
|
||||
var/datum/polloption/PO = new()
|
||||
@@ -345,7 +345,7 @@
|
||||
establish_db_connection()
|
||||
if(dbcon.IsConnected())
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
select_query.Execute()
|
||||
|
||||
var/validpoll = 0
|
||||
@@ -363,7 +363,7 @@
|
||||
usr << "\red Poll is not valid."
|
||||
return
|
||||
|
||||
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM erro_poll_option WHERE id = [optionid] AND pollid = [pollid]")
|
||||
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
|
||||
select_query2.Execute()
|
||||
|
||||
var/validoption = 0
|
||||
@@ -378,7 +378,7 @@
|
||||
|
||||
var/alreadyvoted = 0
|
||||
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
while(voted_query.NextRow())
|
||||
@@ -399,7 +399,7 @@
|
||||
adminrank = usr.client.holder.rank
|
||||
|
||||
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
|
||||
insert_query.Execute()
|
||||
|
||||
usr << "\blue Vote successful."
|
||||
@@ -415,7 +415,7 @@
|
||||
establish_db_connection()
|
||||
if(dbcon.IsConnected())
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
select_query.Execute()
|
||||
|
||||
var/validpoll = 0
|
||||
@@ -432,7 +432,7 @@
|
||||
|
||||
var/alreadyvoted = 0
|
||||
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
while(voted_query.NextRow())
|
||||
@@ -457,7 +457,7 @@
|
||||
usr << "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again."
|
||||
return
|
||||
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
|
||||
insert_query.Execute()
|
||||
|
||||
usr << "\blue Feedback logging successful."
|
||||
@@ -473,7 +473,7 @@
|
||||
establish_db_connection()
|
||||
if(dbcon.IsConnected())
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
|
||||
select_query.Execute()
|
||||
|
||||
var/validpoll = 0
|
||||
@@ -488,7 +488,7 @@
|
||||
usr << "\red Poll is not valid."
|
||||
return
|
||||
|
||||
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM erro_poll_option WHERE id = [optionid] AND pollid = [pollid]")
|
||||
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
|
||||
select_query2.Execute()
|
||||
|
||||
var/validoption = 0
|
||||
@@ -503,7 +503,7 @@
|
||||
|
||||
var/alreadyvoted = 0
|
||||
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_vote WHERE optionid = [optionid] AND ckey = '[usr.ckey]'")
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[usr.ckey]'")
|
||||
voted_query.Execute()
|
||||
|
||||
while(voted_query.NextRow())
|
||||
@@ -519,7 +519,7 @@
|
||||
adminrank = usr.client.holder.rank
|
||||
|
||||
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
|
||||
insert_query.Execute()
|
||||
|
||||
usr << "\blue Vote successful."
|
||||
|
||||
Reference in New Issue
Block a user