File IO and Domain Names

I realized the other day, it being the first of the month, that the pesky people hosting our game occasionally request money from us -- how impolite. This having been said, we are rolling out our first two pay features with this update. Don't panic, this does not herald in a new two-tier system for Hack Wars, we are going to continue updating the game for everyone, our pay features reflect neat little add ons for those who are willing to help out our cause.

Domain Names:

Be part of history, get your own Hack Wars in-game domain name. Tired of giving out your IP to prospective website clients, only to have your store hacked by some noob? Get a Hack Wars domain name and obscure your IP address from perspective clients. Buy as many domains names as you like, I personally won't complain if you buy several hundred. You web-site will also be indexed using the domain name in the search engine. It will also obscure your IP in the stats.

Each domain name costs a one-time fee of $5.
Please abide by our terms-of-use, e.g., if you pick an offensive domain name, we will force you to pick another -- and get grumpy.

File IO Function Pack:

For those industrious programmers out there, we have added in a powerful new function pack. Using the File IO function pack you can write and read from all the text-files on your virtual Hack Wars computer. These functions also include a powerful new function for editing the content of your web-site, as you can now dynamically replace page-content. A list of these new functions follows:

replaceContent(String key,String Content): Replaces the content represented by key in your HTML page with the new content, e.g., Your Web Page:
<html>
<body>
<?key1?>
<?any_string?>
</body>
</html>
Your HTTP Script:
replaceContent("key1","Content<br />");
replaceContent("any_string","More Content");
Output for Visitor:
Content
More Content

This new functionality is made much more powerful when combined with the file IO functions allowing you to store sections of your in-game website to disk.

string fetchGetVariable(string key): Using this function you can extract variables from the get string of a web-site request, e.g.,
someone types in: 192.168.2.002?var1=hello&var2=goodbye
HTTP Script:
fetchGetVariable("var1"): Returns "hello"
fetchGetVariable("var2"): Returns "goodbye"
clearFile(string file): Empties the content of a text file.
readFile(string file): Reads the entire contents of a text file.
readLine(string file,int lineNumber): Reads a line of a text file.
countLines(string file): Returns the number of lines in a text file.
writeLine(string file,string content): Writes a single line to a text file.
writeFile(string file,string content): Overwrites a text file with the content provided.
boolean fileExists(string file): Returns whether the file provided exists.
float parseFloat(string data): Parses a string into a float if possible.
int parseInt(string data): Parses an int from a string if possible.

You can do some pretty powerful things with these new functions, some ideas:

  • Text-based adventure games.
  • CMS system for your website.
  • A system for remotely administrating your computer.
  • The file IO pack also costs a one-time payment of $5, look for both in the new 'Shop' section of the web-site, and enjoy.