Added some SQL stuff from oldcode. Someone should look this over.

This commit is contained in:
SkyMarshal
2012-05-23 16:03:46 -07:00
parent 55aba72896
commit 7e92be62ae
11 changed files with 71 additions and 27 deletions

View File

@@ -22,6 +22,7 @@
list/datum/mind/modePlayer = new
list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist
list/protected_jobs = list() // Jobs that can't be tratiors because
list/logtraitors = list()
required_players = 1
required_enemies = 0
recommended_enemies = 0

View File

@@ -92,7 +92,7 @@
// if picking hosts works with this method, remove the method above
if(!first_host)
first_host = pick(first_hosts)
first_hosts.remove(first_host)
first_hosts.Remove(first_host)
M.enter_host(first_host.current)
forge_meme_objectives(meme, first_host)

View File

@@ -25,15 +25,13 @@
/datum/game_mode/rp_revolution/announce()
world << "<B>The current game mode is - Revolution RP!</B>"
// world << "<B>Some crewmembers are attempting to start a revolution!<BR>\nRevolutionaries - Kill the Captain, HoP, and HoS. Convert other crewmembers (excluding the Captain, HoP, HoS, and security officers) to your cause. Protect your leaders.<BR>\nPersonnel - Protect the Captain, HoP, and HoR. Kill the leaders of the revolution, and brainwash the other revolutionaries (by beating them in the head).</B>"
/datum/game_mode/rp_revolution/send_intercept()
var/intercepttext = "<FONT size = 3><B>Cent. Com. Update</B> Requested staus information:</FONT><HR>"
intercepttext += "<B> Cent. Com has recently been contacted by the following syndicate affiliated organisations in your area, please investigate any information you may have:</B>"
var/list/possible_modes = list()
possible_modes.Add("revolution", "wizard", "nuke", "traitor", "malf")
possible_modes -= "nuke"
possible_modes.Add("revolution", "wizard", "traitor", "malf")
var/number = pick(2, 3)
var/i = 0
for(i = 0, i < number, i++)

View File

@@ -78,6 +78,10 @@
/datum/game_mode/proc/forge_traitor_objectives(var/datum/mind/traitor)
var/datum/traitorinfo/info = new
info.ckey = traitor.key
info.starting_player_count = num_players()
info.starting_name = traitor.current.name
if(istype(traitor.current, /mob/living/silicon))
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
@@ -92,11 +96,16 @@
var/datum/objective/block/block_objective = new
block_objective.owner = traitor
traitor.objectives += block_objective
info.starting_occupation = "AI"
else
info.starting_occupation = (traitor.current:wear_id && traitor.current:wear_id:assignment ? traitor.current:wear_id:assignment : traitor.assigned_role)
for(var/datum/objective/o in SelectObjectives((istype(traitor.current:wear_id, /obj/item/weapon/card/id) ? traitor.current:wear_id:assignment : traitor.assigned_role), traitor))
o.owner = traitor
traitor.objectives += o
for(var/datum/objective/objective in traitor.objectives)
info.starting_objective += "[objective.explanation_text] "
logtraitors[traitor] = info
return
@@ -184,6 +193,15 @@
else
world << "<B>The [special_role_text] has failed!<B>"
//feedback_add_details("traitor_success","FAIL")
var/datum/traitorinfo/info = logtraitors[traitor]
if (info)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(dbcon.IsConnected())
var/DBQuery/query = dbcon.NewQuery("INSERT INTO `bay12`.`traitorlogs` (`CKey`, `Objective`, `Succeeded`, `Spawned`, `Occupation`, `PlayerCount`) VALUES ('[info.ckey]', [dbcon.Quote(info.starting_objective)], '[traitorwin]', '[dd_list2text(info.spawnlist, ";")]', '[info.starting_occupation]', '[info.starting_player_count]')")
query.Execute()
return 1

View File

@@ -0,0 +1,7 @@
/datum/traitorinfo
var/starting_objective = ""
var/starting_player_count = 0
var/starting_occupation = ""
var/starting_name = ""
var/ckey = ""
var/list/spawnlist = list()

View File

@@ -277,6 +277,7 @@ var/global/datum/controller/occupations/job_master
if(!equipped)
var/obj/item/clothing/glasses/G = H.glasses
G.prescription = 1
H.client.add_roundsjoined()
H.update_clothing()
return 1