ID:161148
 
I have it so that when a player logs in, it says "[src] has joined the game." However, my game displays that message three times. I have one client/New(), one mob/Login(), and can't for the life of me figure out where the extra 2 messages are coming from. I would've posted this in Code Problems, but I can't pinpoint the code.

EDIT: It has something to do with my savefiles:
client/New()
..()
if(banned.Find(src.key) || banned.Find(src.address))
del src
var/savefile/F = new("players/[src.key]/save.sav")
if(!isnull(F["save"]))
F["save"] >> src.mob
Changing the client's mob calls Login() for that mob. Is that what you're doing?
Hit ctrl+F, then search for "[src] has joined the game." in all the files. You should also only have one in client/New().

Edit: Like I said before, just remove it from mob/Login().
Would reordering my code fix it? Trying it now...

EDIT: Reordering got rid of one of them. Still got one extra, though...
In response to Seraphrevan
The game is doing exactly what it's supposed to. It's calling client/New(), attaching a mob via the ..() proc as it does, and then loading a save file and attaching it to a client. So what you've got is two Login calls, which is probably where your duplicate message is coming from.
In response to Devourer Of Souls
I tried putting the ..() under an else statement, and still got 2 messages. Also, if I take that line out completely, I still get an extra message.
In response to Seraphrevan
It might have something to do with the Login proc instead, then. Could I see it?
In response to Devourer Of Souls
mob/Login()
..()
world << "<b><i>[src] has joined the game.</i></b>"

That's it.
In response to Seraphrevan
Are you getting two login messages when a user loads a savefile?

Or is it both ways?
In response to A.T.H.K
If I delete the saves, it displays one message. When loading an existing file, it shows 2. Good question.
In response to Seraphrevan
Seraphrevan wrote:
If I delete the saves, it displays one message. When loading an existing file, it shows 2. Good question.

Problem solved :P now you just need to think of the best possible way of doing it.

In response to A.T.H.K
So what exactly is the savefile doing?
In response to Seraphrevan
Okay then. So the problem seems to be what I suspected. Really, though, you should be putting the log in message on client/New(), anyway, since that's when someone actually connects to the game world.
In response to Devourer Of Souls
Yeah, I just changed that. Thanks everybody.