Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mob/proc
- Save2()
- if(!src.inGame)
- return
- var/v, savefile/S=new("[savepath]/[src.Acc_Name].sav")
- S["Acc_Name"]<< Acc_Name
- S["Acc_Password"]<< Acc_Password
- S["last_x"] << x
- S["last_y"] << y
- S["last_z"] << z
- for(v in src.vars)
- if(!(v in global.SkipVars))
- S[v] << src.vars[v]
- Load2(username)
- if(fexists("[savepath]/[username].sav"))
- var/v, savefile/S=new("[savepath]/[username].sav")
- var/last_x
- var/last_y
- var/last_z
- S["last_x"] >> last_x
- S["last_y"] >> last_y
- S["last_z"] >> last_z
- S["Acc_Name"] >> Acc_Name
- S["Acc_Password"] >> Acc_Password
- for(v in src.vars)
- if(!(v in global.SkipVars))
- S[v] >> src.vars[v]
- for(var/obj/Item/Equipment/x in src.contents) //equip all previously equipped equipment
- if(x.equipped)
- x.equipped=FALSE //have to set this to false before equipping because it thinks it's still equipped
- x.Equip()
- if(!src.walktype) //this is the best way I could do this for now, since step_size sets were moved out of the Move() proc -Dipic
- src.step_size=8
- src.walktype="run"
- else
- src.step_size=4
- src.walktype=""
- src.icon_state=src.walktype
- src.client.Remove_Logo()
- src.loc = locate(last_x, last_y, last_z)
- src.self_AddHealthbar()
- src.Regeneration()
- mob
- verb
- Login_Check()
- set hidden=1
- var/username = winget(src,"Login.usernameinput","text")
- var/a_password=winget(src,"Login.passwordinput","text")
- // src<<"Inputted Username: [username]"
- // src<<"Inputted Password: [a_password]"
- if(a_password=="BYOND_KEY"&&username!=src.ckey)
- Alert(src,"You are unable to access this account without the proper BYOND Key!",1,1)
- return
- if(!src.making_new_character)
- if(fexists("[savepath]/[username].sav"))
- var/correct_id=""
- var/savefile/F=new("[savepath]/[username].sav")
- F["Acc_Password"] >> correct_id
- if(correct_id==a_password)
- // src<<"Your passcode and the file passcode are a match!"
- // src<<"Loading [username] file with [a_password] as it's password"
- src.Load2(username)
- src.ShowOverlays()
- for(var/image/I in src.client.images)
- del(I)
- src.inGame=1
- src.client.LoadHuds()
- src.client.perspective=MOB_PERSPECTIVE
- src.client.eye=src
- winshow(src,"Login",0)
- else
- Alert(src,"You have inputted an incorrect password for this account!",1,1)
- else
- Alert(src,"We either cannot find that username in our registry, or the password is incorrect!",1,1)
- else
- src<<"You are making a new character"
- if(fexists("[savepath]/[username].sav"))
- Alert(src,"The chosen username( [username] ) is already in use! Please try again!",1,1)
- return
- else
- src.client.Remove_Logo()
- src.Acc_Name=username
- if(a_password=="BYOND_KEY")
- Alert(src,"Your password was changed to QWERTY to prevent abuse!",1,1)
- a_password="QWERTY"
- src.Acc_Password=a_password
- src.loc=locate(/turf/System_Turf/Creation/Creationspawn)
- winshow(src,"Login",0)
- src.client.perspective=MOB_PERSPECTIVE
- src.client.eye=src
- src.frozen=1
- src.making_new_character=0
- for(var/image/I in src.client.images)
- del(I)
- mob/verb/Load_With_Key()
- set hidden=1
- if(fexists("[savepath]/[src.ckey].sav"))
- src.Load2(src.ckey)
- src.ShowOverlays()
- for(var/image/I in usr.client.images)
- del(I)
- src.inGame=1
- src.client.LoadHuds()
- src.client.perspective=MOB_PERSPECTIVE
- src.client.eye=src
- winshow(src,"Login",0)
- else
- Alert(src, "We cannot find an account registered with your key!",1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement