Implement a context processor to load gamespy query stuff

This commit is contained in:
Trever Fischer
2012-02-19 17:46:02 -05:00
parent 61f9fcb814
commit f669163855
2 changed files with 7 additions and 0 deletions

0
minecraft/__init__.py Normal file
View File

7
minecraft/context.py Normal file
View File

@@ -0,0 +1,7 @@
import pyspy
from django.conf import settings
def server_info(request):
client = pyspy.GamespyClient(settings.MINECRAFT_SERVER, settings.MINECRAFT_SERVER_PORT)
client.update()
return {'onlinePlayers':client.players()}