26 Nov
Within the PC gaming community, it is quite useful to be able to control or monitor your servers programmatically. The almost universal standard being Rcon or “Remote Connection.” The protocol is overall very simple, it only requires a standard UDP socket and that you send a packet header with the login credentials per each request you make.
We will start by importing the python socket module and creating a UDP connection to the server.
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Connect to CoD4 server at 8.9.17.24:28960
# Will also work for most other games in a similar fasion
sock.connect(("8.9.17.24", 28960))
Read more »
10 Jun
Ever since the DBUS API change (more like overhaul) during the development of Banshee 1.0 and developers haven’t yet started supporting it in their plugins so I decided that I would play around with it. From what I have seen, it seems that the perception is that DBus is hard and complicated but its actually really easy and makes things very simple. Essentially you use a DBus debugger (because in most cases, documentation for an applications’ DBus API is not available) like D-Feet to look up which interfaces, methods, properties, and signals are available to you. Then use them to do what you want.
Read more »
09 May
Back when I wrote ProxyBot, I was frustrated by the fact that there was a lack of maintained and documented third party libraries for the IRC client protocol. So I essentially wrote my own implementation of the IRC client protocol for use with the bots that I write. Well I wrote the library to take advantage of OOP (Object Oriented Programming for those who don’t know) which in turn made it really quick and easy for me to throw together a bot.
So this is a simple little tutorial on how to write a basic “Hello World” bot using PyBotlib. The library itself is only a single file so I have not bothered to repackage it or write setup scripts as you will only need import that single file within your application. You may get the latest source code for the library at any time here (google code/SVN) or here (blog). So here we go…
Read more »