Page 1 of 1

SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 9:13 pm
by sooid
Using the latest revision, IPacketLib.SendCharacterOverview crashes my client when I create a disabled race. The message I get is "An error has occured and you were unable to connect.". Can anyone else confirm this or help out? Tried it with several clients so it's probably not a client-side issue.

sooid

Re: SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 9:44 pm
by Tolakram
What does the server do when you try and create a disabled race or class? It should just return to the character page ... but this thing is the client doesn't really support disabled races or classes and expects the character creation to always succeed. Not sure there is anything worthwhile that can or should be done.

Re: SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 10:19 pm
by sooid
What does the server do when you try and create a disabled race or class? It should just return to the character page ...
Of course it should but it simply doesn't.
Here's what the log says:
Code: Select all
22:55:29,784 - [9] - DEBUG - DOL.GS.PacketHandler.Client.v168.CharacterCreateRequestHandler - CharacterCreateRequestHandler for account player-S using version Version1103
22:55:29,811 - [9] - DEBUG - DOL.GS.PacketHandler.Client.v168.CharacterCreateRequestHandler - Disable Config Button
22:55:29,814 - [9] - DEBUG - DOL.GS.PacketHandler.Client.v168.CharacterCreateRequestHandler - Creation Version1103 character, class:8, realm:1
22:55:29,821 - [9] - DEBUG - DOL.GS.PacketHandler.Client.v168.CharacterCreateRequestHandler - Client player tried to create a disabled race: Avalonian
22:55:29,830 - [9] - INFO - DOL.GS.GameClient - (127.0.0.1:54264) player just disconnected!
Would be surprised to see that it's just me as this is the latest revision and I didn't change anything.

Re: SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 10:35 pm
by Tolakram
I don't see the crash.

Re: SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 11:03 pm
by sooid
I'm kinda confused now. The client crashes, the server obviously doesn't. It just disconnects and says "An error has occured and you were unable to connect.".

Re: SendCharacterOverview crashes client

PostPosted: Tue Apr 05, 2011 11:20 pm
by geshi
This has been a problem for at least 2 months now, making a disabled race/class just crashes the client.

Re: SendCharacterOverview crashes client

PostPosted: Thu Apr 07, 2011 6:40 pm
by sooid
Been able to track it down to the packet processor, int sent = client.Socket.EndSend(ar); throws an ObjectDisposedException. But that's about as far as I got, no idea where to go from here.

Re: SendCharacterOverview crashes client

PostPosted: Sat Apr 09, 2011 5:04 am
by Dunnerholl
try using the logger tool and check what is sent to client after trying to create this illegal combination, then compare this packet thats causing the crash to one where everything is fine.

Re: SendCharacterOverview crashes client

PostPosted: Sat Apr 09, 2011 12:13 pm
by sooid
I did that and it might be in 0x10 CharacterSelectRequest. While the crashing client receives FF -> AC -> 10 and then A3s without any replies (disconnect), the normal client receives FF -> AC -> 10 -> FD and so on. So maybe the client tries to select a character that was not created. But again, I don't know where to go from here or what to do as I never dealt with packets.

Re: SendCharacterOverview crashes client

PostPosted: Sat Apr 09, 2011 1:29 pm
by Tolakram
if (occurences > 0 && (ePrivLevel)client.Account.PrivLevel == ePrivLevel.Player)
{
log.Debug("Client " + client.Account.Name + " tried to create a disabled race: " + (eRace)ch.Race);
client.Out.SendCharacterOverview((eRealm)ch.Realm);
return;
}


In CharacterCreateRequestHandler remove the line above in red and try it.

Re: SendCharacterOverview crashes client

PostPosted: Sat Apr 09, 2011 3:03 pm
by sooid
Tried that before and it didn't change anything.

Re: SendCharacterOverview crashes client

PostPosted: Sat Apr 09, 2011 4:06 pm
by Tolakram
Then I am guessing it has to do with the new character support they added with 1.100 or sometime around then. It can;t handle the fact that a character creation failed so the client crashes.

The last thing I would do is log what happens when you go to create a character and then cancel creation on the client. This is what we want to simulate when a disabled char is created.

Re: SendCharacterOverview crashes client

PostPosted: Tue Nov 22, 2011 2:06 am
by Snooops
Well at this moment the code sucks ;) but im new to C# and dont know yet how i can get data from the mysql database with that objects (omg so maaaaany objects :P)
But i dont wanted to have the minotaurs so i removed the block for them :P

Later i will post the change with doing this dynamic via mysql

File: GameServer\packets\Client\168\CharacterCreateRequestHandler.cs - Line ~500
Code: Select all

// change by snooops - to avoid client crashes with serverproperty disabled_races and disabled_classes
// TODO: get the values from the table - serverproperty
if (ch.Race != 20 && ch.Race != 19 && ch.Race != 21)
{
//Save the character in the database
GameServer.Database.AddObject(ch);
//Fire the character creation event
GameEventMgr.Notify(DatabaseEvent.CharacterCreated, null, new CharacterEventArgs(ch, client));
//add equipment
StartupEquipment.AddEquipment(ch);
//write changes
GameServer.Database.SaveObject(ch);
}

greetings
Snooops