Exemple #1
0
    else:
        sessionid = None

    if (options.server != ""):
        serverAddress = options.server
    else:
        serverAddress = raw_input("Enter host and port if any: ")
    if ':' in serverAddress:
        StuffEnteredIntoBox = serverAddress.split(":")
        host = StuffEnteredIntoBox[0]
        port = int(StuffEnteredIntoBox[1])
    else:
        host = serverAddress
        port = 25565
    connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid,
                                                 host, port, options)
    connection.setDaemon(True)
    connection.start()
    while True:
        try:
            chat_input = raw_input()
            if (connection.isConnected):
                PacketSenderManager.send03(connection.grabSocket(),
                                           chat_input.decode('utf-8')[:100])
            else:
                pass
        except KeyboardInterrupt, e:
            connection.disconnect()
            pluginLoader.disablePlugins()
            sys.exit(1)
Exemple #2
0
            sys.exit(1)
        sessionid = loginResponse['SessionID']
        user = loginResponse['Username']
        print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid
    else:
        sessionid = None
        
    if(options.server != ""):
        serverAddress = options.server
    else:
        serverAddress = raw_input("Enter host and port if any: ")
    if ':' in serverAddress:
        StuffEnteredIntoBox = serverAddress.split(":")
        host = StuffEnteredIntoBox[0]
        port = int(StuffEnteredIntoBox[1])
    else:
        host = serverAddress
        port = 25565
    connection = NetworkManager.ServerConnection(user, sessionid, host, port, options)
    connection.start()
    while True:
        try:
            chat_input = raw_input()
            if (connection.isConnected):
                PacketSenderManager.send03(connection.grabSocket(), chat_input) 
            else:
                pass       
        except KeyboardInterrupt, e:
            connection.disconnect()
            sys.exit(1)
Exemple #3
0
def sendChat(socket, message):
    PacketSenderManager.send03(socket, message)
Exemple #4
0
def breakBlock(seconds, socket, x, y, z, face):
    PacketSenderManager.send0E(socket, 0, x, y, z, face)
    time.sleep(seconds)
    PacketSenderManager.send0E(socket, 2, x, y, z, face)
Exemple #5
0
def swingArm(socket, eid):
    PacketSenderManager.send12(socket, eid, animation=1)
Exemple #6
0
def selectItem(socket, slot):
    PacketSenderManager.send10(socket, slot)
Exemple #7
0
def dropItem(socket):
    PacketSenderManager.send0E(socket, 4, 0, 0, 0, 0)
Exemple #8
0
def placeBlock(socket, x, y, z, direction=0, held=-1, cpx=0, cpy=0, cpz=0):
    PacketSenderManager.send0F(socket, x, y, z, direction=direction, held=held,
                               cpx=cpx, cpy=cpy, cpz=cpz)
Exemple #9
0
        print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid
    else:
        sessionid = None

    if (options.server != ""):
        serverAddress = options.server
    else:
        serverAddress = raw_input("Enter host and port if any: ")
    if ':' in serverAddress:
        StuffEnteredIntoBox = serverAddress.split(":")
        host = StuffEnteredIntoBox[0]
        port = int(StuffEnteredIntoBox[1])
    else:
        host = serverAddress
        port = 25565
    connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid, host, port, options)
    connection.setDaemon(True)
    connection.start()
    while True:
        try:
            chat_input = raw_input()
            if (connection.isConnected):
                PacketSenderManager.send03(connection.grabSocket(),
                        chat_input.decode('utf-8')[:100])
            else:
                pass
        except KeyboardInterrupt, e:
            connection.disconnect()
            pluginLoader.disablePlugins()
            sys.exit(1)