Esempio n. 1
0
# -*- coding: utf-8 -*-

import battlenet
from battlenet import Connection

if __name__ == "__main__":

    connection = Connection(public_key='7a09ed83ea0740e0bf284e903c8a029f',
                            private_key='6HNxhgBdt92TrO7bUFj0bByKWywOzAtw',
                            locale='cn')
    realms = connection.get_all_realms(battlenet.CHINA)
    print(realms)

    # import hmac

    # secret_key1 = b'This is my secret key'
    # message1 = b'Hello world'
    # hex_res1 = hmac.new(secret_key1, message1, digestmod="MD5").hexdigest()
    # print(hex_res1)  # b8908a20bd70f465330b434e18441d3b
Esempio n. 2
0
import battlenet
from battlenet import Connection

connection = Connection()
print "wow_servers = [",
for realm in connection.get_all_realms(battlenet.UNITED_STATES):
    print '%r,' % realm,
print "]",
Esempio n. 3
0
        region.addItem("Korea", QVariant(battlenet.KOREA))
        region.addItem("Taiwan", QVariant(battlenet.TAIWAN))
        self.connect(region, QtCore.SIGNAL("QtSig()"), self.updateRegion)
        
        groupLayout.addWidget(QLabel("Your region"))
        groupLayout.addWidget(region)
        
        """Realm select"""
    
    def updateRegion(self):
        pass

if __name__ == "__main__":
    conn = Connection()
    region = battlenet.EUROPE
    
    app = QApplication(sys.argv)
    main = Main()
    main.show()

    #my_realms = ["Shadowsong", "Skullcrusher"]
    my_realms = []

    if len(my_realms) == 0:
        for realm in conn.get_all_realms(region):
            main.add_realm(realm)
    else:
        for realm in conn.get_realms(region, my_realms):
            main.add_realm(realm)
            
    app.exec_()