Beispiel #1
0
def dump_server_classes(filename):
    """Dump all server class send properties to the given file name."""
    # Open/close the file
    with LOG_PATH.joinpath(filename + '.txt').open('w') as open_file:

        # Get the starting server class
        server_class = server_game_dll.get_all_server_classes()

        # Use a while statement to loop through all server classes
        while server_class:

            # Print the server class' name to file
            open_file.write('{0}\n'.format(server_class.name))

            # Get all items in the server class' table
            _dump_server_class_table(server_class.table, open_file)

            # Move to the next server class
            server_class = server_class.next

            # Was this not the last server class?
            if server_class is not None:

                # Write a separator line before the next server class output
                open_file.write('\n')
Beispiel #2
0
_supported_property_types = {
    SendPropType.FLOAT: 'float',
    SendPropType.INT: 'int',
    SendPropType.STRING: 'string_array',
    SendPropType.VECTOR: 'Vector',
}

# Get a tuple with the supported inputs (including VOID)
_supported_inputs = tuple(_supported_input_types) + (FieldType.VOID, )

# Create a dictionary to store all server classes
_server_classes = dict()

# Loop through all server classes and add them to the dictionaries
_table_names = dict()
_current_class = server_game_dll.get_all_server_classes()
while _current_class:
    _server_classes[_current_class.name] = _current_class.table
    _table_names[_current_class.table.name] = _current_class.name
    _current_class = _current_class.next


# =============================================================================
# >> CLASSES
# =============================================================================
class _ServerClasses(TypeManager):

    """Class used to retrieve objects dynamically for a server class."""

    def __init__(self):
        """Store the base attributes."""