Advertisement
Guest User

Untitled

a guest
Jul 20th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. mob/proc
  2. Save2()
  3. if(!src.inGame)
  4. return
  5. var/v, savefile/S=new("[savepath]/[src.Acc_Name].sav")
  6. S["Acc_Name"]<< Acc_Name
  7. S["Acc_Password"]<< Acc_Password
  8. S["last_x"] << x
  9. S["last_y"] << y
  10. S["last_z"] << z
  11. for(v in src.vars)
  12. if(!(v in global.SkipVars))
  13. S[v] << src.vars[v]
  14. Load2(username)
  15. if(fexists("[savepath]/[username].sav"))
  16. var/v, savefile/S=new("[savepath]/[username].sav")
  17. var/last_x
  18. var/last_y
  19. var/last_z
  20. S["last_x"] >> last_x
  21. S["last_y"] >> last_y
  22. S["last_z"] >> last_z
  23. S["Acc_Name"] >> Acc_Name
  24. S["Acc_Password"] >> Acc_Password
  25. for(v in src.vars)
  26. if(!(v in global.SkipVars))
  27. S[v] >> src.vars[v]
  28. for(var/obj/Item/Equipment/x in src.contents) //equip all previously equipped equipment
  29. if(x.equipped)
  30. x.equipped=FALSE //have to set this to false before equipping because it thinks it's still equipped
  31. x.Equip()
  32. 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
  33. src.step_size=8
  34. src.walktype="run"
  35. else
  36. src.step_size=4
  37. src.walktype=""
  38. src.icon_state=src.walktype
  39. src.client.Remove_Logo()
  40. src.loc = locate(last_x, last_y, last_z)
  41. src.self_AddHealthbar()
  42. src.Regeneration()
  43.  
  44. mob
  45. verb
  46. Login_Check()
  47. set hidden=1
  48. var/username = winget(src,"Login.usernameinput","text")
  49. var/a_password=winget(src,"Login.passwordinput","text")
  50. // src<<"Inputted Username: [username]"
  51. // src<<"Inputted Password: [a_password]"
  52. if(a_password=="BYOND_KEY"&&username!=src.ckey)
  53. Alert(src,"You are unable to access this account without the proper BYOND Key!",1,1)
  54. return
  55. if(!src.making_new_character)
  56. if(fexists("[savepath]/[username].sav"))
  57. var/correct_id=""
  58. var/savefile/F=new("[savepath]/[username].sav")
  59. F["Acc_Password"] >> correct_id
  60. if(correct_id==a_password)
  61. // src<<"Your passcode and the file passcode are a match!"
  62. // src<<"Loading [username] file with [a_password] as it's password"
  63. src.Load2(username)
  64. src.ShowOverlays()
  65. for(var/image/I in src.client.images)
  66. del(I)
  67. src.inGame=1
  68. src.client.LoadHuds()
  69. src.client.perspective=MOB_PERSPECTIVE
  70. src.client.eye=src
  71. winshow(src,"Login",0)
  72. else
  73. Alert(src,"You have inputted an incorrect password for this account!",1,1)
  74. else
  75. Alert(src,"We either cannot find that username in our registry, or the password is incorrect!",1,1)
  76. else
  77. src<<"You are making a new character"
  78. if(fexists("[savepath]/[username].sav"))
  79. Alert(src,"The chosen username( [username] ) is already in use! Please try again!",1,1)
  80. return
  81. else
  82. src.client.Remove_Logo()
  83. src.Acc_Name=username
  84. if(a_password=="BYOND_KEY")
  85. Alert(src,"Your password was changed to QWERTY to prevent abuse!",1,1)
  86. a_password="QWERTY"
  87. src.Acc_Password=a_password
  88. src.loc=locate(/turf/System_Turf/Creation/Creationspawn)
  89. winshow(src,"Login",0)
  90. src.client.perspective=MOB_PERSPECTIVE
  91. src.client.eye=src
  92. src.frozen=1
  93. src.making_new_character=0
  94. for(var/image/I in src.client.images)
  95. del(I)
  96.  
  97. mob/verb/Load_With_Key()
  98. set hidden=1
  99. if(fexists("[savepath]/[src.ckey].sav"))
  100. src.Load2(src.ckey)
  101. src.ShowOverlays()
  102. for(var/image/I in usr.client.images)
  103. del(I)
  104. src.inGame=1
  105. src.client.LoadHuds()
  106. src.client.perspective=MOB_PERSPECTIVE
  107. src.client.eye=src
  108. winshow(src,"Login",0)
  109. else
  110. Alert(src, "We cannot find an account registered with your key!",1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement