Fixed runtime error with changeling gibbed by alium larva.

Added sanitize() to naming the buffers in DNA machine and to alien whispering.
Added 0.5 sec timeout for BANG BANG.
Added drinking glasses to the Dinnerware vending machine.
Update from Nikie:
Verb Reload Admins rereads admins.txt
Parameter sql_enabled in config. Prevents spam when sql is not installed.
NOTE FOR HOSTERS: it is currently ON in code (i.e. behavior is unchanged yet), you have to add SQL_ENABLED to your config.txt during next week. Thanks for your attention.
Fixed "Delay" command.
Messages for help intent are gender-aware now.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1463 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-04-17 18:09:30 +00:00
parent 57803fd4c2
commit ef23794506
25 changed files with 146 additions and 112 deletions

View File

@@ -12,6 +12,7 @@
var/log_game = 0 // log game events
var/log_vote = 0 // log voting
var/log_whisper = 0 // log client whisper
var/sql_enabled = 1 // for sql switching
var/allow_vote_restart = 0 // allow votes to restart
var/allow_vote_mode = 0 // allow votes to change mode
var/allow_admin_jump = 1 // allows admin jumping
@@ -97,6 +98,9 @@
if ("log_access")
config.log_access = 1
if ("sql_enabled")
config.sql_enabled = 1
if ("log_say")
config.log_say = 1

View File

@@ -468,9 +468,11 @@
icon_state = "term"
desc = "An underfloor wiring terminal for power equipment"
level = 1
layer = TURF_LAYER
var/obj/machinery/power/master = null
anchored = 1
directwired = 0 // must have a cable on same turf connecting to terminal
layer = 2.6 // a bit above wires
/obj/machinery/power/generator
name = "generator"

View File

@@ -150,8 +150,8 @@
name = "Dinnerware"
desc = "A kitchen and restaurant equipment vendor"
icon_state = "dinnerware"
product_paths = "/obj/item/weapon/tray;/obj/item/weapon/kitchen/utensil/fork;/obj/item/weapon/kitchenknife"
product_amounts = "6;4;2"
product_paths = "/obj/item/weapon/tray;/obj/item/weapon/kitchen/utensil/fork;/obj/item/weapon/kitchenknife;/obj/item/weapon/reagent_containers/food/drinks/drinkingglass"
product_amounts = "6;4;2;15"
//product_amounts = "8;5;4" Old totals
product_hidden = "/obj/item/weapon/kitchen/utensil/spoon;/obj/item/weapon/kitchen/utensil/knife;/obj/item/weapon/kitchen/rollingpin"
product_hideamt = "2;2;2"

View File

@@ -1085,13 +1085,13 @@
src.buffer3iue = null
dopage(src,"buffermenu")
if (href_list["b1label"])
src.buffer1label = input("New Label:","Edit Label","Infos here")
src.buffer1label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"buffermenu")
if (href_list["b2label"])
src.buffer2label = input("New Label:","Edit Label","Infos here")
src.buffer2label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"buffermenu")
if (href_list["b3label"])
src.buffer3label = input("New Label:","Edit Label","Infos here")
src.buffer3label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"buffermenu")
if (href_list["b1transfer"])
if (!src.connected.occupant)

View File

@@ -186,7 +186,7 @@
if(!changeling)
return 1
if(istype(changeling.current,/mob/living/silicon))
if(!istype(changeling.current,/mob/living/carbon))
return 1
if(changeling.current.stat==2)

View File

@@ -25,6 +25,9 @@ var/global/datum/controller/gameticker/ticker
world << "Please, setup your character and select ready. Game will start in [pregame_timeleft] seconds"
while(current_state == GAME_STATE_PREGAME)
if(!going)
sleep(10)
else
sleep(10)
pregame_timeleft--
@@ -102,8 +105,9 @@ var/global/datum/controller/gameticker/ticker
spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE
spawn master_controller.process()
spawn(3000) statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
if (config.sql_enabled)
spawn(3000)
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
/datum/controller/gameticker
proc/distribute_jobs()

