Let’s take some time out from the coding to look at one of DarkRift’s most powerful debugging features.
Currently DarkRift is just sitting there, occasionally telling you when someone connects or disconnects, what if I want to know if it actually receives a message I send?
Restart your server and type into it:
sniffer add -a
Now when you test you should see every message that enters the server get printed to the console window!
Since that’s a mess of information lets narrow it down. Firstly though, you can use sniffer remove argument to remove a previously setup sniffer rule:
sniff remove -a
There are a number of filters you can use with the sniffer:
Sniffs for a specified tag
Sniffs for a specified IP address
Sniffs for a specified client
You can specify multiple filters at the same time and they will logically AND together (i.e. a message has to satisfy both filters to be printed) and you can add multiple sniffing rules and they will logically OR (i.e. a message will be printed if it satisfies any defined sniffing rule).
Have a play with it in some of the example scenes; you probably won’t be able to have quite as much fun with it in our tutorial game since we only ever send one tag from the clients!
For those of you who knew the original system in DarkRift 1 hopefully you’ll appreciate how much better this is!