Ayuto / EventScripts-Emulator

A Source.Python plugin that is able to run EventScripts addons.
16 stars 9 forks source link

Usermsg error #8

Closed kamikazekuh closed 6 years ago

kamikazekuh commented 7 years ago

I receive this error when trying to run:

usermsg.fade(userid, 0, 2, 1, 240, 240, 240, 100)

2017-12-02 10:55:08 - sp    -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\es_emulator\logic.py", line 97, in __call__
    es.addons.callBlock(self.block_name)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\__init__.py", line 110, in concommand
    stack.queue([line], 'console', priority=True)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 32, in queue
    self.run()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 120, in run
    self.command(command, argv, args, exp)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\__init__.py", line 189, in command
    command.run(argv, args, exp)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\__init__.py", line 140, in run
    self.method(**_args)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\esc\cmds\addons.py", line 88, in doblock
    es.doblock(block)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 171, in wrapper
    return func(c)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 545, in doblock
    es.addons.callBlock(argv.arg_string)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es.py", line 356, in callBlock
    self.Blocks[blockname]()
  File "..\addons\source-python\plugins\es_emulator\eventscripts\ultimates\ultimates.py", line 72, in wcs_ulti_chain
    usermsg.fade(userid, 0, 2, 1, 240, 240, 240, 100)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\usermsg.py", line 46, in fade
    __sendMessage(users, 'fade')
  File "..\addons\source-python\plugins\es_emulator\eventscripts\_libs\python\usermsg.py", line 199, in __sendMessage
    if es.exists('userid', userid): es.usermsg('send', name, userid)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 171, in wrapper
    return func(c)
  File "..\addons\source-python\plugins\es_emulator\eventscripts\es_C.py", line 2800, in usermsg
    data.send(argv[3])
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 535, in send
    self._write(buffer, type_name, value)
  File "..\addons\source-python\plugins\es_emulator\helpers.py", line 547, in _write
    buffer.write_short(atoi(value))

AttributeError: 'ProtobufMessage' object has no attribute 'write_short'
Ayuto commented 7 years ago

This is not really a bug, because ES didn't support protobuf messages. Moreover, we can't support protobuf messages with es.usermsg. The only thing we can do (which is probably sufficient, because nobody ever used es.usermsg directly) is to add protobuf support to the usermsg library.