View File

@@ -55,7 +55,7 @@
Current status: [ on ? "<A href='?src=\ref[src];start=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];start=1'>On</A>"]<BR>
Current gas temperature: [temp_text]<BR>
Current air pressure: [air_contents.return_pressure()]<BR>
Target gas temperature: <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A><BR>
Target gas temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
"}
user << browse(dat, "window=freezer;size=400x500")

View File

@@ -199,12 +199,16 @@
src.add_fingerprint(user)
return
/obj/closet
var/lastbang
/obj/closet/relaymove(mob/user as mob)
if (user.stat)
return
if (!src.open())
user << "\blue It won't budge!"
if (world.time > lastbang+5)
lastbang = world.time
for (var/mob/M in hearers(src, null))
M << text("<FONT size=[]>BANG, bang!</FONT>", max(0, 5 - get_dist(src, M)))

View File

@@ -16,6 +16,7 @@
new /obj/item/weapon/reagent_containers/dropper( src )
new /obj/item/weapon/reagent_containers/glass/beaker( src )
new /obj/item/weapon/reagent_containers/glass/beaker( src )
new /obj/item/weapon/storage/utilitybelt/medical( src )
return
/obj/secure_closet/medical2/New()

View File

@@ -197,6 +197,8 @@
user << "\red Access Denied"
return
/obj/secure_closet
var/lastbang
/obj/secure_closet/relaymove(mob/user as mob)
if (user.stat)
return
@@ -212,6 +214,8 @@
src.opened = 1
else
user << "\blue It's welded shut!"
if (world.time > lastbang+5)
lastbang = world.time
for(var/mob/M in hearers(src, null))
M << text("<FONT size=[]>BANG, bang!</FONT>", max(0, 5 - get_dist(src, M)))
return

View File

@@ -3,6 +3,7 @@ mob/verb/check_karma()
set category = "Special Verbs"
set desc = "Reports how much karma you have accrued"
if(config.sql_enabled)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
@@ -20,3 +21,5 @@ mob/verb/check_karma()
else
usr << "<b>Your current karma is:</b> 0<br>"
dbcon.Disconnect()
else
usr << "<b>SQL is off, karma is not usable<b>"

View File

@@ -1421,11 +1421,18 @@ var/showadminmessages = 1
//add <th>IP:</th> to this if wanting to add back in IP checking
//add <td>(IP: [M.lastKnownIP])</td> if you want to know their ip to the lists below
var/list/mobs = sortmobs()
var/DBConnection/dbcon = new()
var/show_karma = 0
var/DBConnection/dbcon
if(config.sql_enabled) // SQL is enabled in config.txt
dbcon = new() // Setting up connection
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
if(dbcon.IsConnected())
show_karma = 1
else
usr << "\red Unable to connect to karma database. This error can occur if your host has failed to set up an SQL database or improperly configured its login credentials.<br>"
if(!show_karma)
for(var/mob/M in mobs)
if(M.ckey)
dat += "<tr><td>[M.name]</td>"
@@ -1448,7 +1455,10 @@ var/showadminmessages = 1
<td align=center><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td>
<td align=center><A HREF='?src=\ref[src];traitor=\ref[M]'>[checktraitor(M) ? "<font color=red>" : "<font>"]Traitor?</font></A></td>
"}
dat += "<td><font color=red>NOT CONNECTED</font></td></tr>"
if (config.sql_enabled)
dat += "<td><font color=red>ERROR</font></td></tr>"
else
dat += "<td>disabled</td></tr>"
else
@@ -1893,7 +1903,7 @@ var/showadminmessages = 1
set category = "Server"
set desc="Delay the game start"
set name="Delay"
if (ticker)
if (!ticker || ticker.current_state != GAME_STATE_PREGAME)
return alert("Too late... The game has already started!", null, null, null, null, null)
going = !( going )
if (!( going ))

