Пример #1
0
    def apply(self):
        for name in self.context_data.parsed:
            data = self.parse_file(name)
            self.context_data.side_data[name] = data

            # Init parsed data objects
            kwargs = dict()
            if data.client is not None:
                kwargs['client'] = [EventData(None, None, name)]
            if data.server is not None:
                kwargs['server'] = [EventData(None, None, name)]
            self.context_data.parsed[name] = CompoundEventData(**kwargs)

        print('Parse event side complete\u001b[0m')
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientChatMessage',
         docs=FunctionDoc(
             description='This event is triggered when any text is output to chatbox, including MTAs internal messages.' ,
             arguments={
                 "text": """The text that was output to chatbox. """,
                 "r": """The amount of red in the color of the text. """,
                 "g": """The amount of green in the color of the text. """,
                 "b": """The amount of blue in the color of the text. """,
                 "messageType": """The type of message as a number. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='text',
                             argument_type=FunctionType(
                                 names=['string'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='r',
                             argument_type=FunctionType(
                                 names=['int'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='g',
                             argument_type=FunctionType(
                                 names=['int'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='b',
                             argument_type=FunctionType(
                                 names=['int'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='messageType',
                             argument_type=FunctionType(
                                 names=['int'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
Пример #3
0
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientResourceFileDownload',
         docs=FunctionDoc(
             description='' ,
             arguments={
                 "fileResource": """Resource the file belongs to. """,
                 "fileName": """Relative resource file path. """,
                 "fileSize": """Size of the file in bytes. """,
                 "state": """Possible values: <code>queued</code> or <code>finished</code> or <code>failed</code>. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='fileResource',
                             argument_type=FunctionType(
                                 names=['resource'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='fileName',
                             argument_type=FunctionType(
                                 names=['string'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='fileSize',
                             argument_type=FunctionType(
                                 names=['number'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='state',
                             argument_type=FunctionType(
                                 names=['string'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
Пример #4
0
DUMP_PARTIAL = [
    CompoundEventData(
        server=[],
        client=[
            EventData(
                name='onClientCharacter',
                docs=FunctionDoc(
                    description=
                    'This event triggers whenever the user presses an alphanumeric character on their keyboard. This also includes special characters, ie.  / # %   { }.',
                    arguments={
                        "character":
                        """: a string representing the pressed character. """
                    },
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[[
                        FunctionArgument(
                            name='character',
                            argument_type=FunctionType(
                                names=['string'],
                                is_optional=False,
                            ),
                            default_value=None,
                        )
                    ]],
                    variable_length=False,
                ),
            )
        ],
    ),
    CompoundEventData(
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientTrailerAttach',
         docs=FunctionDoc(
             description='This event is triggered by a trailer when it gets attached to a towing vehicle.' ,
             arguments={
                 "towedBy": """the vehicle that is now towing the trailer. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='towedBy',
                             argument_type=FunctionType(
                                 names=['vehicle'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
DUMP_PARTIAL = [
    CompoundEventData(
        server=[],
        client=[
            EventData(
                name='onClientProjectileCreation',
                docs=FunctionDoc(
                    description=
                    'This event is triggered when a projectile is created.',
                    arguments={
                        "creator":
                        """the element that created the projectile. """
                    },
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[[
                        FunctionArgument(
                            name='creator',
                            argument_type=FunctionType(
                                names=['element'],
                                is_optional=False,
                            ),
                            default_value=None,
                        )
                    ]],
                    variable_length=False,
                ),
            )
        ],
    )
]
DUMP_PARTIAL = [
    CompoundEventData(
        server=[
            EventData(
                name='onConsole',
                docs=FunctionDoc(
                    description=
                    'This event is triggered when a player types a message into his console. It is also triggered when entering / commands via the chatbox.',
                    arguments={
                        "theMessage":
                        """: a string representing the message entered into the console. """
                    },
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[[
                        FunctionArgument(
                            name='theMessage',
                            argument_type=FunctionType(
                                names=['string'],
                                is_optional=False,
                            ),
                            default_value=None,
                        )
                    ]],
                    variable_length=False,
                ),
            )
        ],
        client=[],
    )
]
Пример #8
0
 CompoundEventData(
     server=[
         EventData(
         name='onAccountDataChange',
         docs=FunctionDoc(
             description='This event is triggered when an accounts data changes through setAccountData.' ,
             arguments={
                 "theAccount": """: the account that had data changed. """,
                 "theKey": """: the string key that is being changed. """,
                 "theValue": """: the value it is changing to. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='theAccount',
                             argument_type=FunctionType(
                                 names=['account'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='theKey',
                             argument_type=FunctionType(
                                 names=['string'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='theValue',
                             argument_type=FunctionType(
                                 names=['string'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
     client=[
         
     ],
 )
Пример #9
0
DUMP_PARTIAL = [
    CompoundEventData(
        server=[
            EventData(
                name='onBan',
                docs=FunctionDoc(
                    description=
                    'This event is triggered when an IP address or serial is banned from the server.',
                    arguments={"theBan": """: the ban which was added. """},
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[[
                        FunctionArgument(
                            name='theBan',
                            argument_type=FunctionType(
                                names=['ban'],
                                is_optional=False,
                            ),
                            default_value=None,
                        )
                    ]],
                    variable_length=False,
                ),
            )
        ],
        client=[],
    ),
    CompoundEventData(
        server=[
Пример #10
0
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    EventData, \
    CompoundEventData

DUMP_PARTIAL = [
    CompoundEventData(
        server=[],
        client=[
            EventData(
                name='onClientBrowserCreated',
                docs=FunctionDoc(
                    description=
                    'This event is triggered when the CEF browser instance has been created. If you want to load a specific website right after creating the browser (using createBrowser or guiCreateBrowser), this event will be the convenient place.',
                    arguments={},
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[],
                    variable_length=False,
                ),
            )
        ],
    ),
    CompoundEventData(
        server=[],
        client=[
            EventData(
                name='onClientBrowserCursorChange',
                docs=FunctionDoc(
                    description=
Пример #11
0
 def initialize_parsed_value(self):
     if self.context_type == 'events':
         return CompoundEventData()
     if self.context_type == 'functions':
         return CompoundFunctionData()
Пример #12
0
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientElementColShapeHit',
         docs=FunctionDoc(
             description='This event is triggered when an element (like a player or vehicle) enters a collision shape.' ,
             arguments={
                 "theShape": """the colshape that the element entered. """,
                 "matchingDimension": """true if the element is in the same dimension as the colshape, false otherwise. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='theShape',
                             argument_type=FunctionType(
                                 names=['colshape'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='matchingDimension',
                             argument_type=FunctionType(
                                 names=['bool'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
Пример #13
0
 CompoundEventData(
     server=[],
     client=[
         EventData(
             name='onClientPedDamage',
             docs=FunctionDoc(
                 description=
                 'This event is triggered whenever a ped is damaged.',
                 arguments={
                     "attacker":
                     """: A player element representing the attacker or vehicle element (when a ped falls of a bike). """,
                     "weapon":
                     """: An integer representing the Weapons|weapon ID the attacker used """,
                     "bodypart":
                     """: An integer representing the bodypart the ped was damaged """,
                     "loss":
                     """: A float representing the percentage of health the ped lost. """
                 },
                 result='',
             ),
             arguments=FunctionArgumentValues(
                 arguments=[[
                     FunctionArgument(
                         name='attacker',
                         argument_type=FunctionType(
                             names=['element'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ],
                            [
                                FunctionArgument(
                                    name='weapon',
                                    argument_type=FunctionType(
                                        names=['int'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                            [
                                FunctionArgument(
                                    name='bodypart',
                                    argument_type=FunctionType(
                                        names=['int'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                            [
                                FunctionArgument(
                                    name='loss',
                                    argument_type=FunctionType(
                                        names=['float'],
                                        is_optional=True,
                                    ),
                                    default_value=None,
                                )
                            ]],
                 variable_length=False,
             ),
         )
     ],
 ),
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientPickupHit',
         docs=FunctionDoc(
             description='This event triggers whenever a pickup is hit clientside.' ,
             arguments={
                 "thePlayer": """the player that hit the pickup """,
                 "matchingDimension": """true if thePlayer is in the same dimension as the pickup, false otherwise. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='thePlayer',
                             argument_type=FunctionType(
                                 names=['player'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='matchingDimension',
                             argument_type=FunctionType(
                                 names=['bool'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
 CompoundEventData(
     server=[
         
     ],
     client=[
         EventData(
         name='onClientColShapeHit',
         docs=FunctionDoc(
             description='This event is triggered when a physical element hits a colshape.' ,
             arguments={
                 "theElement": """the element that entered the colshape. """,
                 "matchingDimension": """a boolean referring to whether the hit collision shape was in the same dimension as the element. """
             },
             result='' ,
         ),
         arguments=FunctionArgumentValues(
                 arguments=[
                     [
                         FunctionArgument(
                             name='theElement',
                             argument_type=FunctionType(
                                 names=['element'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ],
                     [
                         FunctionArgument(
                             name='matchingDimension',
                             argument_type=FunctionType(
                                 names=['bool'],
                                 is_optional=False,
                             ),
                             default_value=None,
                         )
                     ]
                 ],
                 variable_length=False,
             ),
     )
     ],
 ),
# Autogenerated file. ANY CHANGES WILL BE OVERWRITTEN
from to_python.core.types import FunctionType, \
    FunctionArgument, \
    FunctionArgumentValues, \
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    EventData, \
    CompoundEventData

DUMP_PARTIAL = [
    CompoundEventData(
        server=[
            EventData(
                name='onWeaponFire',
                docs=FunctionDoc(
                    description=
                    'This event is triggered when a custom weapon gets fired.',
                    arguments={},
                    result='',
                ),
                arguments=FunctionArgumentValues(
                    arguments=[],
                    variable_length=False,
                ),
            )
        ],
        client=[],
    )
]
Пример #17
0
 CompoundEventData(
     server=[],
     client=[
         EventData(
             name='onClientMarkerHit',
             docs=FunctionDoc(
                 description=
                 'This event is triggered when a player enters a marker created using createMarker.',
                 arguments={
                     "hitPlayer":
                     """the player that hit the marker. """,
                     "matchingDimension":
                     """true if the player is in the same dimension as the hit marker. """
                 },
                 result='',
             ),
             arguments=FunctionArgumentValues(
                 arguments=[[
                     FunctionArgument(
                         name='hitPlayer',
                         argument_type=FunctionType(
                             names=['player'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ],
                            [
                                FunctionArgument(
                                    name='matchingDimension',
                                    argument_type=FunctionType(
                                        names=['bool'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ]],
                 variable_length=False,
             ),
         )
     ],
 ),