Skip to content

Commit

Permalink
fix(bridge/ndcore): remove toString fuckery
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Jan 14, 2024
1 parent efe76a5 commit b78b029
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/game/server/bridge/ndcore/ndcore-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ export class NDCoreFramework implements Strategy {
init(): void {
on('ND:characterLoaded', async (player: NDPlayer) => {
const playerIdent = player.id
const phoneNumber = player.phonenumber ?? ""
const phoneNumber = player?.phonenumber;

mainLogger.debug(`ND Core Player Phone number: ${player?.phonenumber.toString() ?? 'no phone number found'}`)

const playerSrc = player.source;

await PlayerService.handleNewPlayerEvent({
identifier: playerIdent,
source: playerSrc,
phoneNumber: phoneNumber.toString(),
phoneNumber: phoneNumber ?? null,
firstname: player.firstname,
lastname: player.lastname,
});
Expand All @@ -71,10 +74,13 @@ export class NDCoreFramework implements Strategy {
if (resource === GetCurrentResourceName()) {
const onlinePlayers = NDCore.getPlayers() as NDPlayer[];
for (const player of onlinePlayers) {

const phoneNumber = player?.phonenumber;

await PlayerService.handleNewPlayerEvent({
source: player.source,
identifier: player.id,
phoneNumber: player.phonenumber,
phoneNumber: phoneNumber ?? null,
firstname: player.firstname,
lastname: player.lastname,
});
Expand Down

0 comments on commit b78b029

Please sign in to comment.