Blog Archives

Server Query Tool

Here is a little tool I created to send custom queries to other servers from inside Rune. You can access Server Query Tool from the Mods menu in the game. Only works with versions 1.07 and above.

DOWNLOAD:
ServerQueryTool.zip | ServerQueryToolSrc.zip

With this tool you can get all kind of information from a server:

– which players are on the server
– which mutators the server is using
– what is name of the current map
– information about players on the server
– much, much more…

Read more about which queries you can use here:

http://wiki.beyondunreal.com/Legacy:UT_Server_Query

Some interesting ones are:

\level_property\
\game_property\
\player_property\

As an example, sending \level_property\computername would return the computer name of the server.

\level_property\hour would return the current hour of the server, this way you could get an idea of where the server is located, in which time zone.

\player_property\location would get the location of every player on the server.

As you can see, you can have a lot of fun with this. Just look through the right classes to see which variables you can get. And if you find some interesting queries please leave a comment.

Remote Web Server Mod

Here is a simple example of how you can send information from a Rune mod to a remote web server.

All you really need is web host that supports php. There are many free web hosts that do this. Try using google.

In this example I am sending the current map and the number of players who are currently playing on the server, then the php script at the remote web server save these variables to a text file, which can be viewed in a normal web browser.

The mod is running as a ServerActor and does not need to be downloaded by players.

DOWNLOAD:
WebServerMod.zip | WebServerModSrc.zip

CODE:

The ServerActor:

// WebServerMod.uc
Class WebServerMod extends Info;

var UBrowserHTTPClient WebCon;
var string WebHost, WebFile;
var int WebPort, WebTimeOut;
var string WebVars;

event PostBeginPlay()
{
	local string MapName;
	local int Players;

	MapName = left(level, instr(level, "."));
	Players = Level.Game.NumPlayers;

	// Would look something like this in a browser:
	// www.website.com/folder/WebServerScript.php?map=DM-Coliseum&players=16
	WebVars = "?map="$MapName$"&players="$Players;

	WebCon = Spawn(Class'UBrowserHTTPClient');
	WebCon.Browse(WebHost, WebFile$WebVars, WebPort, WebTimeOut);

	log("Browse:"$WebHost$WebFile$WebVars$":"$WebPort);
}

DefaultProperties
{
	WebHost="www.website.com"
	WebFile="/folder/WebServerScript.php"
	WebPort=80
	WebTimeOut=5
}

The php script:

// WebServerScript.php
<?php

$MapName = $_REQUEST['map'];
$NumberOfPlayers = $_REQUEST['players'];

$LogFileName = "WebServerMod.log";
$LogFile = fopen($LogFileName, 'w') or die("can't open file");

$NewLine = "\n";

fwrite($LogFile, "Map: ");
fwrite($LogFile, $MapName);

fwrite($LogFile, $NewLine);

fwrite($LogFile, "Players: ");
fwrite($LogFile, $NumberOfPlayers);

fclose($LogFile);
?>

You could use this kind of thing for many many many other things too:

– update server stats
– update players stats
– create player chat system
– player rating of maps on download sites
– …much more, use your imagination

Note: I just realized that this mod sends the amount of players at the beginning of the map, and there might not be any players on the server so early. But it doesn’t matter, it’s just an example, you should still see the map name at least in the text file if you try it.

Disable Chat Messages

Sometimes you might want to play Rune and not be distracted by chat messages. Here is how to disable chat and all other messages at the top of the screen.

1. Remove Message Beep

Disable the sound that is played everytime there is a new chat message by starting the game and going to Options->Audio and un-click “Message Beep”.

2. Download and install a hex editor

You will need to download a hex editor from somewhere for the next step. I would recommend Frhed which is free and open source, can be downloaded from here:

http://sourceforge.net/projects/frhed/files/latest/download

3. Modify RuneI.u

Start Frhed and open the file RuneI.u which is located in the Rune system folder. Press CTRL + G or from the top menu choose “Edit->GoTo…” to open the GoTo window.

When the GoTo window is open enter one of the following into the box:

For Rune 1.00:

x0008deb5

For Rune 1.01:

x00090dfb

For Rune 1.07:

x00091942

Then click Ok.

Now the cursor should have moved to the number “96”, change the number to “97” and save the file from the top menu.

That is all. Now when you start Rune and anyone write a chat message on any server it will not show up, and you will not hear it either. You can of course still see all the messages if you open the Rune Console.