Exemplo n.º 1
0
def parse_respawn(fileobj, socket):
    result = {}
    result["Dimension"] = data_type_parser.parse_int(fileobj)
    result["Difficulty"] = mc_datatype.readByte(fileobj)
    result["GameMode"] = mc_datatype.readByte(fileobj)
    result["WorldHeight"] = data_type_parser.parse_short(fileobj)
    result["LevelType"] = mc_datatype.readString(fileobj)
    return generate_return_data("Respawn", result)
Exemplo n.º 2
0
def parse_encryption_key_request(fileobj, socket):
    result={}
    result["ServerID"]=mc_datatype.readString(fileobj)
    result["PublicKeyLength"]=mc_datatype.readShort(fileobj)
    result["PublicKey"]=mc_datatype.readByteArray(fileobj,result["PublicKeyLength"])
    result["VerifyTokenLength"]=mc_datatype.readShort(fileobj)
    result["VerifyToken"]=mc_datatype.readByteArray(fileobj,result["VerifyTokenLength"])
    return result
Exemplo n.º 3
0
def parse_respawn(fileobj, socket):
    result = {}
    result["Dimension"] = data_type_parser.parse_int(fileobj)
    result["Difficulty"] = mc_datatype.readByte(fileobj)
    result["GameMode"] = mc_datatype.readByte(fileobj)
    result["WorldHeight"] = data_type_parser.parse_short(fileobj)
    result["LevelType"] = mc_datatype.readString(fileobj)
    return generate_return_data("Respawn",result)
Exemplo n.º 4
0
def parse_named_sound_effect(fileobj, socket):
    result = {}
    result["SoundName"] = mc_datatype.readString(fileobj)
    result["EffectPositionX"] = mc_datatype.readInt(fileobj)
    result["EffectPositionY"] = mc_datatype.readInt(fileobj)
    result["EffectPositionZ"] = mc_datatype.readInt(fileobj)
    result["Volume"] = mc_datatype.readFloat(fileobj)
    result["Pitch"] = mc_datatype.readByte(fileobj)
    return result
Exemplo n.º 5
0
def parse_spawn_painting(fileobj, socket):
    result = {}
    result["EntitiyID"] = data_type_parser.parse_int(fileobj)
    result["Title"] = mc_datatype.readString(fileobj)
    result["X"] = data_type_parser.parse_int(fileobj)
    result["Y"] = data_type_parser.parse_int(fileobj)
    result["Z"] = data_type_parser.parse_int(fileobj)
    result["Direction"] = data_type_parser.parse_int(fileobj)
    return result
Exemplo n.º 6
0
def parse_named_sound_effect(fileobj, socket):
    result={}
    result["SoundName"]=mc_datatype.readString(fileobj)
    result["EffectPositionX"]=mc_datatype.readInt(fileobj)
    result["EffectPositionY"]=mc_datatype.readInt(fileobj)
    result["EffectPositionZ"]=mc_datatype.readInt(fileobj)
    result["Volume"]=mc_datatype.readFloat(fileobj)
    result["Pitch"]=mc_datatype.readByte(fileobj)
    return result
Exemplo n.º 7
0
def parse_spawn_painting(fileobj, socket):
    result = {}
    result["EntitiyID"] = data_type_parser.parse_int(fileobj)
    result["Title"] = mc_datatype.readString(fileobj)
    result["X"] = data_type_parser.parse_int(fileobj)
    result["Y"] = data_type_parser.parse_int(fileobj)
    result["Z"] = data_type_parser.parse_int(fileobj)
    result["Direction"] = data_type_parser.parse_int(fileobj)
    return result
Exemplo n.º 8
0
def parse_login_request(fileobj, socket):
    result = {}
    result['EntityID'] = mc_datatype.readInt(fileobj)
    result['LevelType'] = mc_datatype.readString(fileobj)
    result["GameMode"] = mc_datatype.readByte(fileobj)
    result["Dimension"] = mc_datatype.readByte(fileobj)
    result["Difficulty"] = mc_datatype.readByte(fileobj)
    result["NotUsed"] = mc_datatype.readByte(fileobj)
    result["MaxPlayers"] = mc_datatype.readByte(fileobj)
    return generate_return_data("Login_Request", result)
