diff --git a/litecord/voice/lvsp_conn.py b/litecord/voice/lvsp_conn.py new file mode 100644 index 0000000..f700d2c --- /dev/null +++ b/litecord/voice/lvsp_conn.py @@ -0,0 +1,23 @@ +""" + +Litecord +Copyright (C) 2018-2019 Luna Mendes + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +""" + + +class LVSPConnection: + def __init__(self, app): + self.app = app diff --git a/litecord/voice/lvsp_manager.py b/litecord/voice/lvsp_manager.py new file mode 100644 index 0000000..19e5098 --- /dev/null +++ b/litecord/voice/lvsp_manager.py @@ -0,0 +1,27 @@ +""" + +Litecord +Copyright (C) 2018-2019 Luna Mendes + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +""" + +class LVSPManager: + """Manager class for Litecord Voice Server Protocol (LVSP) connections. + + Spawns :class:`LVSPConnection` as needed, etc. + """ + def __init__(self, app, voice): + self.app = app + self.voice = voice diff --git a/litecord/voice/manager.py b/litecord/voice/manager.py index 988e2e5..0d3c687 100644 --- a/litecord/voice/manager.py +++ b/litecord/voice/manager.py @@ -26,6 +26,7 @@ from logbook import Logger from litecord.permissions import get_permissions from litecord.enums import ChannelType, VOICE_CHANNELS from litecord.voice.state import VoiceState +from litecord.voice.lvsp_manager import LVSPManager VoiceKey = Tuple[int, int] @@ -47,8 +48,8 @@ class VoiceManager: # double dict, first key is guild/channel id, second key is user id self.states = defaultdict(dict) + self.lvsp = LVSPManager(app, self) - # TODO: hold voice server LVSP connections # TODO: map channel ids to voice servers async def can_join(self, user_id: int, channel_id: int) -> int: