snapshot migration subPhase 5.5

This commit is contained in:
DeSqBlocki
2026-08-27 19:50:12 +02:00
parent 9710fc65bf
commit 14a059034c
7 changed files with 154 additions and 126 deletions
+90 -79
View File
@@ -447,56 +447,59 @@ async function steal(interaction) {
* Thief stats. * Thief stats.
*/ */
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
user.id, user.id,
{ {
type: type: "steal_success",
"steal_success", source: "steal",
amount, amount,
targetUserId: targetUserId:
target.id target.id
} }
); );
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
user.id, user.id,
{ {
type: type: "cookie_gain",
"cookie_gain", source: "steal",
amount amount,
} targetUserId:
); target.id
}
);
/* /*
* Victim stats. * Victim stats.
*/ */
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
target.id, target.id,
{ {
type: type: "stolen_from_me",
"stolen_from_me", source: "steal",
amount, amount,
thiefUserId: thiefUserId:
user.id user.id
} }
); );
await trackProfileEvent(
await trackProfileEvent( interaction,
interaction, target.id,
target.id, {
{ type: "cookie_loss",
type: source: "steal",
"cookie_loss", amount,
amount thiefUserId:
} user.id
); }
);
const [ const [
@@ -653,28 +656,32 @@ async function steal(interaction) {
* Profile tracking. * Profile tracking.
*/ */
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
user.id, user.id,
{ {
type: type: "cookie_loss",
"cookie_loss", source: "steal_penalty",
amount: amount:
penalty penalty,
} targetUserId:
); target.id
}
);
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
target.id, target.id,
{ {
type: type: "cookie_gain",
"cookie_gain", source: "steal_penalty",
amount: amount:
penalty penalty,
} thiefUserId:
); user.id
}
);
const [ const [
@@ -902,30 +909,34 @@ async function give(interaction) {
* Sender lifetime giving. * Sender lifetime giving.
*/ */
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
user.id, user.id,
{ {
type: type: "cookies_given",
"cookies_given", source: "give",
amount amount,
} targetUserId:
); target.id
}
);
/* /*
* Recipient lifetime gain. * Recipient lifetime gain.
*/ */
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
target.id, target.id,
{ {
type: type: "cookie_gain",
"cookie_gain", source: "give",
amount amount,
} senderUserId:
); user.id
}
);
const [ const [
+10 -8
View File
@@ -161,14 +161,16 @@ async function declareBankruptcy(interaction, userId = interaction.user.id) {
}; };
} }
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
userId, userId,
{ {
type: "cookie_gain", type: "cookie_gain",
amount: BANKRUPTCY_GRANT source: "bankruptcy",
} amount:
); BANKRUPTCY_GRANT
}
);
return { return {
ok: true, ok: true,
+12 -5
View File
@@ -72,7 +72,7 @@ async function resolveCookieHeist(
if ( if (
type !== "cookieHeist" || type !== "cookieHeist" ||
ownerId !== ownerId !==
interaction.user.id interaction.user.id
) { ) {
return temporaryEphemeralReply( return temporaryEphemeralReply(
interaction, interaction,
@@ -85,7 +85,7 @@ async function resolveCookieHeist(
const method = const method =
HEIST_METHODS[ HEIST_METHODS[
methodName methodName
]; ];
if (!method) { if (!method) {
@@ -269,17 +269,24 @@ async function resolveCookieHeist(
} }
); );
/*
* ============================================================
* HEIST
* ============================================================
*/
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
playerId, playerId,
{ {
type: type: "vault_steal",
"vault_steal", source: "heist",
game: "heist",
result: "win",
amount amount
} }
); );
const [ const [
playerAfter, playerAfter,
vaultAfter vaultAfter
+4 -3
View File
@@ -304,6 +304,7 @@ async function startBlackjack(
game: "blackjack", game: "blackjack",
source, source,
bet, bet,
wager: bet,
allIn, allIn,
previousAllIn, previousAllIn,
previousBet previousBet
@@ -1328,9 +1329,9 @@ function shuffleDeck(
deck[i], deck[i],
deck[j] deck[j]
] = [ ] = [
deck[j], deck[j],
deck[i] deck[i]
]; ];
} }
} }
+9 -8
View File
@@ -87,14 +87,15 @@ async function collectCookies(
); );
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
userId, userId,
{ {
type: "cookie_gain", type: "cookie_gain",
amount source: "collect",
} amount
); }
);
const balance = await getCookieBalance( const balance = await getCookieBalance(
+14 -13
View File
@@ -495,19 +495,20 @@ async function playRoulette(
const allIn = const allIn =
bet === playerBalance; bet === playerBalance;
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
playerId, playerId,
{ {
type: "game_start", type: "game_start",
game: "roulette", game: "roulette",
source, source,
bet, bet,
allIn, wager: bet,
previousAllIn, allIn,
previousBet previousAllIn,
} previousBet
); }
);
await interaction.update({ await interaction.update({
embeds: [ embeds: [
+15 -10
View File
@@ -199,16 +199,21 @@ async function playSlots(
throw error; throw error;
} }
await trackProfileEvent( await trackProfileEvent(
interaction, interaction,
playerId, playerId,
{ {
type: "game_start", type: "game_start",
game: "slots", game: "slots",
source, source,
bet bet,
} wager: bet,
); allIn:
bet === playerBalance,
previousAllIn,
previousBet
}
);
await interaction.update({ await interaction.update({
embeds: [ embeds: [