The actual creation process
//Start creating the artificial player by loading their data ~Xirre
var/mob/player/newP = new
src.assessingplayer = newP
fakeMobs += newP
newP.ckey = tmpCkey
if(fexists("saves/player/[newP.ckey].sav"))
var/savefile/S = new("saves/player/[newP.ckey].sav")
if("key" in S)
S["key"] >> newP.key
newP.LoadCharacter(newP.ckey)
The whole bits and pieces that are actually related.
//If it's not a real player then delete it. But, still set their variable to null. ~Xirre
if(src.assessingplayer && ismob(src.assessingplayer))
var/mob/player/p = src.assessingplayer
if(!p.client)
fakeMobs -= p
del(p)
src.assessingplayer = null
var/tmpCkey = copytext(log, 1, length(log) - 5)
var/found = 0
for(var/mob/player/_P in fakeMobs)
if(_P.ckey == tmpCkey)
found = 1
//I didn't want to put goto pick letter here because... well who the hell started using goto anyways?
//I'd prefer not to have any unexpectancies pop up from goto. especially in a for loop. ~Xirre
break
if(found)
goto pickletter
//Start creating the artificial player by loading their data ~Xirre
var/mob/player/newP = new
src.assessingplayer = newP
fakeMobs += newP
newP.ckey = tmpCkey
if(fexists("saves/player/[newP.ckey].sav"))
var/savefile/S = new("saves/player/[newP.ckey].sav")
if("key" in S)
S["key"] >> newP.key
newP.LoadCharacter(newP.ckey)
The goal? To create an offline player so it is able to be interacted with as if it were online. Of course, if they log on during this process, I'll delete the mob and all the relations it has to variables and then I'll let it continue doing whatever it was doing from wherever it left off.
I've got nothing to contribute, however, I like the idea.