vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Tue May 21, 2013 3:56 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Wed May 21, 2008 1:02 am 
Bytewise Operator

Joined: Sat Oct 27, 2007 5:17 am
Posts: 139
Still no luck finding the problem, but I did get an "object variable or with variable not set" error when quitting the game. This could be due to new additions not working, since I started adding more graphics and maps, but maybe it's related to the same problem I've been having. I got the error while running the exe, I've never gotten it while running the ide, so no idea where its going wrong. Any ideas?

Edit: still always has the body right, but all other variables after it (body is the first one received) are 0.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Thu May 29, 2008 5:20 pm 
Bytewise Operator

Joined: Sat Oct 27, 2007 5:17 am
Posts: 139
I've still been working on this day and night, and here's what I've come up with:

There were two bugs I had, and since I fixed them both I'm not sure which one was causing the charindex = 0, or even if the charindex = 0 is really fixed, since it could still pop up randomly. But at least in the last 3 days of testing, I haven't encountered the error.

The first error was with grhindex, which was working fine most of the time, but going crazy every once in awhile. This is undoubtedly because I switched to extended item descriptions like in plagued dead, and missed adding something. I figured that plagued dead uses the alternate rendering system for layers, so there must be some parts that are incompatible with my code (I use the default rendering) when rendering the graphics. I stopped using the udtobjdata grhindex required for extended item descriptions, and just sent grhindex the old way. I still use extended item descriptions client side from a binary file, only the grhindex gets sent the old way. This fixed the problem up.

Next up I had another problem, a packet problem, involving quests. I've been using a much larger version of the quest log window, which big detailed descriptions for quests (about half a page of text sometimes). Well if you happened to have 4 or more of the quests with long descriptions (some short description quests you could have more of) in your current quest list, the buffer would overflow and give you some weird errors (all stats would be equal to zero, including level and class, but only on client side.) This error would only occur when you log in, when the server sends the quest descriptions. I can only assume that these long strings were too much for the buffer when all being sent at once, because canceling any of the quests fixes it. Anyone else using long quest descriptions should look out for this as well, since it isn't really unique to my code. Solutions are to either limit number of active quests allowed to a small enough amount that it won't overflow, shorten descriptions, or if you don't want to sacrifice functionality you could store the descriptions in an encrypted file client side.

My question is how much can the buffer handle? There was technically nothing wrong with my packets, they were being sent correctly and unchanged from the original code with vbgore. Is there a maximum size the buffer can handle, or anything like that? Or is there, despite the apparent link to quest descriptions (which changing, solved the problem), something else wrong somewhere in my packets?


Edit: Charindex = 0 error STILL happens. Happened again twice when changing to the same large map with lots of npcs, the map it almost always happened on in the past.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Fri May 30, 2008 7:55 am 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
In SVO we have a problem with the /me packets. There was an error like this I had, but I just did a If CharIndex = 0 Then Exit Sub. Different errors still pop up in different places (E.g. map music / weather / version randomly changing)

The /me packets all seem to be send fine though, but it IS /me which causes it on ours.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Fri May 30, 2008 5:23 pm 
Bytewise Operator

Joined: Sat Oct 27, 2007 5:17 am
Posts: 139
Hmm, I'll take a look at that and see if its causing it for me as well. I haven't changed any of the code there though, what about you?

I did try adding if charindex = 0 then exit sub, but in my experience it leads to the server telling the client something happened with the charindex, and the client, not having the charindex at all, gets even more screwed up. When I had the exit sub in there, I was getting all kinds of other errors too, so that might explain those map/weather type errors your having. Anyway I'll take a look at /me and see if its causing my problem too. Good to know I'm not alone at least!

Note: does it also happen in SVO when you change to a map with a lot of NPC's, or does it just happen randomly?


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Sat May 31, 2008 1:10 am 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
It seems to happen randomly, but I'm pretty sure it's /me causing it for us, but I havn't touched the code for /me and it looks relatively right


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Tue Jul 01, 2008 1:43 am 
+7 Claymore of Slaying

Joined: Thu Dec 21, 2006 6:24 pm
Posts: 594
Location: Land made of long cloud. Wait no its Land of white clouds. Actually i think its New Zealand.
i use to have this issue but im not sure if i still have it. This happened to me wen i had a lot of summons and changing maps. I havent seen this problem for a long time. I reckon its a packet issue from your MakeChar sub on your server.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Thu Jul 03, 2008 2:24 pm 
Source Code Swashbuckler

