Granted its not hard; You made a character creation packet yet dont no how to make a console command?
void NewCharacter(string name, string password) {
IniFile ini = new IniFile("database\\accounts\\" + name + ".ini", "Account");
ini.WriteString("Account", name);
ini.WriteString("Password", password)
}
case "/account":
{
ServerDatabase.NewUsername(Commands[1], Commands[2]);
break;
}
public static void NewUsername(string Username, string Password)
{
IniFile ini = new IniFile(Path + "\\Accounts\\" + Username + ".ini");
if (File.Exists(ini.FileName))
{
Program.WriteLine("Username is taken.");
}
else
{
ini.WriteString("Account", "Username", Username);
ini.WriteString("Account", "Password", Password);
ini.WriteString("Character", "Name", "INVALIDNAME");
DirectoryInfo info = new DirectoryInfo(Path + "\\Accounts\\");
ini.WriteString("Character", "UID", "1000000" + info.GetFiles().Length);
ini.WriteString("Character", "GM", "2");
Program.WriteLine("Account was successfully created.");
}
}
Quote:
Well since this source and Project Manifest are similar in many ways, here's my account creating command for that source:
Code:case "/account": { ServerDatabase.NewUsername(Commands[1], Commands[2]); break; }Shouldn't be too hard to change.Code:public static void NewUsername(string Username, string Password) { IniFile ini = new IniFile(Path + "\\Accounts\\" + Username + ".ini"); if (File.Exists(ini.FileName)) { Program.WriteLine("Username is taken."); } else { ini.WriteString("Account", "Username", Username); ini.WriteString("Account", "Password", Password); ini.WriteString("Character", "Name", "INVALIDNAME"); DirectoryInfo info = new DirectoryInfo(Path + "\\Accounts\\"); ini.WriteString("Character", "UID", "1000000" + info.GetFiles().Length); ini.WriteString("Character", "GM", "2"); Program.WriteLine("Account was successfully created."); } }
Just got home so i'll try breakpointing now. And yeah i did it in that format.Quote:
I don't know, didn't try it with this source. Tried breakpointing? And just to be sure you did use it in this format right? /account <username> <password>
The newest; revision 3 but I guess that Arco's versions would be fine too. Oh and tao posted a slightly changed version (referred to as 3.1).Quote:
Does anybody have an opinion on which revision to use? I mainly just want this source to use as a reference, so which ever rev would help out with that the best, is the rev I'd like to use.