footballjds
2012-12-03 11:10:02
EDIT:
if a mod reads this please change the title to:
"So you left your details in the script you uploaded and got hacked…"
Hello fellow SRL'ers(if indeed you can use that form of the word),
This is a quick tidbit I decided to post after I noticed the number of scripts uploaded with user info still in them. It's very common to excitedly upload your script after making a final tweak. Usually you check through the script to remove info, maybe you even have to copies specifically for this reason. However you do it, here's an alternative that will ensure you NEVER upload your details in your script.
I use the following in a script that is committed to subversion every time I make changes. It's quite simple to use and is very straightforward.
If you use the above tidbit you'll need a text file placed on your 'C' drive named 'accs.txt' with a username on the first line and your password on the second line.
Obviously this is just how I chose to do it and their are many other ways. Play around with the procedure till it fits your needs.
Happy Scripting and Happy Holidays!!! :D
if a mod reads this please change the title to:
"So you left your details in the script you uploaded and got hacked…"
Hello fellow SRL'ers(if indeed you can use that form of the word),
This is a quick tidbit I decided to post after I noticed the number of scripts uploaded with user info still in them. It's very common to excitedly upload your script after making a final tweak. Usually you check through the script to remove info, maybe you even have to copies specifically for this reason. However you do it, here's an alternative that will ensure you NEVER upload your details in your script.
I use the following in a script that is committed to subversion every time I make changes. It's quite simple to use and is very straightforward.
procedure DeclarePlayers;
var
FileNum: integer;
s: string;
usrInfo: TStringArray;
begin
//Opens a text file on your computer
FileNum := OpenFile('C:\accs.txt', true);
//Reads the entire txt file and saves its value to string 's'
ReadFileString(FileNum, s, FileSize(FileNum));
//Closes the file
CloseFile(FileNum);
//Parses string 's' and breaks it into an array of strings
//Every new line will be a new string in the array 'usrInfo'
usrInfo := Explode(chr(10), s);
//Sets the number of players to 1, if you use multi-player I suggest changing this...
//For Multi-player NumberOfPlayers(Length(usrInfo)/2); should work
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := usrInfo[0]; //sets the first player's username to the first line in the text file
Pass := usrInfo[1]; //sets the firsts player's password to the second line in the text file
Active := True;
end;
end;If you use the above tidbit you'll need a text file placed on your 'C' drive named 'accs.txt' with a username on the first line and your password on the second line.
Obviously this is just how I chose to do it and their are many other ways. Play around with the procedure till it fits your needs.
Happy Scripting and Happy Holidays!!! :D