fix unbundled startup for webrtc, and enable eslint
This commit is contained in:
parent
cb0443821e
commit
5437dab688
@ -21,7 +21,6 @@ export default [
|
|||||||
"**/dist",
|
"**/dist",
|
||||||
"**/README.md",
|
"**/README.md",
|
||||||
"**/COPYING",
|
"**/COPYING",
|
||||||
"src/webrtc",
|
|
||||||
"**/scripts/",
|
"**/scripts/",
|
||||||
"**/assets",
|
"**/assets",
|
||||||
],
|
],
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) {
|
|||||||
let authenticated = false;
|
let authenticated = false;
|
||||||
|
|
||||||
// first check if its a guild voice connection or DM voice call
|
// first check if its a guild voice connection or DM voice call
|
||||||
let voiceState = await VoiceState.findOne({
|
const voiceState = await VoiceState.findOne({
|
||||||
where: [
|
where: [
|
||||||
{ guild_id: server_id, user_id, token, session_id },
|
{ guild_id: server_id, user_id, token, session_id },
|
||||||
{ channel_id: server_id, user_id, token, session_id },
|
{ channel_id: server_id, user_id, token, session_id },
|
||||||
|
|||||||
@ -24,7 +24,10 @@ import { onSelectProtocol } from "./SelectProtocol";
|
|||||||
import { onSpeaking } from "./Speaking";
|
import { onSpeaking } from "./Speaking";
|
||||||
import { onVideo } from "./Video";
|
import { onVideo } from "./Video";
|
||||||
|
|
||||||
export type OPCodeHandler = (this: WebRtcWebSocket, data: VoicePayload) => any;
|
export type OPCodeHandler = (
|
||||||
|
this: WebRtcWebSocket,
|
||||||
|
data: VoicePayload,
|
||||||
|
) => Promise<void>;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
[VoiceOPCodes.HEARTBEAT]: onHeartbeat,
|
[VoiceOPCodes.HEARTBEAT]: onHeartbeat,
|
||||||
|
|||||||
@ -15,7 +15,8 @@
|
|||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
import moduleAlias from "module-alias";
|
||||||
|
moduleAlias(__dirname + "../../../package.json");
|
||||||
process.on("uncaughtException", console.error);
|
process.on("uncaughtException", console.error);
|
||||||
process.on("unhandledRejection", console.error);
|
process.on("unhandledRejection", console.error);
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ export const loadWebRtcLibrary = async () => {
|
|||||||
if (!selectedWrtcLibrary)
|
if (!selectedWrtcLibrary)
|
||||||
throw new NoConfiguredLibraryError("No library configured in .env");
|
throw new NoConfiguredLibraryError("No library configured in .env");
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
mediaServer = new // @ts-ignore
|
mediaServer = new // @ts-ignore
|
||||||
(await import(selectedWrtcLibrary)).default();
|
(await import(selectedWrtcLibrary)).default();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user