Alright... I need help with this still.
This code is being a bitch like no other.
This is what I added to make client #1 to not be kicked be client #2....
In GameClient.cs
Add this
Code:
public bool DLDC = false;
Under this
Code:
public bool Robot = false;
In GameWorker.cs
Replace this
Code:
catch { GC.Soc.Disconnect(false);
return;
}
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));
}
Program.WriteLine(GC.MyChar.Name + " has logged on.");
}
GC.EndSend();
with this
Code:
catch { GC.Soc.Disconnect(false); return; }
GC.DLDC = false;
if (Game.World.H_Chars.Contains(GC.MyChar.EntityID))
{
GC.AddSend(Packets.SystemMessage(GC.MessageID, "Error! This account is already logged in. You must log off the other account before logging it in with new window."));
GC.DLDC = true;
}
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));
Program.WriteLine(GC.MyChar.Name + " has logged on.");
}
}
GC.EndSend();
And this also in GameWorker.cs
Code:
static void DCHandler(StateObj StO)
{
try
{
GameClient GC = (GameClient)StO.Wrapper;
if (GC != null && GC.MyChar != null)
{
GC.LogOff(true);
}
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
Replace with this
Code:
static void DCHandler(StateObj StO)
{
try
{
GameClient GC = (GameClient)StO.Wrapper;
if (GC.DLDC == true)
{
Program.WriteLine(GC.MyChar.Name + " has made a denied attempt to dual log and has been disconnected.");
}
else if (GC != null && GC.MyChar != null)
{
GC.LogOff(true);
}
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
That will disallow the person logging in to the same account as client #1 in client #2.
The problem is.... Now with that end of the bug fixed... /break and /dc are still rolling back. Which was an existing bug.
The funny thing is now.... /dc and /break WILL NOT put the account in to a rollback until an attempt is made to login on client #2 with the same account as client #1 is logged in to.
:confused:
I literally have a headache trying from trying to figure this out...
Anyone have a clue whats going on here?
@Korvacs,
I didn't ignore your post. I tried it and it did nothing but somehow make it easier for the dupe to be started. There are absolutely massive bugs concerning disconnection in NCS. ;-;