View File

@@ -73,6 +73,7 @@
src.verbs += /client/proc/air_report
src.verbs += /client/proc/air_status
src.verbs += /client/proc/radio_report
src.verbs += /client/proc/reload_admins
src.verbs += /client/proc/kill_air // -- TLE
src.verbs += /client/proc/modifytemperature
src.verbs += /client/proc/callproc
@@ -211,6 +212,7 @@
src.verbs += /client/proc/air_report
src.verbs += /client/proc/air_status
src.verbs += /client/proc/radio_report
src.verbs += /client/proc/reload_admins
//src.verbs += /client/proc/kill_air // -- TLE
src.verbs += /client/proc/modifytemperature
src.verbs += /client/proc/callproc

View File

@@ -146,3 +146,32 @@
output += "&nbsp;&nbsp;&nbsp;&nbsp;[device]<br>"
usr << browse(output,"window=radioreport")
reload_admins()
set name = "Reload Admins"
set category = "Debug"
if(!(usr.client.holder && usr.client.holder.level >= 6)) // protect and prevent
usr << "\red Not a good cop"
return
message_admins("[usr] manually reloaded admins.txt")
usr << "You reload admins.txt"
var/text = file2text("config/admins.txt")
if (!text)
diary << "Failed to reload config/admins.txt\n"
else
var/list/lines = dd_text2list(text, "\n")
for(var/line in lines)
if (!line)
continue
if (copytext(line, 1, 2) == ";")
continue
var/pos = findtext(line, " - ", 1, null)
if (pos)
var/m_key = copytext(line, 1, pos)
var/a_lev = copytext(line, pos + 3, length(line) + 1)
admins[m_key] = a_lev
diary << ("ADMIN: [m_key] = [a_lev]")

View File

@@ -96,7 +96,7 @@
return
if (!( ismob(M) ))
return
var/t = input("Message:", text("Private message to [M.key]")) as text
var/t = input("Message:", text("Private message to [M.key]")) as text|null
if(src.holder.rank != "Game Admin" && src.holder.rank != "Game Master")
t = strip_html(t,500)
if (!( t ))
@@ -376,7 +376,7 @@ TO DO: actually integrate random appearance and player preference save.
if(!src.authenticated || !src.holder)
src << "Only administrators may use this command."
return
var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "")
var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null
if(!input)
return
for(var/mob/living/silicon/ai/M in world)
@@ -436,7 +436,7 @@ TO DO: actually integrate random appearance and player preference save.
if(!src.authenticated || !src.holder)
src << "Only administrators may use this command."
return
var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "")
var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null
if(!input)
return
for (var/obj/machinery/computer/communications/C in machines)

View File

@@ -54,7 +54,7 @@ Doesn't work on other aliens/AI.*/
src << "\green You must be conscious to do this."
return
var/msg = input("Message:", "Alien Whisper") as text
var/msg = sanitize(input("Message:", "Alien Whisper") as text|null)
if (!msg)
return

View File

@@ -581,14 +581,7 @@
switch(M.a_intent)
if ("help")
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M.name] shakes [src] trying to wake it up!", ), 1)
src.help_shake_act(M)
else
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
return
@@ -629,15 +622,7 @@
if ("help")
if (src.health > 0)
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1)
src.help_shake_act(M)
else
if (M.health >= -75.0)
if (((M.head && M.head.flags & 4) || ((M.wear_mask && !( M.wear_mask.flags & 32 )) || ((src.head && src.head.flags & 4) || (src.wear_mask && !( src.wear_mask.flags & 32 ))))))

View File

@@ -348,14 +348,7 @@
switch(M.a_intent)
if ("help")
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M.name] shakes [src] trying to wake it up!", ), 1)
src.help_shake_act(M)
else
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
return
@@ -396,15 +389,7 @@
if ("help")
if (src.health > 0)
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1)
src.help_shake_act(M)
else
if (M.health >= -75.0)
if ((M.head && M.head.flags & 4) || (M.wear_mask && !( M.wear_mask.flags & 32 )) )

View File

@@ -107,3 +107,25 @@
else
src.hands.dir = SOUTH
return
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
if (src.health > 0)
var/t_him = "it"
if (src.gender == MALE)
t_him = "him"
else if (src.gender == FEMALE)
t_him = "her"
if (istype(src,/mob/living/carbon/human) && src:w_uniform)
var/mob/living/carbon/human/H = src
H.w_uniform.add_fingerprint(M)
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
M.visible_message( \
"\blue [M] shakes [src] trying to wake [t_him] up!", \
"\blue You shake [src] trying to wake [t_him] up!", \
)

View File

@@ -1408,13 +1408,7 @@
/mob/living/carbon/human/attack_paw(mob/M as mob)
..()
if (M.a_intent == "help")
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
for(var/mob/O in viewers(src, null))
O.show_message(text("\blue [M.name] shakes [] trying to wake him up!", src), 1)
src.help_shake_act(M)
else
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
return
@@ -1642,16 +1636,7 @@
if (M.a_intent == "help")
if (src.health > 0)
if (src.w_uniform)
src.w_uniform.add_fingerprint(M)
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1)
src.help_shake_act(M)
else
if (M.health >= -75.0)
if (((M.head && M.head.flags & 4) || ((M.wear_mask && !( M.wear_mask.flags & 32 )) || ((src.head && src.head.flags & 4) || (src.wear_mask && !( src.wear_mask.flags & 32 ))))))

View File

@@ -159,13 +159,7 @@
..()
if (M.a_intent == "help")
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
for(var/mob/O in viewers(src, null))
O.show_message("\blue [M.name] shakes [src.name] trying to wake him up!", 1)
src.help_shake_act(M)
else
if ((M.a_intent == "hurt" && !( istype(src.wear_mask, /obj/item/clothing/mask/muzzle) )))
if ((prob(75) && src.health > 0))
@@ -206,15 +200,7 @@
return
if (M.a_intent == "help")
src.sleeping = 0
src.resting = 0
if (src.paralysis >= 3) src.paralysis -= 3
if (src.stunned >= 3) src.stunned -= 3
if (src.weakened >= 3) src.weakened -= 3
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [] shakes [src.name] trying to wake him up!", M), 1)
src.help_shake_act(M)
else
if (M.a_intent == "hurt")
if ((prob(75) && src.health > 0))

View File

@@ -1510,7 +1510,7 @@
return
if (!( ismob(M) ))
return
var/t = input("Message:", text("Private message to [M.key]")) as text
var/t = input("Message:", text("Private message to [M.key]")) as text|null
if (!( t ))
return
if (!usr) return

View File

@@ -128,8 +128,10 @@ mob/new_player
else
stat("Game Mode:", "[master_mode]")
if(ticker.current_state == GAME_STATE_PREGAME)
if((ticker.current_state == GAME_STATE_PREGAME) && going)
stat("Time To Start:", ticker.pregame_timeleft)
if((ticker.current_state == GAME_STATE_PREGAME) && !going)
stat("Time To Start:", "DELAYED")
statpanel("Lobby")
if(client.statpanel=="Lobby" && ticker)

View File

@@ -361,6 +361,9 @@
has_electronics = 1
user << "You place the power control board inside the frame."
del(W)
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
user << "\red You cannot put the board inside, the frame is damaged."
return
else if (istype(W, /obj/item/weapon/weldingtool) && W:welding && opened && has_electronics==0 && !terminal)
if (W:get_fuel() < 3)
user << "\blue You need more welding fuel to complete this task."

View File

@@ -19,6 +19,9 @@ LOG_VOTE
# log client Whisper
LOG_WHISPER
# sql switching
# SQL_ENABLED
# probablities for game modes chosen in "secret" and "random" modes
#
# default probablity is 1, increase to make that mode more likely to be picked