Sometimes players on my games files corrupt.. I talked to a friend and he said it happened to him when he clicked load twice and it messed up because of lag, but I'm not sure if that's true.
What happens is they click load, and then it says they logged in but it brings them no where, and they can keep clicking load..
This has happened to me a number of times.. Any idea what might cause it? Thanks.
I think it may have something to do with failed connections.. any way to fix this?
ID:157814
Dec 28 2009, 12:59 pm (Edited on Dec 28 2009, 1:13 pm)
|
|
Dec 28 2009, 1:33 pm
|
|
It's likely an issue with how you are saving/loading, not something to do with the BYOND software.
|
In response to Garthor
|
|
mob That's my load, and my save is autosave... This is my auto save.. mob mob Can you find out what's wrong? |
In response to Xyphon101
|
|
You are calling Read() and Write() directly. This results in errors under certain not-uncommon circumstances. The proper way to save and load complex objects is by using the << and >> savefile operators. For an example, I'm sure just searching the forum for "author:Garthor save" will bring up a ton of them.
|
In response to Garthor
|
|
I searched through and now I have
mob mob Problem is when I click load it says "Xyphon101 has logged out" if I click it again it says "Connection died. Connection failed." |
In response to Xyphon101
|
|
It takes more than just a find-and-replace. First, you need to realize that Login() and Logout() ARE going to be called as a result, so anything you only want to have happen when a player connects or disconnects goes in client/New() and client/Del().
Next, you need to move the majority of those procs to mob/Write() and mob/Read(). Also, the proc will stop when you delete src, but everything after that should be in mob/Read() anyway (though other errors in it like usr abuse should be fixed). |
In response to Garthor
|
|
o_o.... yeah, I'm sorry.. But I'm not sure what exactly you are going on about. Don't link me to a dm guide or anything.. I don't even have a client/new or client/del defined anywhere.. And I don't get it.. Do you want me to put load and stuff in client/new and everything? If it calls logout when I am supposedly supposed to be fixing a problem, and in the end adding a mountain of problems there must be another way to do this.
EDIT and with mob/Read and mob/Write.. Uhh.. What procs go in where? |
In response to Xyphon101
|
|
The solution causes a problem because a whole lot of your game was built upon an incorrect way of doing things. If you don't like that it takes a lot of work to fix the problem, then be more careful to do things the right way the first time.
As for your complaint that you "don't even have a client/new or client/del defined anywhere", I'm struggling to understand why this is an issue (aside from your capitalization). If they're not defined, define them. |
In response to Garthor
|
|
My capitalization? Quoi? I didn't caps anything. Anyway, I still need to know, what do I put in read and write? I thought read was reading a save file.. But putting an entire load script in it? I don't get it.
|
In response to Xyphon101
|
|
Any processing that needs to occur in order to properly read from a savefile goes in Read(). And processing that needs to occur in order to properly write to a savefile goes in Write().
|
In response to Garthor
|
|
I have
Del() mob.Logout() New() mob.Login() under my client And for some reason, as soon as I go on, it destroys my connection.. |
In response to Xyphon101
|
|
First, you shouldn't be calling Login() like that. Second, your connection will be dropped if you don't have a mob, which is what happens when you override client/New() to prevent it from giving you one, as you have done. Third, you need to stop trying to make little tiny changes to fix what you have and instead do what I'm suggesting.
|
In response to Garthor
|
|
I'm TRYING to do what you've told me to, but you aren't even being remotely direct!
|