|
You last visited: Today at 00:10
Advertisement
[Release/Guide] Account Creating With Client
Discussion on [Release/Guide] Account Creating With Client within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
12/21/2008, 15:19
|
#16
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Error 1 'System.Array' does not contain a definition for 'StartsWith' and no extension method 'StartsWith' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) C:\Users\Damian\Desktop\CoZero Fixed\DataBase.cs 1642 26 COServerProject
Error 2 'System.Array' does not contain a definition for 'Remove' and no extension method 'Remove' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) C:\Users\Damian\Desktop\CoZero Fixed\DataBase.cs 1644 44 COServerProject
2 Errors O.O i cant solve them.. , tried many things and still wont work any help What I suppose to Do :]?
|
|
|
12/21/2008, 17:25
|
#17
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
|
What you're NOT supposed to do, is to copy+paste. This was just an example of how you could do it, if you would understand it you wouldnt ask, so keep on trying to understand until you nail it
|
|
|
12/21/2008, 17:30
|
#18
|
elite*gold: 0
Join Date: Nov 2008
Posts: 412
Received Thanks: 314
|
Quote:
Originally Posted by WTFoRK
Error 1 'System.Array' does not contain a definition for 'StartsWith' and no extension method 'StartsWith' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) C:\Users\Damian\Desktop\CoZero Fixed\DataBase.cs 1642 26 COServerProject
Error 2 'System.Array' does not contain a definition for 'Remove' and no extension method 'Remove' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) C:\Users\Damian\Desktop\CoZero Fixed\DataBase.cs 1644 44 COServerProject
2 Errors O.O i cant solve them.. , tried many things and still wont work any help What I suppose to Do :]?
|
things like what?
|
|
|
12/21/2008, 17:38
|
#19
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Quote:
Originally Posted by -FireBlaze-
things like what?
|
Define ... And so on I dont really get dat error , Never Got this before 
thats how my authenticate look like after I add those thingies for Acc's o.o
public static byte Authenticate(string Username, string Password)
{
if (UserName.StartsWith("NEW"))
{
string RealUserName = UserName.Remove(0, 3);
}
if (!File.Exists(System.Windows.Forms.Application.Sta rtupPath + "Accounts\\" + UserName + ".acc"))
{
IniFile I = new IniFile(System.Windows.Forms.Application.StartupPa th + "Accounts\\" + UserName + ".acc");
I.IniWriteValue("UserName", "Password", "");
I.IniWriteValue("UserName", "Status", "");
I.IniWriteValue("UserName", "LogType", "2");
I.IniWriteValue("UserName", "Character", "");
}
if (File.Exists(System.Windows.Forms.Application.Star tupPath + @"\accounts\\" + Username + ".xml"))
{
Ini SR = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".xml");
string Acc = SR.ReadValue("Account", "AccountID");
string Pass = SR.ReadValue("Account", "Password");
uint LogonType = uint.Parse(SR.ReadValue("Account", "LogonType"));
int LogonCount = Convert.ToInt16(SR.ReadValue("Account", "LogonCount"));
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
SR.WriteString("Account", "Password", Password);
}
LogonCount++;
SR.WriteString("Account", "LogonCount", Convert.ToString(LogonCount));
return Convert.ToByte((uint)LogonType);
}
else
{
return 0;
}
}
else return 0;
}
}
}
|
|
|
12/21/2008, 17:43
|
#20
|
elite*gold: 0
Join Date: Nov 2008
Posts: 412
Received Thanks: 314
|
Quote:
Originally Posted by WTFoRK
Define ... And so on I dont really get dat error , Never Got this before  
|
1 word about what you did, nothing
|
|
|
12/21/2008, 17:45
|
#21
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Quote:
Originally Posted by -FireBlaze-
1 word about what you did, nothing
|
nothing -_-? At least I tried for over 2 hours to get that done I didnt Go elitepvpers at the first place after i got those errors.And how do u know what i really Did ?
Auth Part
public static byte Authenticate(string Username, string Password)
{
if (UserName.StartsWith("NEW"))
{
string RealUserName = UserName.Remove(0, 3);
}
if (!File.Exists(System.Windows.Forms.Application.Sta rtupPath + "Accounts\\" + UserName + ".acc"))
{
IniFile I = new IniFile(System.Windows.Forms.Application.StartupPa th + "Accounts\\" + UserName + ".acc");
I.IniWriteValue("UserName", "Password", "");
I.IniWriteValue("UserName", "Status", "");
I.IniWriteValue("UserName", "LogType", "2");
I.IniWriteValue("UserName", "Character", "");
}
if (File.Exists(System.Windows.Forms.Application.Star tupPath + @"\accounts\\" + Username + ".xml"))
{
Ini SR = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".xml");
string Acc = SR.ReadValue("Account", "AccountID");
string Pass = SR.ReadValue("Account", "Password");
uint LogonType = uint.Parse(SR.ReadValue("Account", "LogonType"));
int LogonCount = Convert.ToInt16(SR.ReadValue("Account", "LogonCount"));
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
SR.WriteString("Account", "Password", Password);
}
LogonCount++;
SR.WriteString("Account", "LogonCount", Convert.ToString(LogonCount));
return Convert.ToByte((uint)LogonType);
}
else
{
return 0;
}
}
else return 0;
}
}
}
|
|
|
12/21/2008, 18:13
|
#22
|
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
|
Post.Replace("UserName", "Username");
Btw,
Code:
public static byte Authenticate(string Username, string Password) {
if(Username.StartsWith("NEW")) {
string CreateName = Username.REmove(0, 3);
string File = System.Windows.Forms.Application.StartupPath + "\\Accounts\\"+ CreateName + ".acc";
IniFile Ini = new IniFile(File);
Ini.WriteValue("Account", "AccountID", CreateName);
Ini.WriteValue("Account", "Password", Password);
Ini.WriteValue("Account", "LogType", "2");
Ini.WriteValue("Account", "Character", "");
}
else {
IniFile Ini = new IniFile(System.Windows.Forms.Application.StartupPath + "\\Accounts\\"+ Username + ".acc");
if(Ini.ReadValue("Account", "AccountID") == Username &&
Ini.ReadValue("Account", "Password") == Password)) {
uint LoginCount = uint.Parse(Ini.ReadValue("Account", "LoginCount"));
LoginCount++;
Ini.WriteValue("Account", "LoginCount", LoginCount.ToString());
return LoginCount++;
}
}
return 0;
}
Do the right corrections, wrote in notepad
|
|
|
12/21/2008, 18:58
|
#23
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Still one prob o.o
public static byte Authenticate(string Username, string Password)
{
if (Username.StartsWith("NEW"))
{
string CreateName = Username.Remove(0, 3);
string File = System.Windows.Forms.Application.StartupPath + "\\accounts\\" + CreateName + ".xml";
IniFile Ini = new IniFile(File);
Ini.IniWriteValue("Account", "AccountID", CreateName);
Ini.IniWriteValue("Account", "Password", Password);
Ini.IniWriteValue("Account", "LogType", "2");
Ini.IniWriteValue("Account", "Character", "");
}
else if (System.IO.File.Exists(System.Windows.Forms.Applic ation.StartupPath + @"\accounts\\" + Username + ".xml"))
{
Ini SR = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".xml");
string Acc = SR.ReadValue("Account", "AccountID");
string Pass = SR.ReadValue("Account", "Password");
uint LogonType = uint.Parse(SR.ReadValue("Account", "LogonType"));
int LogonCount = Convert.ToInt16(SR.ReadValue("Account", "LogonCount"));
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
SR.WriteString("Account", "Password", Password);
}
LogonCount++;
SR.WriteString("Account", "LogonCount", Convert.ToString(LogonCount));
return Convert.ToByte((uint)LogonType);
}
else
{
return 0;
}
}
else return 0;
}
}
}
Im getting that error
Error 2 'COServer_Project.DataBase.Authenticate(string, string)': not all code paths return a value C:\Users\Damian\Desktop\CoZero Fixed\DataBase.cs 1639 28 COServerProject
And when i remove else It wont let me log
|
|
|
12/21/2008, 20:08
|
#24
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
|
put a
Quote:
Guess where..
|
|
|
12/21/2008, 20:54
|
#25
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Agr Omg o.o Idk if I did it right but now It Wont let me log at all ... I quess I had enough problems Doing that  it looked like its easy 2 do o.o
public static byte Authenticate(string Username, string Password)
{
if (Username.StartsWith("NEW"))
{
string CreateName = Username.Remove(0, 3);
string File = System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".xml";
IniFile Ini = new IniFile(File);
Ini.IniWriteValue("Account", "AccountID", CreateName);
Ini.IniWriteValue("Account", "Password", Password);
Ini.IniWriteValue("Account", "LogType", "2");
Ini.IniWriteValue("Account", "Character", "");
}
else
return 0;
if (System.IO.File.Exists(System.Windows.Forms.Applic ation.StartupPath + @"\accounts\\" + Username + ".xml"))
{
Ini SR = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".xml");
string Acc = SR.ReadValue("Account", "AccountID");
string Pass = SR.ReadValue("Account", "Password");
uint LogonType = uint.Parse(SR.ReadValue("Account", "LogonType"));
int LogonCount = Convert.ToInt16(SR.ReadValue("Account", "LogonCount"));
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
SR.WriteString("Account", "Password", Password);
}
LogonCount++;
SR.WriteString("Account", "LogonCount", Convert.ToString(LogonCount));
return Convert.ToByte((uint)LogonType);
}
else
{
return 0;
}
}
else return 0;
}
}
}
|
|
|
12/21/2008, 21:47
|
#26
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
|
Im not going to bother.
|
|
|
12/21/2008, 22:06
|
#27
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Quote:
Originally Posted by EmmeTheCoder
Im not going to bother.
|
I saw you helping others and they didnt evne try and you dont wanna help me a bit o.0 ... wow
|
|
|
12/22/2008, 00:00
|
#28
|
elite*gold: 0
Join Date: Nov 2008
Posts: 108
Received Thanks: 4
|
Yay Understood My Problem :] It wasnt in The thing i have done xD It was In dat part
if (Username.StartsWith("NEW"))
{
string CreateName = Username.Remove(0, 3);
string File = System.Windows.Forms.Application.StartupPath + "\\Accounts\\" + CreateName + ".xml";
IniFile Ini = new IniFile(File);
Ini.IniWriteValue("Account", "AccountID", CreateName);
Ini.IniWriteValue("Account", "Password", Password);
Ini.IniWriteValue("Account", "LogonType", "2");
Ini.IniWriteValue("Account", "LogonCount", "0");
Ini.IniWriteValue("Account", "Status", "0");
Ini.IniWriteValue("Account", "Charr", "");
Ini.IniWriteValue("Account", "Online", "0");
}
|
|
|
07/13/2009, 23:03
|
#29
|
elite*gold: 0
Join Date: Sep 2008
Posts: 40
Received Thanks: 2
|
can someone code it for MYSQL? (a)
|
|
|
07/13/2009, 23:15
|
#30
|
elite*gold: 20
Join Date: Mar 2008
Posts: 958
Received Thanks: 494
|
Quote:
Originally Posted by stefans94
can someone code it for MYSQL? (a)
|
the easiet part ... use mysql command
|
|
|
Similar Threads
|
[Guide] Creating new 2Moons account if your not American / Bypass Country Block
08/16/2009 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 205 Replies
This is a guide on how to make a new 2Moons account if your not from the Usa or Canada using "Yourfreedom" as proxy.
Step 1: Register for yourfreedom.
Go here and register for yourfreedom Your Freedom: User registration
Step 2: Download yourfreedom.
You can download yourfreedom here
Your Freedom: Downloads
|
[Guide]Creating your own skills (client side)
07/08/2009 - CO2 PServer Guides & Releases - 13 Replies
#Removed
Seems not many need this guide, most can't seem to get it working.
|
All times are GMT +1. The time now is 00:11.
|
|