Fix for multiple logging in at one time

04/06/2010 08:44 Arcо#1
Well some of you have noticed a bug that you can log onto one account multiple times simultaneously. Here's the fix.
Go to gameworker.cs and find.
Code:
if (Game.World.H_Chars.Contains(GC.MyChar.EntityID))
                                    {
                                        Game.Character Old = (Game.Character)Game.World.H_Chars[GC.MyChar.EntityID];
                                        Old.MyClient.Disconnect();
                                        if (!Game.World.H_Chars.Contains(GC.MyChar.EntityID))
                                            Game.World.H_Chars.Add(GC.MyChar.EntityID, GC.MyChar);
                                        GC.MyChar = Database.LoadCharacter(GC.AuthInfo.Character, ref Acc);
                                        GC.MyChar.MyClient = GC;
                                        GC.AddSend(Packets.SystemMessage(GC.MessageID, "ANSWER_OK"));
                                        GC.AddSend(Packets.CharacterInfo(GC.MyChar));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.VIPLevel, GC.MyChar.VipLevel));
                                        GC.AddSend(Packets.Time());
                                        GC.AddSend(Packets.Donators(GC.MyChar));
                                        GC.AddSend(Packets.Packet1012(GC.MyChar.EntityID));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.Effect, 0));
                                    }
                                    else
                                    {
                                        GC.AddSend(Packets.SystemMessage(GC.MessageID, "ANSWER_OK"));
                                        GC.AddSend(Packets.CharacterInfo(GC.MyChar));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.VIPLevel, GC.MyChar.VipLevel));
                                        GC.AddSend(Packets.Time());
                                        GC.AddSend(Packets.Donators(GC.MyChar));
                                        GC.AddSend(Packets.Packet1012(GC.MyChar.EntityID));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.Effect, 0));
                                    }
and replace that with
Code:
if (!Game.World.H_Chars.Contains(GC.MyChar.EntityID))
                                    {
                                        
                                        Game.World.H_Chars.Add(GC.MyChar.EntityID, GC.MyChar);
                                        GC.AddSend(Packets.SystemMessage(GC.MessageID, "ANSWER_OK"));
                                        GC.AddSend(Packets.CharacterInfo(GC.MyChar));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.VIPLevel, GC.MyChar.VipLevel));
                                        GC.AddSend(Packets.Time());
                                        GC.AddSend(Packets.Donators(GC.MyChar));
                                        GC.AddSend(Packets.Packet1012(GC.MyChar.EntityID));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.Effect, 0));
                                    }
                                    else
                                    {
                                        return;
                                    }
Done.
04/06/2010 08:52 -NewDawn-#2
Awesome Arco! I never tried it. Lol, nice debugging =P
04/06/2010 08:56 PeTe Ninja#3
lol if u put this fix in ur server.. it never worked.. iloged over 5 accounst at once :D
04/06/2010 08:57 Arcо#4
Quote:
Originally Posted by PeTe Ninja View Post
lol if u put this fix in ur server.. it never worked.. iloged over 5 accounst at once :D
I barely put this fix in this morning -,-
04/06/2010 08:58 PeTe Ninja#5
Quote:
Originally Posted by .Arco View Post
I barely put this fix in this morning -,-
ahh okay good was ognna say :D
04/06/2010 09:09 Paralyzer[GM]#6
Isnt this the way to stop the duplin the cps and items because they cannot login more the once?

if it is the fix for the duplin then Justin gave this to you and you where told not to release it :P
04/06/2010 09:11 Arcо#7
Quote:
Originally Posted by Paralyzer[GM] View Post
Isnt this the way to stop the duplin the cps and items because they cannot login more the once?

if it is the fix for the duplin then Justin gave this to you and you where told not to release it :P
Yes this is that fix, and justin's fix didn't work for me. I recoded it and it worked perfectly. I suggest you take a look at korvacs signature kthx.

edit:
Actually it was nullable who was the one who helped me in the end.
So much credits to nullable as well as me.
04/06/2010 09:33 Paralyzer[GM]#8
That's odd, according to Justin he fixed it all for you.
04/06/2010 09:35 Arcо#9
Quote:
Originally Posted by Paralyzer[GM] View Post
That's odd, according to Justin he fixed it all for you.
Justin thought he did, as did i, but once he logged off msn I had problems which walter tried to help then null helped me.
Null was succesful.
Like I said, korvacs sig...
04/06/2010 09:40 Paralyzer[GM]#10
Why do you keep saying look at korv sig I know full well what I am talking about but I did not know the full story however I know what I am talking about :P

Thanks, Goodluck I am using Justins.
04/06/2010 10:04 -NewDawn-#11
It works for me. It doesn't let the second client connect to the same character: it gets stuck on "Logging into the game server"... so thanks Arco =P
04/06/2010 10:09 Arcо#12
Quote:
Originally Posted by -NewDawn- View Post
It works for me. It doesn't let the second client connect to the same character: it gets stuck on "Logging into the game server"... so thanks Arco =P
No problem, glad I could help someone. And should give nullable a lil thanks to ;)
04/06/2010 20:30 [GM]#13
[Only registered and activated users can see links. Click Here To Register...]
04/06/2010 21:14 -impulse-#14
Quote:
Originally Posted by .Arco View Post
TEXT

and replace that with
Code:
if (!Game.World.H_Chars.Contains(GC.MyChar.EntityID))
                                    {
                                        
                                        Game.World.H_Chars.Add(GC.MyChar.EntityID, GC.MyChar);
                                        GC.AddSend(Packets.SystemMessage(GC.MessageID, "ANSWER_OK"));
                                        GC.AddSend(Packets.CharacterInfo(GC.MyChar));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.VIPLevel, GC.MyChar.VipLevel));
                                        GC.AddSend(Packets.Time());
                                        GC.AddSend(Packets.Donators(GC.MyChar));
                                        GC.AddSend(Packets.Packet1012(GC.MyChar.EntityID));
                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.Effect, 0));
                                    }
                                    else
                                    {

                                        try{

                                        Game.Character chr = Game.World.H_Chars[GC.MyChar.EntityID];

                                        chr.MyClient.Disconnect();}catch{}

                                        if 
                                        (Game.World.H_Chars.Contains(GC.MyChar.EntityID))

                                        
                                        Game.World.H_Chars.Remove(GC.MyChar.EntityID);

                                        Game.World.H_Chars.Add(GC.MyChar.EntityID, GC.MyChar);                    
                                        GC.AddSend(Packets.SystemMessage(GC.MessageID, "ANSWER_OK"));                     
                                        GC.AddSend(Packets.CharacterInfo(GC.MyChar));

                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.VIPLevel, 
                                        GC.MyChar.VipLevel));

                                        GC.AddSend(Packets.Time());

                                        GC.AddSend(Packets.Donators(GC.MyChar));

                                        GC.AddSend(Packets.Packet1012(GC.MyChar.EntityID));

                                        GC.AddSend(Packets.Status(GC.MyChar.EntityID, Game.Status.Effect, 0));
}
Done.
04/06/2010 21:38 Arcо#15
Lol just had to show me up eh?