mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
mad formatting
This commit is contained in:
1 parent
6777498bcc
commit
046447b0fb
74 files changed
+329
-309
No files matched your search
+11
-15
@@ -104,29 +104,25 @@ onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => {
|
||||
try {
|
||||
const _identifier = getIdentifier(_source);
|
||||
await addTransfer(_identifier, transfer);
|
||||
|
||||
|
||||
// we need to create a notification for bank. that's why i have commented out.
|
||||
// as well as creating a check if the player has enough money etc....
|
||||
|
||||
|
||||
//emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
||||
|
||||
|
||||
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||
type: 'success'
|
||||
}
|
||||
);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
bankLogger.error(`Failed to add transaction, ${e.message}`, {
|
||||
source: _source,
|
||||
});
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||
type: 'error'
|
||||
}
|
||||
);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+12
-12
@@ -41,17 +41,17 @@ function getRandomPhoneNumber() {
|
||||
}
|
||||
|
||||
async function generatePhoneNumber(identifier: string) {
|
||||
if (!await usePhoneNumber(identifier)) {
|
||||
if (!(await usePhoneNumber(identifier))) {
|
||||
let existingId;
|
||||
let newNumber;
|
||||
do {
|
||||
newNumber = getRandomPhoneNumber();
|
||||
try {
|
||||
existingId = await getIdentifierByPhoneNumber(newNumber)
|
||||
} catch(e) {
|
||||
existingId = false
|
||||
}
|
||||
} while(existingId);
|
||||
newNumber = getRandomPhoneNumber();
|
||||
try {
|
||||
existingId = await getIdentifierByPhoneNumber(newNumber);
|
||||
} catch (e) {
|
||||
existingId = false;
|
||||
}
|
||||
} while (existingId);
|
||||
mainLogger.verbose(`Inserting number into Database: ${newNumber}`);
|
||||
const query = 'UPDATE users SET phone_number = ? WHERE identifier = ?';
|
||||
await pool.query(query, [newNumber, identifier]);
|
||||
@@ -67,16 +67,16 @@ async function getCredentials(identifier: string): Promise<string> {
|
||||
}
|
||||
|
||||
onNet('esx:playerLoaded', async (playerId: number, xPlayer: any) => {
|
||||
const _source = getSource()
|
||||
const _source = getSource();
|
||||
try {
|
||||
const identifier = xPlayer.identifier;
|
||||
await generatePhoneNumber(identifier);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
mainLogger.error(`Failed to generate a phone number, ${e.message}`, {
|
||||
source: _source,
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
onNet('phone:getCredentials', async () => {
|
||||
const _source = getSource();
|
||||
|
||||
@@ -313,7 +313,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
|
||||
await updateProfile(identifier, profile);
|
||||
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
||||
message: 'TWITTER_EDIT_PROFILE_SUCCESS',
|
||||
type: 'success'
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
twitterLogger.error(`Failed to update twitter profile: ${e.message}`, {
|
||||
@@ -321,7 +321,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
|
||||
});
|
||||
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
||||
message: 'TWITTER_EDIT_PROFILE_FAILURE',
|
||||
type: 'error'
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -368,8 +368,8 @@ onNet(events.TWITTER_CREATE_TWEET, async (tweet: Tweet) => {
|
||||
});
|
||||
emitNet(events.TWITTER_CREATE_TWEET_RESULT, _source, {
|
||||
message: 'TWITTER_CREATE_FAILED',
|
||||
type: 'error'
|
||||
});
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user