hahaha bounty ma Friend haha u decided to come back after all :D!
thats good :D hope this project goes well ;D
and the project looks cool so good luck m8 :)
Update :
Thanks to demantor i have finished the CreateAccount Function
Which took about 10 minutes :P
Code:Procedure TServerSystem.CreateAccount(U: string; P: string); begin CurrentTIme := DateTimeToStr(Time); SQLQuery.SQL.Text := 'INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Name, Email, RegNum, Age, Sex, ServerID) VALUES ( ' + '''' + U + '''' + ',0,0,' + '''' + CurrentTime + '''' + ',' + '''' + U + '''' +',NULL,NULL,20,NULL,0 )'; SQLQuery.ExecSQL()
thnx bounty.. xdd love u work...i press the button "ty" xdd
He(we xD) is currently working on Character editing :P
Character Editing almost Complete, finishing it off 2moro
Might want to check for SQL injection ;).
I'm not exactly sure about what you just said, but...
The queries you're executing still take user input.
You could inject queries similar to that, by changing U or P.Code:Procedure TServerSystem.CreateAccount(U: string; P: string); begin CurrentTIme := DateTimeToStr(Time); SQLQuery.SQL.Text := 'INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Name, Email, RegNum, Age, Sex, ServerID) VALUES ( ' + '''' + U + '''' + ',0,0,' + '''' + CurrentTime + '''' + ',' + '''' + U + '''' +',NULL,NULL,20,NULL,0 )'; SQLQuery.ExecSQL()
Last edited by Demantor; 05-01-10 at 09:25 PM.
This looks damn awesome, good job so far!
For aristrum, that wasnt the full CreateAccount procedure this is :
Code:Procedure TServerSystem.CreateAccount(U: string; P: string); var AID:string; begin CurrentTIme := DateTimeToStr(Time); SQLQuery.SQL.Text := 'SELECT * FROM Account WHERE UserID = ' + '''' + U + '''' ; SQLQuery.ExecSQL(); SQLQuery.Active := true; if SQLQuery.Fields[1].AsString = U then // Change Feilds value from 0 to 1 begin log.Lines.Add('Failed to Create Account: ' + U ); log.lines.add('UserName Already in use!'); //lets test :D end else begin SQLQuery.SQL.Text := 'INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Name, Email, RegNum, Age, Sex, ServerID) VALUES ( ' + '''' + U + '''' + ',0,0,' + '''' + CurrentTime + '''' + ',' + '''' + U + '''' +',NULL,NULL,20,NULL,0 )'; SQLQuery.ExecSQL(); SQLQuery.SQL.Text := 'SELECT AID FROM Account WHERE UserID = ' + '''' + U + ''''; SQLQuery.ExecSQL(); SQLQuery.Active := true; // this is the fix :p WORKS :D sure?, the aid should be 3 or? na look Aid := SQLQuery.Fields[0].AsString; // Gets the AID Field :D showmessage(AID); sqlquery.SQL.text := 'INSERT INTO Login (UserID, AID, Password) VALUES ( ' + '''' + U + '''' + ',' + '''' + AID + '''' + ',' + '''' + P + '''' + ')'; SQLQuery.ExecSQL(); Log.Lines.Add('User account created : ' + U); // DONE :D xD lets see if it works :Dyea end; end;