Exemplo n.º 9
0
def parse_login_request(fileobj, socket):
    result = {}
    result['EntityID'] = mc_datatype.readInt(fileobj)
    result['LevelType'] = mc_datatype.readString(fileobj)
    result["GameMode"] = mc_datatype.readByte(fileobj)
    result["Dimension"] = mc_datatype.readByte(fileobj)
    result["Difficulty"] = mc_datatype.readByte(fileobj)
    result["NotUsed"] = mc_datatype.readByte(fileobj)
    result["MaxPlayers"] = mc_datatype.readByte(fileobj)
    return generate_return_data("Login_Request",result)
Exemplo n.º 10
0
def parse_encryption_key_request(fileobj, socket):
    result = {}
    result["ServerID"] = mc_datatype.readString(fileobj)
    result["PublicKeyLength"] = mc_datatype.readShort(fileobj)
    result["PublicKey"] = mc_datatype.readByteArray(fileobj,
                                                    result["PublicKeyLength"])
    result["VerifyTokenLength"] = mc_datatype.readShort(fileobj)
    result["VerifyToken"] = mc_datatype.readByteArray(
        fileobj, result["VerifyTokenLength"])
    return result
Exemplo n.º 11
0
def parse_entity_properties(FileObject, socket):
    EntityID = mc_datatype.readInt(FileObject)
    PropertiesCount = mc_datatype.readInt(FileObject)
    Properties = {}
    for i in range(PropertiesCount):
        key = mc_datatype.readString(FileObject)
        value = mc_datatype.readDouble(FileObject)
        Properties[key] = value
        len = mc_datatype.readShort(FileObject)
        for x in range(len):
            uuid_msb = mc_datatype.readLong(FileObject)
            uuid_lsb = mc_datatype.readLong(FileObject)
            amount = mc_datatype.readDouble(FileObject)
            operation = mc_datatype.readByte(FileObject)
    return {'EntityID': EntityID, 'Properties': Properties}
Exemplo n.º 12
0
def parse_entity_properties(FileObject,socket):
    EntityID = mc_datatype.readInt(FileObject)
    PropertiesCount = mc_datatype.readInt(FileObject)
    Properties = {}
    for i in range(PropertiesCount):
        key = mc_datatype.readString(FileObject)
        value = mc_datatype.readDouble(FileObject)
        Properties[key] = value
        len = mc_datatype.readShort(FileObject)
        for x in range(len):
            uuid_msb = mc_datatype.readLong(FileObject)
            uuid_lsb = mc_datatype.readLong(FileObject)
            amount = mc_datatype.readDouble(FileObject)
            operation = mc_datatype.readByte(FileObject)
    return {'EntityID': EntityID,
            'Properties': Properties
    }
Exemplo n.º 13
0
def parse_chat_message(fileobj, socket):
    result={}
    result["ChatMessage"] = mc_datatype.readString(fileobj)
    return generate_return_data("Chat_Message",result)
Exemplo n.º 14
0
def parse_disconnect_kick(fileobj,socket):
    result={}
    result["Reason"]=mc_datatype.readString(fileobj)
    return result
Exemplo n.º 15
0
def parse_plugin_message(fileobj,socket):
    result={}
    result["Channel"]=mc_datatype.readString(fileobj)
    result["Length"]=mc_datatype.readShort(fileobj)
    result["Data"]=mc_datatype.readByteArray(fileobj,result["Length"])
    return result
Exemplo n.º 16
0
def parse_player_list_item(fileobj, socket):
    result = {}
    result["PlayerName"] = mc_datatype.readString(fileobj)
    result["Online"] = mc_datatype.readBoolean(fileobj)
    result["Ping"] = data_type_parser.parse_short(fileobj)
    return result
Exemplo n.º 17
0
def parse_player_list_item(fileobj, socket):
    result = {}
    result["PlayerName"] = mc_datatype.readString(fileobj)
    result["Online"] = mc_datatype.readBoolean(fileobj)
    result["Ping"] = data_type_parser.parse_short(fileobj)
    return result
Exemplo n.º 18
0
def parse_chat_message(fileobj, socket):
    result = {}
    result["ChatMessage"] = mc_datatype.readString(fileobj)
    return generate_return_data("Chat_Message", result)
Exemplo n.º 19
0
def parse_disconnect_kick(fileobj, socket):
    result = {}
    result["Reason"] = mc_datatype.readString(fileobj)
    return result
Exemplo n.º 20
0
def parse_plugin_message(fileobj, socket):
    result = {}
    result["Channel"] = mc_datatype.readString(fileobj)
    result["Length"] = mc_datatype.readShort(fileobj)
    result["Data"] = mc_datatype.readByteArray(fileobj, result["Length"])
    return result