esibun / hitbox-irc-proxy

IRC proxy for Hitbox.tv
GNU General Public License v3.0
5 stars 1 forks source link

Connect to Server OK, Joining Room not working. #5

Closed thecoindalorian closed 8 years ago

thecoindalorian commented 8 years ago

I can't join my chatroom. Connection to server is ok. See console output. Runs on: Ubuntu 14.04 with Python 3.4 Installed: aiohttp, requests, websockets, asyncio I upgraded all python 3.4 modules with --upgrade switch.

python3 hitbox_irc_server.py 2016-05-12 04:54:42,139 - asyncio - DEBUG - Using selector: EpollSelector 2016-05-12 04:54:42,150 - main - INFO - Serving requests on ('0.0.0.0', 7778) 2016-05-12 04:54:44,248 - irc - INFO - Connection from ('10.10.1.182', 50791) 2016-05-12 04:54:44,257 - irc - INFO - << CAP LS 2016-05-12 04:54:44,258 - irc - DEBUG - Unknown command cap(['LS']) 2016-05-12 04:54:44,258 - irc - INFO - << PASS 2016-05-12 04:54:44,259 - irc - DEBUG - Calling on_pass (synchronously) 2016-05-12 04:54:44,259 - irc - DEBUG - Pass set to 2016-05-12 04:54:44,259 - irc - INFO - << NICK ashk0reTV 2016-05-12 04:54:44,259 - irc - DEBUG - Calling on_nick (synchronously) 2016-05-12 04:54:44,260 - irc - DEBUG - Nick set to ashk0reTV 2016-05-12 04:54:44,260 - irc - INFO - << USER ashk0reTV 0 * :... 2016-05-12 04:54:44,260 - irc - DEBUG - Calling on_user (synchronously) 2016-05-12 04:54:44,261 - irc - DEBUG - Logging in user ashk0reTV 2016-05-12 04:54:44,261 - token - DEBUG - Making request to /auth/login 2016-05-12 04:54:44,815 - token - INFO - Login successful! 2016-05-12 04:54:44,816 - token - INFO - Your authentication token is: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2016-05-12 04:54:44,817 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready() handle: <Handle _SelectorSocketTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run self._callback(_self._args) File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready self._protocol.data_received(data) File "hitbox_irc_server.py", line 63, in data_received func(tok[1:]) File "hitbox_irc_server.py", line 99, in on_user self.authenticate() File "hitbox_irc_server.py", line 231, in authenticate asyncio.ensure_future(self.welcome()) AttributeError: 'module' object has no attribute 'ensure_future' 2016-05-12 04:55:09,626 - irc - INFO - << JOIN #ashk0reTV 2016-05-12 04:55:09,626 - irc - DEBUG - Calling on_join 2016-05-12 04:55:09,627 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready() handle: <Handle _SelectorSocketTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run self._callback(_self._args) File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready self._protocol.data_received(data) File "hitbox_irc_server.py", line 68, in data_received asyncio.ensure_future(func(tok[1:])) AttributeError: 'module' object has no attribute 'ensure_future' 2016-05-12 04:55:53,249 - irc - INFO - << JOIN #ashk0reTV 2016-05-12 04:55:53,249 - irc - DEBUG - Calling on_join 2016-05-12 04:55:53,250 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready() handle: <Handle _SelectorSocketTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run self._callback(*self._args) File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready self._protocol.data_received(data) File "hitbox_irc_server.py", line 68, in data_received asyncio.ensure_future(func(tok[1:])) AttributeError: 'module' object has no attribute 'ensure_future' 2016-05-12 04:56:43,486 - irc - INFO - << PING :TIMEOUTCHECK 2016-05-12 04:56:43,486 - irc - DEBUG - Unknown command ping([':TIMEOUTCHECK']) 2016-05-12 04:57:28,764 - main - INFO - Interrupted, closing connections...

esibun commented 8 years ago

Try pulling my last commit, apparently ensure_future() was introduced in 3.4.4 and I was using it instead of async() because the latter was deprecated.

thecoindalorian commented 8 years ago

Ok, now i can connect and join the the channel. Looks fine. If i type in my mIRC Client everything is fine and the chat messages appear in the browser. But if i type in the browser i only see the chatmessage in the console of the server, but not in the mIRC Client.

Console Output (Typed in Browser, but no Output in mIRC Client):

2016-05-12 05:31:57,853 - ws - DEBUG - < 5:::{"name":"message","args":["{\"method\":\"chatMsg\",\"params\":{\"channel\":\"ashk0retv\",\"name\":\"ashk0reTV\",\"nameColor\":\"9D41B7\",\"text\":\"testwort \",\"time\":1463023918,\"role\":\"admin\",\"isFollower\":false,\"isSubscriber\":false,\"isOwner\":true,\"isStaff\":false,\"isCommunity\":false,\"media\":false,\"image\":\"/static/img/channel/ashk0reTV_55e454944d2ea_small.jpg\"}}"]} 2016-05-12 05:31:57,854 - ws - DEBUG - Message dispatched. Sem: <asyncio.locks.Semaphore object at 0x7f4f01998748 [unlocked,value:1,waiters:1]> 2016-05-12 05:31:57,855 - irc - DEBUG - incoming message from ashk0retv: {"name":"message","args":["{\"method\":\"chatMsg\",\"params\":{\"channel\":\"ashk0retv\",\"name\":\"ashk0reTV\",\"nameColor\":\"9D41B7\",\"text\":\"testwort \",\"time\":1463023918,\"role\":\"admin\",\"isFollower\":false,\"isSubscriber\":false,\"isOwner\":true,\"isStaff\":false,\"isCommunity\":false,\"media\":false,\"image\":\"/static/img/channel/ashk0reTV_55e454944d2ea_small.jpg\"}}"]} 2016-05-12 05:31:57,856 - irc - DEBUG - Calling on_chatMsg

esibun commented 8 years ago

Working as intended. You can't see your own messages in IRC. I wrote the code this way because Hitbox echoes back every message regardless of whether or not you were the one who sent it. If that's undesirable I suppose I could track outgoing messages, but that would be an enhancement request.

thecoindalorian commented 8 years ago

Ah ok. Then everything seems to be fine. Thanks for your work. :)