Resolves Conflicts with 7137

This commit is contained in:
KasparoVy
2017-04-30 03:42:48 -04:00
638 changed files with 12738 additions and 10357 deletions
+218 -146
View File
@@ -8,7 +8,7 @@
#define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 10MB //Boosted this thing. What's the worst that can happen?
#define MIN_CLIENT_VERSION 0 //Just an ambiguously low version for now, I don't want to suddenly stop people playing.
//I would just like the code ready should it ever need to be used.
#define SUGGESTED_CLIENT_VERSION 510 // only integers (e.g: 510, 511) useful here. Does not properly handle minor versions (e.g: 510.58, 511.848)
#define SUGGESTED_CLIENT_VERSION 511 // only integers (e.g: 510, 511) useful here. Does not properly handle minor versions (e.g: 510.58, 511.848)
/*
When somebody clicks a link in game, this Topic is called first.
@@ -97,150 +97,154 @@
if(config && config.log_hrefs && href_logfile)
to_chat(href_logfile, "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>")
switch(href_list["karmashop"])
if("tab")
karma_tab = text2num(href_list["tab"])
karmashopmenu()
if(href_list["karmashop"])
if(config.disable_karma)
return
if("shop")
if(href_list["KarmaBuy"])
var/karma=verify_karma()
switch(href_list["KarmaBuy"])
if("1")
if(karma <5)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Barber?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Barber",5)
return
if("2")
if(karma <5)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Brig Physician?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Brig Physician",5)
return
if("3")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Nanotrasen Representative?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Nanotrasen Representative",30)
return
if("5")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Blueshield?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Blueshield",30)
return
if("6")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Mechanic?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Mechanic",30)
return
if("7")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Magistrate?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Magistrate",45)
return
if("9")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Security Pod Pilot?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Security Pod Pilot",30)
return
if(href_list["KarmaBuy2"])
var/karma=verify_karma()
switch(href_list["KarmaBuy2"])
if("1")
if(karma <15)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Machine People?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Machine",15)
return
if("2")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Kidan?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Kidan",30)
return
if("3")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Grey?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Grey",30)
return
if("4")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Vox?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Vox",45)
return
if("5")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Slime People?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Slime People",45)
return
if("6")
if(karma <100)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Plasmaman?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Plasmaman",100)
return
if("7")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Drask?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Drask",30)
return
if(href_list["KarmaRefund"])
var/type = href_list["KarmaRefundType"]
var/job = href_list["KarmaRefund"]
var/cost = href_list["KarmaRefundCost"]
karmarefund(type,job,cost)
switch(href_list["karmashop"])
if("tab")
karma_tab = text2num(href_list["tab"])
karmashopmenu()
return
if("shop")
if(href_list["KarmaBuy"])
var/karma=verify_karma()
switch(href_list["KarmaBuy"])
if("1")
if(karma <5)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Barber?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Barber",5)
return
if("2")
if(karma <5)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Brig Physician?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Brig Physician",5)
return
if("3")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Nanotrasen Representative?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Nanotrasen Representative",30)
return
if("5")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Blueshield?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Blueshield",30)
return
if("6")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Mechanic?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Mechanic",30)
return
if("7")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Magistrate?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Magistrate",45)
return
if("9")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Security Pod Pilot?", "Confirmation", "No", "Yes") != "Yes")
return
DB_job_unlock("Security Pod Pilot",30)
return
if(href_list["KarmaBuy2"])
var/karma=verify_karma()
switch(href_list["KarmaBuy2"])
if("1")
if(karma <15)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Machine People?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Machine",15)
return
if("2")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Kidan?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Kidan",30)
return
if("3")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Grey?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Grey",30)
return
if("4")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Vox?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Vox",45)
return
if("5")
if(karma <45)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Slime People?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Slime People",45)
return
if("6")
if(karma <100)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Plasmaman?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Plasmaman",100)
return
if("7")
if(karma <30)
to_chat(usr, "You do not have enough karma!")
return
else
if(alert("Are you sure you want to unlock Drask?", "Confirmation", "No", "Yes") != "Yes")
return
DB_species_unlock("Drask",30)
return
if(href_list["KarmaRefund"])
var/type = href_list["KarmaRefundType"]
var/job = href_list["KarmaRefund"]
var/cost = href_list["KarmaRefundCost"]
karmarefund(type,job,cost)
return
switch(href_list["_src_"])
if("holder") hsrc = holder
@@ -248,6 +252,73 @@
if("prefs") return prefs.process_link(usr,href_list)
if("vars") return view_var_Topic(href,href_list,hsrc)
//Polls and shit
if(href_list["showpoll"])
handle_player_polling()
return
if(href_list["createpollwindow"])
create_poll_window()
return
if(href_list["createpoll"])
create_poll_function(href_list)
return
if(href_list["pollid"])
var/pollid = href_list["pollid"]
if(istext(pollid))
pollid = text2num(pollid)
if(isnum(pollid))
poll_player(pollid)
return
if(href_list["pollresults"])
var/pollid = href_list["pollresults"]
if(istext(pollid))
pollid = text2num(pollid)
if(isnum(pollid))
poll_results(pollid)
if(href_list["votepollid"] && href_list["votetype"])
if(!can_vote())
return // No voting.
var/pollid = text2num(href_list["votepollid"])
var/votetype = href_list["votetype"]
switch(votetype)
if("OPTION")
var/optionid = text2num(href_list["voteoptionid"])
vote_on_poll(pollid, optionid)
if("TEXT")
var/replytext = href_list["replytext"]
log_text_poll_reply(pollid, replytext)
if("NUMVAL")
var/id_min = text2num(href_list["minid"])
var/id_max = text2num(href_list["maxid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
to_chat(usr, "The option ID difference is too big. Please contact administration or the database admin.")
return
for(var/optionid = id_min; optionid <= id_max; optionid++)
if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to
var/rating
if(href_list["o[optionid]"] == "abstain")
rating = null
else
rating = text2num(href_list["o[optionid]"])
if(!isnum(rating))
return
vote_on_numval_poll(pollid, optionid, rating)
if("MULTICHOICE")
var/id_min = text2num(href_list["minoptionid"])
var/id_max = text2num(href_list["maxoptionid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
to_chat(usr, "The option ID difference is too big. Please contact administration or the database admin.")
return
for(var/optionid = id_min; optionid <= id_max; optionid++)
if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected
vote_on_poll(pollid, optionid, 1)
src << browse(null, "window=playerpoll")
handle_player_polling()
switch(href_list["action"])
if("openLink")
@@ -326,7 +397,7 @@
preload_rsc = pick(config.resource_urls)
else preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
to_chat(src, "\red If the title screen is black, resources are still downloading. Please be patient until the title screen appears.")
to_chat(src, "<span class='warning'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
clients += src
@@ -348,7 +419,6 @@
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
. = ..() //calls mob.Login()
spawn() // Goonchat does some non-instant checks in start()
chatOutput.start()
@@ -376,6 +446,8 @@
log_client_to_db(tdata)
. = ..() //calls mob.Login()
if(ckey in clientmessages)
for(var/message in clientmessages[ckey])
to_chat(src, message)
@@ -446,7 +518,7 @@
var/DBQuery/query = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
query.Execute()
var/sql_id = 0
player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if their is a record.
player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if there is a record.
while(query.NextRow())
sql_id = query.item[1]
player_age = text2num(query.item[2])
@@ -118,6 +118,11 @@
path = /obj/item/clothing/head/beret/sci
allowed_roles = list("Research Director", "Scientist")
/datum/gear/hat/med_beret
display_name = "medical beret"
path = /obj/item/clothing/head/beret/med
allowed_roles = list("Chief Medical Officer", "Medical Doctor" , "Virologist", "Brig Physician")
/datum/gear/hat/surgicalcap_purple
display_name = "surgical cap, purple"
path = /obj/item/clothing/head/surgery/purple
@@ -50,7 +50,7 @@
/datum/gear/uniform/skirt/job/cmo
display_name = "skirt, cmo"
path = /obj/item/clothing/under/rank/chief_medical_officer
path = /obj/item/clothing/under/rank/chief_medical_officer/skirt
allowed_roles = list("Chief Medical Officer")
/datum/gear/uniform/skirt/job/chem
@@ -176,7 +176,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/job_karma_low = 0
//Keeps track of preferrence for not getting any wanted jobs
var/alternate_option = 0
var/alternate_option = 2
// maps each organ to either null(intact), "cyborg" or "amputated"
// will probably not be able to do this for head and torso ;)
@@ -795,7 +795,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
return
if(!isnum(desiredLvl))
to_chat(user, "\red UpdateJobPreference - desired level was not a number. Please notify coders!")
to_chat(user, "<span class='warning'>UpdateJobPreference - desired level was not a number. Please notify coders!</span>")
ShowChoices(user)
return
@@ -1630,7 +1630,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
continue
if(gender == FEMALE && SA.gender == MALE)
continue
if(species == "Machine") //Species that can use prosthetic heads.
if(istype(S) && S.flags & ALL_RPARTS) //Species that can use prosthetic heads.
var/head_model
if(!rlimb_data["head"]) //Handle situations where the head is default.
head_model = "Morpheus Cyberkinetics"