Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: Irlandec on May 25, 2009, 11:53:31 am

Title: Simple Account System [using MSSQL]
Post by: Irlandec on May 25, 2009, 11:53:31 am
Script Name: Simple Account System (using MSSQL functions by CurryWurst)
Script Description: This script is useful for scripters if they wish to create simple account system for the server. All data stored in database.txt file.
Original Author(s): CurryWurst (MSSQL and account functions, helping in testing , error fixing), Irlandec(command&other coding)
Core Version: 2.6.5
Compile Test: (http://soldatcentral.com/images/pass.gif) Passed
Code:
Code: [Select]
//AccExists function presentation
                           function AccExists(Name: string): integer;
var
  i: integer;
begin
  result:= -1;
  for i:= 0 to GetArrayLength(database) - 1 do
  begin
    if (GetPiece(database[i], #9, 0) = Name) then
    begin
      result:= i;
      break;
    end;
  end;
end;
//End of presentation

Short HOWTO:
 - Usage of MSSQL functions(how to make some magics with data) explained here (http://forums.soldat.pl/index.php?topic=33655.0)
 - Basic commands are:
     /create [passhere] - creates an account (Account name is player's nickname) with a password(current password limit is 4-12 chars, changable)
    /login [passhere] - logins to an existing account
    /logout - logically
    /changepass [passhere] - when logged in, you can change your existing password(limitations are same , but if you want to modify it, you have to modify 2 lines(in /create command and in /login command))
    /delete - deletes your account data from database
   
If you have some questions or need explanation , feel free to post here (http://forums.soldat.pl/index.php?topic=34453.0) ;)

Instalation notes: Open archive and extract all files and folders in your soldatserver root directory.

IMPORTANT NOTE: This script is for scripter-use , not for server owners(at least if they can code)

Feel free to edit or use it, but be so kind and mention the names of creators ;) Cheers  :D




Title: Re: Simple Account System [using MSSQL]
Post by: Irlandec on June 13, 2009, 04:19:42 pm
UPDATE: - Updated MySSQL functions
             - Added /delete command (deletes your account data from database)]
             - Testing stuff i forgot to delete is banished now

Note: My yesterday's update contained an ugly bug , so re-download the script please.




Title: Re: Simple Account System [using MSSQL]
Post by: Cehennem Kamyonu on July 01, 2012, 11:17:23 am
How do we add this? --> if player account don't login in 30 seconds server will kick?