enhance(server/player): Several enhancements

Attach a readonly username property to Player class

Implement setters/getters for Player class to ensure future
compatibility for servers who implement a character switching system

Attach a fetch argument to getIdentifierByPhoneNumber that will force a
DB query if player is not online
This commit is contained in:
Taso committed 2021-03-08 20:18:20 -05:00
1 parent e5fac800ee
commit 6e9c3e6d1a
4 files changed
+112 -32

No files matched your search

+3 -5
View File
@@ -83,13 +83,11 @@ onNet(events.SELLOUT_ADD_LISTING, async (listing: MarketplaceListing) => {
const player = getPlayer(_source);
// This is used as username for the reports
const username = GetPlayerName(_source);
await addListing(
player.identifier,
username,
`${player.firstname} ${player.lastname}`,
player.phoneNumber,
player.username,
player.getName(),
player.getPhoneNumber(),
listing,
);