Joined: Fri Nov 30, 2007 4:23 am
Posts: 38
The post was like one month ago, then i think it's already solved!
But... why not put this code on the part of code that teleport the user? The very first part:
Code:
If charindex = 0 then exit sub

Then if the char don't have charindex, he can't teleport, buf if it's a "bad sent" packet, if put this code on some critical places of the code? (the teleporting part):
Code:
Dim x as byte
x = 0
If charindex = 0 then
Do while x < 10 and charindex <> 0
'*put a counter here, to wait one second*
'*nothing here i think... i think this is a "bad sent" packet, then trying again maybe work? It will try 10 times*
x = x + 1
Loop
If charindex = 0 then exit sub


I don't tested it, and i think it will not work, and it's a little "cheap hack"... but.. maybe o.o'...
Sorry for the poor english!


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Sun Jul 06, 2008 3:11 am 
Bytewise Operator

Joined: Sat Oct 27, 2007 5:17 am
Posts: 139
That wouldn't work, it would just make the client ignore the fact that its missing information, and cause things to get much worse. Bugs and errors will seem to pop up randomly in different spots, ending in a crash anyway.

As for the attempt to find a new charindex...I don't think the code you put makes sense, but I think you meant to have it search for an empty charindex and just assign that one. Unfortunately, that would just mean the client and server have a different charindex for the same character, which would lead to massive problems and crashes.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Sun Jul 06, 2008 6:33 am 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
ok guys. what if charindex can be 0. Somewhere the server sets it up. perhaps this is happening with large numbers of npcs on a map? Look for anything fishy like 1 to lastchar and see if the server might actualy be sending charindex 0 but the client doesn't like it becuse the array is starting at 1.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Sun Jul 06, 2008 5:39 pm 
=^.^= Kitty =^.^=

Joined: Tue Sep 05, 2006 4:00 pm
Posts: 964
Location: Oregon
It may be that, Richard. My players get it on login, and the first map has probably 50 NPCs on it.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Mon Jul 07, 2008 1:24 am 
+7 Claymore of Slaying

Joined: Thu Dec 21, 2006 6:24 pm
Posts: 594
Location: Land made of long cloud. Wait no its Land of white clouds. Actually i think its New Zealand.
If Richard's theory is correct then an easy fix for it will be adding
Code:
If LastUser <= 0 then Exit Sub

at the start of every sub containing For X = 1 to LastUser on the server would fix the client rejecting CharIndex = 0 because the client would never receive it.

EDIT: Those getting object variable or with variable not set RTE is that your UserIndex is invaild. In other words it = 0 or the user is not completly logged in then disconnects. So just make an easy check to stop this crashing your server.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Mon Jul 07, 2008 2:21 pm 
=^.^= Kitty =^.^=

Joined: Tue Sep 05, 2006 4:00 pm
Posts: 964
Location: Oregon
Wouldn't it be an error in Server_NextOpenCharIndex()? It has to be that or Data_User_MakeChar(). My players get the error on character creation, granted the first map has around 50 NPCs on it plus the other players.


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Mon Jul 07, 2008 10:58 pm 
+7 Claymore of Slaying

Joined: Thu Dec 21, 2006 6:24 pm
Posts: 594
Location: Land made of long cloud. Wait no its Land of white clouds. Actually i think its New Zealand.
Does ur subs have a check for if the user is disconnecting?
Because after a new user is created the server sets
Code:
UserList(UserIndex).Flags.UserLogged = 0

You can have a double check just in case with UserList(UserIndex).Flags.Disconnecting


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Wed Jul 09, 2008 3:51 pm 
=^.^= Kitty =^.^=

Joined: Tue Sep 05, 2006 4:00 pm
Posts: 964
Location: Oregon
Anyone fix the bug?


Top
 Profile  
 
 Post subject: Re: Charindex = 0 Client crash
PostPosted: Wed Jun 24, 2009 7:05 pm 
=^.^= Kitty =^.^=

Joined: Tue Sep 05, 2006 4:00 pm
Posts: 964
Location: Oregon
I'm still having this bug over a year later.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group