Login Screen
UserLogin()
if(copytext(lowertext(key),1,7) == "telnet")
world.log << "(TELNET) [client.address] connected."
mb_msgout("\n[worldname]\nCoded by: ThunderZ\nLast Compile: [compiledate]")
login:
src.name=input("Name: ") as text
if(!name) del(src)
if(fexists("player_saves/[ckey(lowertext(name))]"))
world.log << "(TELNET) [client.address] - [name] FOUND"
var/savefile/F=new("player_saves/[ckey(lowertext(name))]")
var/CorrectPassword
F["Password"]>>CorrectPassword
F["key"]<<src.key
var/pass=input("Password: ") as password
if(pass==CorrectPassword)
NewMob(client, F)
else
mb_msgout("{YIncorrect password!{x")
del(src)
else
world.log << "(TELNET) [client.address] - [name] NOT FOUND"
if(Review_Name(name))
goto login
if(src.ConfirmName())
else
mb_msgout("{YPlease reconnect!{x")
del(src)
src.Password=input("\nEnter a password for your new character:\n") as password
if(src.PasswordCheck(Password))
mb_msgout("{YYour password must not start or end with a space nor can it be blank!{x")
del(src)
var/correctpass=input("\nConfirm your password please:\n") as password
if(correctpass==Password)
src.CharacterCreation()
else
mb_msgout("The two passwords did not match.")
del(src)
return .. ()
mob/Player Login()
mob
Player
Login()
Move(locate(last_x,last_y,last_z))
worldmobs += src
world.log << "(CHARACTER) [name] LOADED."
loggedIn = 1
//PROCEDURES//
if(Class == "Namekian") NamekRegeneration()
if(Class == "Saiyan") SSJTimer()
if(Class == "Human") KillSpiritBurstTimer()
if(Class == "Saiyan" || Class == "Human" || Class == "Namekian") KillKaiokenTimer()
if(Class == "Android") cansense = 0
UpdatePosition()
RegenStam()
CheckLinkDead()
StaminaDrain(src)
PrintEnergy()
Rest()
Sleep()
PrintTransformation(src)
Conscious()
Conscious2()
ResetCommands()
CheckFlight()
KillCombatTimer()
KillStunTimer()
Stunned()
LogPlayTime()
/////////////
ShowMap()
if(!invis && !linkdead) mb_msgout("{Y-->{x [ClassColor][name][Reset] entered [worldname]!", worldmobs)
if(linkdead)
mb_msgout("[name] reconnected.", oview(0))
linkdead = 0
mb_msgout(file2text("motd.txt"), src)
mb_msgout("\n{YPlaytime: [world.PlayTime(playtime)]{x", src)
mb_msgout("\n")
UpdatePrompt()
if(!Admin)
CheckLock()
Logout()
if(quit == 1)
if(!invis) mb_msgout("{Y-->{x [ClassColor][name][Reset] exited [worldname]!", worldmobs)
charging_ki = 0
InAction = 0
actionblocked = 0
stunned = 0
worldmobs -= src
loggedIn = 0
quit = 0
Save()
del(src)
else
mb_msgout("[name] went linkdead.", oview(0))
worldmobs -= src
linkdead = 1
Save()
NewMob proc
NewMob(client/c, F as file)
var/mob/NewMob
var/mob/Oldmob = c.mob
var/MobPath = text2path("/mob/Player/[lowertext(F["Class"])]")
NewMob = new MobPath
NewMob.Read(F)
NewMob.cansave = 1
c.mob = NewMob
del(Oldmob)
Problem description:
Once in awhile when a player logs in the client will swap with the player that just logged in..
Could anyone please take a look at my code and maybe see why this is happening?
When the player loads it'll load that reference and force any players currently connected with a 'key' matching that saved reference to load into that mob.
I recommend reading this post on the matter.