-Killed the updateDialog lag. I added a check to see if there were any mobs to update, if not it will stop checking until a user uses the machine again. I had to replace all the machine = src and machine = null with procs to help make it manageable. I believe this is one of the culprits causing the server to lag as the round goes on, as more players will interact with machines.

-Atmos delay is now based on active players, to help fight lag for massive player rounds.

-Changed some for(blah in world) loops to use the correct lists.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4958 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-10-25 19:15:51 +00:00
parent 2063c3715d
commit 6a2d78bc94
156 changed files with 403 additions and 367 deletions
@@ -509,7 +509,7 @@ In all, this is a lot like the monkey code. /N
/mob/living/carbon/alien/humanoid/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
@@ -451,7 +451,7 @@
/mob/living/carbon/alien/larva/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR><BR>
@@ -435,7 +435,7 @@
/mob/living/carbon/human/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
@@ -559,7 +559,7 @@
if (href_list["mach_close"])
var/t1 = text("window=[]", href_list["mach_close"])
machine = null
unset_machine()
src << browse(null, t1)
if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e
@@ -670,7 +670,7 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
/mob/living/carbon/metroid/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR><BR>
@@ -826,7 +826,8 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
/obj/item/weapon/reagent_containers/food/snacks/egg/roro/New()
..()
reagents.add_reagent("nutriment", 5)
reagents.add_reagent("nutriment", 4)
reagents.add_reagent("rorojelly", 1)
spawn(rand(1200,1500))//the egg takes a while to "ripen"
Grow()
@@ -93,7 +93,7 @@
..()
if (href_list["mach_close"])
var/t1 = text("window=[]", href_list["mach_close"])
machine = null
unset_machine()
src << browse(null, t1)
if ((href_list["item"] && !( usr.stat ) && !( usr.restrained() ) && in_range(src, usr) ))
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
+15 -4
View File
@@ -1,9 +1,16 @@
var/list/ai_list = list()
//Not sure why this is necessary...
/proc/AutoUpdateAI(obj/subject)
var/is_in_use = 0
if (subject!=null)
for(var/mob/living/silicon/ai/M in player_list)
for(var/A in ai_list)
var/mob/living/silicon/ai/M = A
if ((M.client && M.machine == subject))
world << "[M] - Using [subject]"
is_in_use = 1
subject.attack_ai(M)
return is_in_use
/mob/living/silicon/ai
@@ -105,10 +112,14 @@
src << "<b>These laws may be changed by other players, or by you being the traitor.</b>"
job = "AI"
ai_list += src
..()
return
/mob/living/silicon/ai/Del()
ai_list -= src
..()
/mob/living/silicon/ai/verb/pick_icon()
set category = "AI Commands"
@@ -302,7 +313,7 @@
if (href_list["mach_close"] == "aialerts")
viewalerts = 0
var/t1 = text("window=[]", href_list["mach_close"])
machine = null
unset_machine()
src << browse(null, t1)
if (href_list["switchcamera"])
switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras
@@ -531,7 +542,7 @@
/mob/living/silicon/ai/proc/ai_network_change()
set category = "AI Commands"
set name = "Jump To Network"
machine = null
unset_machine()
src.cameraFollow = null
var/cameralist[0]
@@ -1,4 +1,4 @@
#define UPDATE_BUFFER 20 // 2 seconds
#define UPDATE_BUFFER 25 // 2.5 seconds
// CAMERA CHUNK
//
@@ -116,8 +116,8 @@
user.cameraFollow = null
src.eye = user.eyeobj
//user.machine = null //Uncomment this if it causes problems.
user.lightNearbyCamera()
//user.unset_machine() //Uncomment this if it causes problems.
//user.lightNearbyCamera()
// Return to the Core.
@@ -133,7 +133,7 @@
current = null
cameraFollow = null
machine = null
unset_machine()
if(src.eyeobj && src.loc)
src.eyeobj.loc = src.loc
+1 -1
View File
@@ -8,7 +8,7 @@
if (src.stat!=0)
src.cameraFollow = null
src.reset_view(null)
src.machine = null
src.unset_machine()
src.updatehealth()
+4 -4
View File
@@ -216,14 +216,14 @@
/mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C)
usr:cameraFollow = null
if (!C)
src.machine = null
src.unset_machine()
src.reset_view(null)
return 0
if (stat == 2 || !C.status || C.network != src.network) return 0
// ok, we're alive, camera is good and in our network...
src.machine = src
src.set_machine(src)
src:current = C
src.reset_view(C)
return 1
@@ -233,7 +233,7 @@
set category = "pAI Commands"
set name = "Cancel Camera View"
src.reset_view(null)
src.machine = null
src.unset_machine()
src:cameraFollow = null
//Addition by Mord_Sith to define AI's network change ability
@@ -242,7 +242,7 @@
set category = "pAI Commands"
set name = "Change Camera Network"
src.reset_view(null)
src.machine = null
src.unset_machine()
src:cameraFollow = null
var/cameralist[0]
@@ -28,7 +28,7 @@
var/dat = ""
var/left_part = ""
var/right_part = softwareMenu()
src.machine = src
src.set_machine(src)
if(temp)
left_part = temp
@@ -839,7 +839,7 @@
..()
if (href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
machine = null
unset_machine()
src << browse(null, t1)
return
@@ -89,7 +89,7 @@
/mob/living/silicon/robot/proc/interact(mob/user)
if(wiresexposed && (!istype(user, /mob/living/silicon)))
user.machine = src
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
var/list/Borgwires = list(
"Orange" = 1,
@@ -116,7 +116,7 @@
/mob/living/silicon/robot/Topic(href, href_list)
..()
if (((in_range(src, usr) && istype(src.loc, /turf))) && !istype(usr, /mob/living/silicon))
usr.machine = src
usr.set_machine(src)
if (href_list["borgwires"])
var/t1 = text2num(href_list["borgwires"])
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
@@ -138,7 +138,7 @@
src.pulse(t1)
else if (href_list["close2"])
usr << browse(null, "window=borgwires")
usr.machine = null
usr.unset_machine()
return
#undef BORG_WIRE_LAWCHECK
@@ -26,7 +26,7 @@
regenerate_icons()
/mob/living/simple_animal/corgi/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
if(user.stat) return
var/dat = "<div align='center'><b>Inventory of [name]</b></div><p>"
@@ -110,7 +110,7 @@
* Inventory
*/
/mob/living/simple_animal/parrot/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
if(user.stat) return
var/dat = "<div align='center'><b>Inventory of [name]</b></div><p>"
+3 -3
View File
@@ -219,7 +219,7 @@ var/list/slot_equipment_priority = list( \
/mob/proc/show_inv(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
@@ -509,7 +509,7 @@ var/list/slot_equipment_priority = list( \
set name = "Cancel Camera View"
set category = "OOC"
reset_view(null)
machine = null
unset_machine()
if(istype(src, /mob/living))
if(src:cameraFollow)
src:cameraFollow = null
@@ -517,7 +517,7 @@ var/list/slot_equipment_priority = list( \
/mob/Topic(href, href_list)
if(href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
machine = null
unset_machine()
src << browse(null, t1)
// ..()
return
+1 -1
View File
@@ -317,7 +317,7 @@
usr.m_intent = "run"
usr.m_int = "13,14"
if("Reset Machine")
usr.machine = null
usr.unset_machine()
if("internal")
if (( !usr.stat && !usr.stunned && !usr.paralysis && !usr.restrained() ))
if (usr.internal)