From 4757723857a2e43d871136db84ab58bfc9558c00 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Tue, 2 Mar 2010 17:35:25 +0100 Subject: [PATCH] display IPv4 addresses in dotted-quad notation --- pyweb/mumble/mmobjects.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 7251a5e..ad8627b 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -201,6 +201,8 @@ class mmPlayer( object ): def getIpAsString( self ): """ Get the client's IPv6 address, in a pretty format. """ ip = self.player_obj.address; + if max( ip[:10] ) == 0 and ip[10:12] == (255, 255): + return "%d.%d.%d.%d" % tuple( ip[12:] ); # colon-separated string: ipstr = ':'.join([ ("%02x%02x" % (int(ip[idx]), int(ip[idx+1]))) for idx in range(0, len(ip), 2) ]);