mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
fix(calling/server): resolve issue where call is not updated when accepted
This commit is contained in:
1 parent
d08e38495a
commit
bf79f85336
1 file changed
+2
-5
@@ -9,7 +9,6 @@ import { XPlayer } from 'esx.js/@types/server';
|
||||
import { ICall, ICallUI } from '../../phone/src/common/typings/call';
|
||||
|
||||
import { pool } from './db';
|
||||
import { time } from 'console';
|
||||
|
||||
/**
|
||||
* Returns the player phoneNumber for a passed identifier
|
||||
@@ -77,7 +76,6 @@ onNet(events.PHONE_INITIALIZE_CALL, async (phoneNumber: string, timestamp: strin
|
||||
const currentCall = calls.get(transmitterNumber);
|
||||
await saveCall(currentCall)
|
||||
|
||||
|
||||
// events
|
||||
// client that is calling
|
||||
emitNet(
|
||||
@@ -106,6 +104,8 @@ onNet(events.PHONE_ACCEPT_CALL, async (transmitterNumber: string) => {
|
||||
const currentCall = calls.get(transmitterNumber);
|
||||
const channelId = pSource;
|
||||
|
||||
await updateCall(currentCall, true);
|
||||
|
||||
// player who is being called
|
||||
emitNet(
|
||||
events.PHONE_CALL_WAS_ACCEPTED,
|
||||
@@ -116,7 +116,6 @@ onNet(events.PHONE_ACCEPT_CALL, async (transmitterNumber: string) => {
|
||||
);
|
||||
|
||||
// player who is calling
|
||||
|
||||
emitNet(
|
||||
events.PHONE_CALL_WAS_ACCEPTED,
|
||||
currentCall.transmitterSource,
|
||||
@@ -154,8 +153,6 @@ onNet(events.PHONE_END_CALL, async (transmitterNumber: string) => {
|
||||
// player who is calling
|
||||
emitNet(events.PHONE_CALL_WAS_ENDED, currentCall.transmitterSource);
|
||||
|
||||
await updateCall(currentCall, true);
|
||||
|
||||
calls.delete(transmitterNumber);
|
||||
} catch (error) {
|
||||
console.log(error, error.message);
|
||||
|
||||
Reference in new issue
Block a user