Quote:
Originally Posted by Аrco
Maybe it the login process also reads from UID, and there isn't one for the character you're loggin yet afaik.
|
wow lmao u kno wat I just found out...take a look at these...
Code:
public static Main.AuthWorker.AuthInfo Authenticate(string User, string Password)
{
Main.AuthWorker.AuthInfo Info = new NewestCOServer.Main.AuthWorker.AuthInfo();
Info.Account = User;
try
{
while (File.Exists(@"C:\OldCODB\Users\" + User + ".usr"))
{
FileStream FS = new FileStream(@"C:\OldCODB\Users\" + User + ".usr", FileMode.Open);
BinaryReader BR = new BinaryReader(FS);
string RealPassword = Main.PassCrypto.EncryptPassword(Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte())));
string[] FileCaseSensitive = Directory.GetFiles(@"C:\OldCODB\Users\",User + ".usr");
string RealAccount = Path.GetFileNameWithoutExtension(FileCaseSensitive[0]);
if (RealPassword == Password && RealAccount == User)
{
Info.Status = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));
if (Info.Status == "[P]" || Info.Status == "[G]" || Info.Status == "[V]" || Info.Status == "[M]" || Info.Status == "[E]")
{
}
else
{
Info.Status = "";
}
Info.Character = "";
if (BR.BaseStream.Position != BR.BaseStream.Length)
{
byte len = BR.ReadByte();
Info.Character = Encoding.ASCII.GetString(BR.ReadBytes(len));
}
if (Info.Character == "")
Info.LogonType = 2;
else
Info.LogonType = 1;
if (CheckBan(RealAccount))
Info.LogonType = 3;
}
else
Info.LogonType = 255;
BR.Close();
FS.Close();
return Info;
}
Info.LogonType = 255;
}
catch (Exception Exc) { Console.WriteLine(Exc); }
return Info;
}
Code:
public static void CreateAccount(string Name, string Password, string Status)
{
if (!File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
{
FileStream FS = new FileStream(@"C:\OldCODB\Users\" + Name + ".usr", FileMode.CreateNew);
BinaryWriter BW = new BinaryWriter(FS);
BW.Write(Password);
BW.Write(Status);
BW.Close();
FS.Close();
}
}
both set to load from OldCODB and NOT from MySQL...lemme convert that... :facepalm: