well i have a problem with the "Char. making" thing, what i mean is...when a person register to my server, and then log in and stuff, make a char. but the char name is already in use, it would still let him make one....it won't show it on the database, and it will fuck both of em, because the guy that worked on his char. for a while will get his char. fucked up, it won't level and it will roll back every time he exit the game, and the other guy won't be able to log in cuz he doesn't have a char. well ok here's the code :
for some reason the
code doesnt work. i tried to change it to "Charr, CharName" and other stuff, but it still didn't work. the rest like "CharName.Length" works perfectly, i use StealArchers source which is PowerSource, so if any one could help me it would be great, thx =)
Code:
foreach (string Name in ExternalDatabase.ForbiddenNames)
{
if (CharName == Name)
{
ValidName = false;
break;
}
}
if (CharName.IndexOfAny(new char[3] { ' ', '[', ']' }) > -1)
{
ValidName = false;
}
if (CharName.Length > 10)
{
ValidName = false;
}
try
{
if (ValidName)
{
bool Success = InternalDatabase.CreateCharacter(CharName, Class, Model, Avatar, this);
if (Success)
Console.WriteLine("New character: " + CharName);
Online = false;
MySocket.Disconnect();
}
else
{
Online = false;
MySocket.Disconnect();
}
}
catch
{
return;
}
}
break;
Code:
foreach (string Name in ExternalDatabase.ForbiddenNames)
{
if (CharName == Name)
{
ValidName = false;
break;
}
}