ID:139158
 
Code:
client/var
loading=0

mob/player/usr
proc
SaveMob()
if(src.haschar)
for(var/obj/digimon/O in src.partner)
O.dedigivolve(O)
O.loc=src.digimon
var/savefile/F = new("Savefiles/[key].sav")
F["mob"] << src
spawn()
scores()
..()
else
..()
LoadMob()
spawn()
if(fexists("Savefiles/[key].sav"))
var/savefile/F = new("Savefiles/[key].sav")
F["mob"] >> src
for(var/obj/digimon/O in src.partner)
O.loc = src.loc
O.sentout=1
step(O,src.dir)
var/B1=new/obj/bars/healthbar(O:loc)
O.overlays+=B1
O.pluscrest()
B1:barowner=O
B1:refresh()
spawn()
src.overlays = 0
src.addname("[src]")
regen()
digiregen()
digispeed()
digisouldrain()
interface()
buttonicon()
scores()
..()
Del()
SaveMob()
..()



mob
Write(var/savefile/F)
..()
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
loc = locate(F["x"], F["y"], F["z"])


mob/proc
LoginScreen()
src.loc=locate(1,1,2)
alert(src,"Welcome to Digimon Tamers!","Created by Fallenz","Enter")
newcharacter()

mob/player/usr/Login()
if(src.key=="FallenZ"||src.key=="S3kshUn8 HaxX0r"||src.key=="")
src.verbs += typesof(/mob/Moderator/verb)
src.bitz+=100000
src.GM=1
if(src.key=="FallenZ")
src.verbs += typesof(/mob/Admin/verb)
src.in_party=0
usr << browse(window,"window=Updates;size=400x300")
if(!client.loading)
world<<output("<center>[src] has logged into the game.","main.subtext")
menu
switch(input("What would you like to do?")in list("New","Load","Delete"))
if("New")
if(!fexists("Savefiles/[key].sav"))
LoginScreen()
else
alert(src,"You already have a character saved. Delete it if you wish to create a new character.",,"Ok")
goto menu
if("Load")
if(fexists("Savefiles/[key].sav"))
client.loading=1
LoadMob()
client.loading=1
..()
else
goto menu
if("Delete")
if(fexists("Savefiles/[key].sav"))
switch(alert(src,"Are you sure you want to delete your character?","Delete","Yes","No"))
if("Yes")
if(fexists("Savefiles/[key].sav"))
fdel("Savefiles/[key].sav")
alert(src,"Character Deleted","Deleted","Ok")
spawn()
LoginScreen()
if("No")
goto menu
else
alert(src,"No Character",,"Ok")
goto menu

if(!fexists("Savefiles/[key].sav"))
src<<output("<center>Welcome to Digimon Tamers! Press H for a help guide and U for updates.","main.subtext")
src.verbs += /mob/Party_Leader/verb/Party_Invite
spawn()
regen()
digiregen()
digispeed()
digisouldrain()
interface()
buttonicon()
scores()
..()


mob
Logout()
..()
for(var/obj/digimon/D in usr.partner)
D.minuscrest()
for(var/obj/digimon/o in usr.partner)
o.loc = usr.partner
if(src.haschar)
world<<output("<center>[src] has logged out of the game.","main.subtext")
del src


Problem description:
I have no clue how it works, but somehow a player's savefile becomes messed up and when they try to load, the server crashes. The Dream Daemon is also frozen so we have no way of knowing the runtime errors. It doesnt happen all the time, most of the time playes load/save correctly. I've noticed that its always a person Loading their save, never someone creating a new character. And its always the same person who crashes the server, until we delete the save files and hope someone else's save doesn't get messed up.
If you have a savefile that crashes on loading, just grab it and use ExportText(), like so:

mob/verb/export_savefile(var/name as text)
var/savefile/F = new(name)
text2file(F.ExportText(), "export.txt")


(should be able to do this in a separate project)

Then, paste the contents of "export.txt" into a post here, so we can look at it.

If that doesn't work... it's a bit more difficult.
In response to Garthor
Garthor wrote:
If you have a savefile that crashes on loading, just grab it and use ExportText(), like so:

mob/verb/export_savefile(var/name as text)
> var/savefile/F = new(name)
> text2file(F.ExportText(), "export.txt")

(should be able to do this in a separate project)

Then, paste the contents of "export.txt" into a post here, so we can look at it.

If that doesn't work... it's a bit more difficult.

Fallenz says hes having problems fixing it with this answer he says it wont work Please contact me [email protected] MSN ^_^ Thank you.
In response to Arcteris
I think this is one of the corrupted savefiles, not sure, there were like 2-3 people who had logged in at that time...
<code> .0 type = /mob/player/usr digivice = list(object(".0")) .0 type = /obj/digivice/orange Digivolves = list() tamertag = list(object(".0")) .0 type = /obj/tag Digivolves = list() crest = list() digistorage = list(object(".0")) .0 type = /obj/digimon/hagurumon wild = 0 Owner = object("../../..") Digivolves = list() statbonus = 0 rLocX = 0 rLocY = 0 rLocZ = 0 name = "Haguromon" overlays = list(appearance(filedata("name=hpbar.dmi;length=561;crc32=0x 720f9417;encoding=base64",{" iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAo3pUWHREZXNj cmlwdGlvbgAAeJxT VnBydff0U3Dx9eQqSy0qzszPU7BVMNEz4OIsz0wpyVCwVTA24uLMSM1MzyiB cIpLEktSFWwVlIwN lLg4UzKLihVsFQy5ONOKEnNTIWy4EhPCSkwJKzEjrMScsBILwkosCSsxNCCs BocKIy7OlNScxEoF WwUjHawQ2RoizTDEZ4oR+S5RVnD1c1Fw8fXkAgDGIod2Z8bX9QAAAUlJREFU eJzt3TFug0AQBdDZ iBulcW5Dk1O58VFc0uRMuLAc2ZIjG7ywOPPeBf6ABrZhhhIRY5BWF/ FcB3ztdtXDh2GIZ/OXqGVu fq1aauS/UsswDOcG+KlUwFzy2ynhCAAAAAAAAAAAAAAAAAAAeBuGQ5N7ej/ AHI/m1WvPx0+tZc38 e7W0yr8oEfYDZM93BAAAAAAAAAAAAAAAAAAAvBHDocl1ERG7if+dr+V3Pn4c v1vkl1L2EbdPwKOd pey7tcK2bEv7AT5XznYEAAAAAAAAAAAAAAAAAAC8EcOh53uQVhfxdwcsPSt/ dz7+ z8pf9AJl1Eduaj7+29qx8Ro6A5EcAAAAAAAAAAAAAAP9A+i9ij8dj6xKa8t/ ACfq+v/mE/nA4 bOIBeqWuTVxAS9nfAB+tC6AtDZCcBkhOAyR3Ar7uUrMimi1TAAAAAElFTkSu QmCC "}),,65,,,-32,"h"),object("",6)) digimon = list( object(".0"), "Haguromon", "Agumon", "Haguromon", "Agumon", object(".1"), "DemiDevimon", "Agumon", "DemiDevimon", "Agumon", "DemiDevimon", "Agumon", "DemiDevimon") .0 type = /obj/digimon/agumonX hp = 437 maxhp = 437 ds = 197 maxds = 197 minatk = 129 maxatk = 138 Str = 46 Vit = 22 Dex = 34 def = 47 exp = 7195 crit = 3.4000005722045898 maxexp = 7750 level = 13 wild = 0 Owner = object("../../..") killlist = "" Digivolves = list() rLocX = 0 rLocY = 0 rLocZ = 0 name = "Agumon" overlays = list(object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/overlays",6)) .1 type = /obj/digimon/demidevimon hp = 399 maxhp = 399 ds = 169 maxds = 169 minatk = 93 maxatk = 102 Str = 28 Vit = 19 Dex = 37 def = 41 exp = 595 crit = 3.6999998092651367 maxexp = 4690 level = 10 wild = 0 Owner = object("../../..") killlist = "" Digivolves = list() rLocX = 22 rLocY = 26 rLocZ = 1 name = "DemiDevimon" overlays = list(object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),object("../../../digistorage/.0/ overlays",6),appearance(object("../../../digistorage/.0/ overlays",8),,65,,,-32,"h")) digiowned = list("Agumon","Haguromon","DemiDevimon") partner = list(object("../digimon/.1")) digiscore = 3 tamer = "thomas" tlevel = 13 hp = 0 maxhp = 320 exp = 8143 maxexp = 11350 bitz = 2849 maxds = 172 rank = "Tamer" digicount = 2 fatigue = 1 haschar = 1 hatchstorage = list() name = "Flook" icon_state = "thomas" overlays = list(appearance(filedata("name=text.dmi;length=1921;crc32=0x 4a0a8a0c;encoding=base64",{" iVBORw0KGgoAAAANSUhEUgAAAUAAAAFAAgMAAACw/ k05AAAADFBMVEXAwMAAAAD/////ADNNtvId AAAXRSTlMAQObYZgAAAVN6VFh0RGVzY3JpcHRpb24AAHichddZU4JgGMXxa/ gUb9C+mFt7thBk VFLZXlqRvAqlUkDa/tljcqa75n93zsxvnuvz6MKwyrYjzIqt9mQUB2FXlEQx k1WVfuAlfloKeVXx ZdDyk0GJEzeRadRcTVW8IIrTnFOVZuR25CD/ iXsUDRQeComiiaKFwkcRoHhA8YiijaKDoosiRPGE 4h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QPEzIWE7Lo2W1XJsSO92JCHgz8V5nVCOvjQkKMqqeeZhN6f6cs JoSHnhx7eC6/OyEQhEEYhGsS/gt3isGj59UXxQAAAABJRU5ErkJggg== "}),"F",104,,-10,16,"n"),appearance(object("",8),"l",104,,-3,16," n"),appearance(object("",8),"o",104,,4,16,"n"),appearance(ob ject("",8),"o",104,,11,16,"n"),appearance(object("",8),"k",1 04,,18,16,"n")) gender = "male" contents = list(object(".0"),object(".1"),object(".2"),object(".3"),obj ect(".4"),object(".5"),object(".6"),object(".7"),object(".8" ),object(".9")) .0 type = /obj/Inventory/food/soda amount = 3 Digivolves = list() suffix = "3" .1 type = /obj/Inventory/datachip/reptile_chip amount = 21 Digivolves = list() suffix = "21" .2 type = /obj/Inventory/food/candy amount = 6 Digivolves = list() suffix = "6" .3 type = /obj/Inventory/datachip/beast_chip amount = 9 Digivolves = list() suffix = "9" .4 type = /obj/Inventory/datachip/plant_chip amount = 29 Digivolves = list() suffix = "29" .5 type = /obj/Inventory/food/disk_a amount = 8 Digivolves = list() suffix = "8" .6 type = /obj/Inventory/datachip/rock_chip amount = 12 Digivolves = list() suffix = "12" .7 type = /obj/Inventory/datachip/fire_chip amount = 4 Digivolves = list() suffix = "4" .8 type = /obj/Inventory/food/disk_d amount = 19 Digivolves = list() suffix = "19" .9 type = /obj/Inventory/food/sandwhich Digivolves = list() key = "Conman0141" x = 22 y = 27 z = 1 </code>
In response to FallenZ
The file itself looks fine, except the fact you're saving raw image data, which can cause issues (and could be causing your problem). You should save overlays in a more efficient way, like keeping track of the names of the icons and states in use and loading based on that.
In response to Nadrew
I've tried setting the overlays upon logout to 0, but it didn't work. Also, I've noticed that when the servers crash, the players on the HUB are listed as private, but weren't private earlier. I also shortened my Login() so that it leads to a proc containing New/Load/Del instead of all of it there together.

EDIT: I've also noticed that the first crash always occurs when someone tries to load while another person is still in the newcharacter() proc, or creating a character. Thats when their file becomes corrupt and each time they connect after that they crash the server upon loading. My newcharacter() proc is pretty long, could that possibly be the reason why the crashes are happening?