5165 whisper crashes

05/15/2010 17:19 alexhaes#1
Hello people,

I have been playing a few 5165 servers and used plenty of diferent clients.
What i have noticed is that when people whisper me or when i whisper people, mostly the client just shuts down.
I have been talking to allot of people about this but nobody seems to find any sollution to this, is there any way we can fix this ?
I know that allot of 5165 coders would love to know how to fix this.

Thanks for your time and sorry for my bad english :)
05/15/2010 17:52 MonstersAbroad#2
no server atually had that problem so I dont know whats your whipser code in PacketHandler.cs
?
05/15/2010 19:35 Arcо#3
Go in world.cs and tell us what the whisper code is in there.
05/16/2010 21:07 alexhaes#4
i have lookd there but its not my database and i dont code, if anyone can explain what code should be there and what i need to type in ctrl+f to find that code i would be verry happy :)

Thanks for your time and your reply :)
05/16/2010 23:09 pintser#5
This must be the (damaged) Chat.
although i highly doubt there can be something wrong with it..
Always nice to hear improvements :)


Code:
 public static void Chat(Character C, ushort Type, string From, string To, string Message)
        {
            try
            {
                if (Type == 2000 || Type == 2104)
                {
                    foreach (Character CC in H_Chars.Values)
                        if (C != CC && CC.Loc.Map == C.Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, CC.Loc.X, CC.Loc.Y, 13))
                        {
                            CC.MyClient.AddSend(Packets.ChatMessage(CC.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                        }
                }
                else if (Type == 2021)
                {
                    foreach (Character CC in H_Chars.Values)
                        if (C != CC)
                        CC.MyClient.AddSend(Packets.ChatMessage(CC.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                }
                else if (Type == 2001)
                {
                    Character C2 = CharacterFromName(To);
                    if (C2 != null)
                    {
                        C.MyClient.AddSend(Packets.ChatMessage(C2.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                        C2.MyClient.AddSend(Packets.ChatMessage(C2.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                        if (C2 != null)
                            C.MyClient.AddSend(Packets.SpawnViewed(C2, 2));
                    }
                    else
                    {
                        C.MyClient.LocalMessage(2000, "Character " + To + " is not online or doesn't exist.");
                    }
                }
                else if (Type == 2009)//Friend
                {
                    foreach (Friend F in C.Friends.Values)
                        if (F.Online)
                        {
                            F.Info.MyClient.AddSend(Packets.ChatMessage(C.MyClient.MessageID, From, To, Message, Type, 0));
                        }
                }
                else if (Type == 2004)//Guild
                {
                    if (C.MyGuild != null)
                        C.MyGuild.GuildMsg(Packets.ChatMessage(C.MyClient.MessageID, From, To, Message, Type, 0), C.EntityID);
                }
                else if (Type == 2003)
                    if (C.MyTeam != null)
                        C.MyTeam.Message(C, Packets.ChatMessage(C.MyClient.MessageID, From, To, Message, Type, 0x7d3));

            }
            catch { }
        }
05/18/2010 00:38 alexhaes#6
If i find out what the problem is i will leave you an message about how to fix this :)
05/26/2010 03:26 dragon89928#7
I was looking into this as well. It's not limited to whisper. I've been testing it out and I'm not quite sure what's causing it but I found that spamming or message send intervals is what's causing it. As for the fix I'm not too sure. Might be the packets or something which is odd since everything works until you spam stuff.

Also, I noticed that when you say commands in whisper the command repeats twice. For example, you say /item blah blah blah, 2 of those items will be made. I've been trying to fix this for a while now and got no where.
05/26/2010 17:18 pintser#8
@dragon
not when i do it?

if i do /tem blablah, jyust get it 1 time..
thats maybe youre source :p

thanks for tsting it :)
05/27/2010 11:43 Korvacs#9
Well this should be more like this for starters:

Code:
                    if (C2 != null)
                    {
                        C.MyClient.AddSend(Packets.ChatMessage(C.MyClient.MessageID, From, To, Message, Type, C2.Mesh));
                        C2.MyClient.AddSend(Packets.ChatMessage(C2.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                        C.MyClient.AddSend(Packets.SpawnViewed(C2, 2));
                    }
05/27/2010 16:06 .Summer#10
If you are changing anything in caht and you dont know what ur doing, stop doing it.
as you will have problems.
I never had any problems with whispers, so I dont know what you are doing wrong into it.
05/27/2010 23:17 dragon89928#11
@Pinster
okay. this is really weird. Now when I make items it make it twice >.>. I'll double check my source again.

@Summer
I study the code before I change anything + I also have some backups in case i mess anything up. Anyway, its really odd that you don't get that error x.x I'll do more tests to see what really causes it.
05/29/2010 19:15 .Summer#12
Quote:
Originally Posted by dragon89928 View Post
@Pinster
okay. this is really weird. Now when I make items it make it twice >.>. I'll double check my source again.

@Summer
I study the code before I change anything + I also have some backups in case i mess anything up. Anyway, its really odd that you don't get that error x.x I'll do more tests to see what really causes it.
is because im cool, but I dont use the same chat code, maybe thats why :D
05/30/2010 18:54 dragon89928#13
Hah. That would probably explain why you aren't glitching. Anyway.. I found that in the whisper, particularly where it says
Code:
if (C2 != null)
                    {
                        C.MyClient.AddSend(Packets.ChatMessage(C.MyClient.MessageID, From, To, Message, Type, C2.Mesh));
                        C2.MyClient.AddSend(Packets.ChatMessage(C2.MyClient.MessageID, From, To, Message, Type, C.Mesh));
                        [COLOR="Red"][B]C.MyClient.AddSend(Packets.SpawnViewed(C2, 2));[/B][/COLOR]
                    }
didn't make sense to me. I just removed it, it solved the "blinking super weapon" when you whisper problem.

And I think for some reason the problem went away >.> I can't make the client crash anymore.