Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\events\listener.py', line 92, in fire_game_event
callback(game_event)
File '..\addons\source-python\plugins\testplugin\testplugin.py', line 17, in on_jump
player = TPlayer.from_userid(e['userid'])
File '..\addons\source-python\packages\source-python\players\entity.py', line 82, in from_userid
return cls(index_from_userid(userid))
File '<string>', line 2, in __init__
File '..\addons\source-python\packages\site-packages\sqlalchemy\orm\instrumentation.py', line 335, in _new_state_if_none
if hasattr(instance, self.STATE_ATTR):
File '..\addons\source-python\packages\source-python\entities\entity.py', line 93, in __getattr__
for server_class in self.server_classes:
File '..\addons\source-python\packages\source-python\entities\entity.py', line 204, in server_classes
yield from server_classes.get_entity_server_classes(self)
File '..\addons\source-python\packages\source-python\entities\classes.py', line 128, in get_entity_server_classes
if entity.classname in self._entity_server_classes:
Boost.Python.ArgumentError: Python argument types in
None.None(TPlayer)
did not match C++ signature:
None(class IServerUnknown *)
Syntax: Select all
from sqlalchemy import Column, Integer
from sqlalchemy.ext.declarative import declarative_base
from events import Event
from players.entity import Player
Base = declarative_base()
class Meta(type(Player), type(Base)):
pass
class TPlayer(Player, Base, metaclass=Meta):
__tablename__ = 'player'
id = Column(Integer, primary_key=True)
@Event('player_jump')
def on_jump(e):
player = TPlayer.from_userid(e['userid'])