This commit is contained in:
Christopher committed 2021-01-26 22:30:51 +01:00
1 parent f23af8da04
commit 552cba3e76
2 files changed
+27 -4

No files matched your search

+7 -4
View File
@@ -91,18 +91,21 @@ onNet(events.PHONE_ACCEPT_CALL, async (phoneNumber: string) => {
onNet(events.PHONE_END_CALL, async (phoneNumber: string) => {
try {
const pSource = (global as any).source;
console.log("got the source of accepting", pSource);
console.log("got the source of ending", pSource);
// target
const targetIdentifier = await getIdentifierByPhoneNumber(phoneNumber);
console.log("ENDED WTF DUDE")
const targetPlayer = await getPlayerFromIdentifier(targetIdentifier);
const channelId = pSource;
console.log("holy shit he ended the call")
// client that is calling
emitNet(events.PHONE_CALL_WAS_ENDED, pSource, channelId);
emitNet(events.PHONE_CALL_WAS_ENDED, pSource);
console.log("she ended the call wtf dude fucking bitch");
// client that is being called
emitNet(events.PHONE_CALL_WAS_ENDED, targetPlayer.source, channelId);
emitNet(events.PHONE_CALL_WAS_ENDED, targetPlayer.source);
} catch (error) {
console.error(error);
}