ID:1858069
 
(See the best response by Lummox JR.)
Code:
Logout()
if(src.client&&src)
global.ONLINE.Remove(src)
if(src.regen.activated==1)src.regen.activated=0
src.savefile1=0
src.savefile2=0
src.savefile3=0
src.fakesave1=0
src.fakesave2=0
src.fakesave3=0
world<<"<B><center>SYSTEM: <i>[src] has logged out!</i>"
src.CloseWindows()
src.Save()
del(src)
..()


CloseWindows()
set hidden=1
if(src.client&&src)
if(InfoOpened)
usr.CloseInfo()
if(SkillsOpen)
usr.SkillsTab()
if(chatopen)
usr.OpenChat()
if(inventoryopen)
usr.Inventory()
winset(src, null, {"
MainChat.is-visible ="false"
Info.PlayerChild.is-visible ="false";
Info.ProChild.is-visible ="false";
Info.ProTab.is-checked ="false";
Main.is-visible ="false";
LoginWindow.is-visible ="false";
CharacterCreation.is-visible ="false";
Instructions.is-visible ="false";
"}
)


Problem description:
My issue is when I go to call logout from in game after the player has been loaded and things. everything but options and messages will close. Options and messages will confirm the connection has died, yet fails to close. Listed above is my logout codes there is one of the log outs up there that isnt indented correctly thats just a copy and paste error. If I call .quit from my interface using my exit button everything works properly.

Edit: I now only have that one logout code. It closes the connection, but fails to end the dreamseeker process.
Logout() is calling itself, when I think you meant to call ..() instead. (Ideally, you really shouldn't have multiple logout procs for players though.)
You can use this to run the .quit command:
winset(src, null, "command=.quit")
In response to Lummox JR
Sorry took me a minute to reply. Anyway, I at first did not have 2 logouts. I decided to use 2 in hopes of fixing this issue I have been having with it. Ideally I also as well would like to have only one logout, I have been having a lot of issues with dream seeker and my game. Most of the time to test it I have to use dream daemon for things to work correctly. I also tried your suggestion It didn't change anything. I have deleted the other logout now I will update my code.
In response to Chumble93
Can you show Closewindows() again? You probably don't need it.
In response to Kaiochao
Have updated with the closed window proc
In response to Chumble93
Can you try not calling it on Logout? You're hiding the default window, which is causing Options & Messages to pop up. Also use my previous suggestion.
In response to Kaiochao
Logout()
set hidden=1
if(src.client&&src)
global.ONLINE.Remove(src)
if(src.regen.activated==1)src.regen.activated=0
src.savefile1=0
src.savefile2=0
src.savefile3=0
src.fakesave1=0
src.fakesave2=0
src.fakesave3=0
world<<"<B><center>SYSTEM: <i>[src] has logged out!</i>"
//src.CloseWindows()
winset(src, null, "command=.quit")
src.Save()
..()


Did as suggested. Still same issue.
Now that you've edited your original post it's not as clear where the problem is. You need to combine these Logout() procs into one so that the order in which things execute is absolutely clear, because right now it's not--splitting it up was definitely not the way to go.
In response to Lummox JR
The new code, is both logout codes combined into one. The others were deemed UN-neccessary as you said. So now the only thing being called is close windows and save. The current Logout code is a normal mob/logout
You're no longer deleting the mob on logout, then.
In response to Lummox JR
That was my mistake, however I am deleting the mob in my code in the source. just forgot to put it here which I will now.
It's so weird. Even calling quit as Kai suggested, it doesn't work. However at the beginning before I switch mobs, it does. I have an idea, will post here in a second with results.
CreateCharacter()
set hidden=1
if(usr.client)
usr.loc=locate(0,0,0)
var/mob/player/M = new
M.savefile1=1
M.savefile2=0
M.savefile3=0
M.loc=locate(0,0,0)
usr.loc=locate(0,0,0)
M.gender = usr.gender
M.client=usr.client
M.name = null
M.AtLogin=0
M.LoginTimer=0
spawn(2)
var/NAME=input(M,"What name would you like?","Pick a Name")as text
if(NAME in PlayerNAMES)
alert("Name already chosen...")
NAME=null
M.CreateCharacter()
return
M.name=NAME
world<<"<B><center><i>[M] has logged in for the first time!"
PlayerNAMES+=M.name
global.SaveNames()
M.savefile1=1
winset(M, null, {"
LoginWindow.is-visible="false";
CharacterCreation.is-visible="true";
"}
)


I am pretty sure it has to do with the way I am switch the client from mob to mob/player
Best response
Oh sheesh, one glaring problem that I totally overlooked: src.client is null. This is Logout(), which is called after the client has departed.

(Also, if(src.client && src) in that order is really pointless; if src were somehow null, reading src.client would be an error. But src should never be null unless you've changed it deliberately)
Oh wow. lol