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
+50 -39
View File
@@ -447,56 +447,59 @@ async function steal(interaction) {
* Thief stats.
*/
await trackProfileEvent(
await trackProfileEvent(
interaction,
user.id,
{
type:
"steal_success",
type: "steal_success",
source: "steal",
amount,
targetUserId:
target.id
}
);
);
await trackProfileEvent(
await trackProfileEvent(
interaction,
user.id,
{
type:
"cookie_gain",
amount
type: "cookie_gain",
source: "steal",
amount,
targetUserId:
target.id
}
);
);
/*
* Victim stats.
*/
await trackProfileEvent(
await trackProfileEvent(
interaction,
target.id,
{
type:
"stolen_from_me",
type: "stolen_from_me",
source: "steal",
amount,
thiefUserId:
user.id
}
);
);
await trackProfileEvent(
await trackProfileEvent(
interaction,
target.id,
{
type:
"cookie_loss",
amount
type: "cookie_loss",
source: "steal",
amount,
thiefUserId:
user.id
}
);
);
const [
@@ -653,28 +656,32 @@ async function steal(interaction) {
* Profile tracking.
*/
await trackProfileEvent(
await trackProfileEvent(
interaction,
user.id,
{
type:
"cookie_loss",
type: "cookie_loss",
source: "steal_penalty",
amount:
penalty
penalty,
targetUserId:
target.id
}
);
);
await trackProfileEvent(
await trackProfileEvent(
interaction,
target.id,
{
type:
"cookie_gain",
type: "cookie_gain",
source: "steal_penalty",
amount:
penalty
penalty,
thiefUserId:
user.id
}
);
);
const [
@@ -902,30 +909,34 @@ async function give(interaction) {
* Sender lifetime giving.
*/
await trackProfileEvent(
await trackProfileEvent(
interaction,
user.id,
{
type:
"cookies_given",
amount
type: "cookies_given",
source: "give",
amount,
targetUserId:
target.id
}
);
);
/*
* Recipient lifetime gain.
*/
await trackProfileEvent(
await trackProfileEvent(
interaction,
target.id,
{
type:
"cookie_gain",
amount
type: "cookie_gain",
source: "give",
amount,
senderUserId:
user.id
}
);
);
const [
+5 -3
View File
@@ -161,14 +161,16 @@ async function declareBankruptcy(interaction, userId = interaction.user.id) {
};
}
await trackProfileEvent(
await trackProfileEvent(
interaction,
userId,
{
type: "cookie_gain",
amount: BANKRUPTCY_GRANT
source: "bankruptcy",
amount:
BANKRUPTCY_GRANT
}
);
);
return {
ok: true,
+10 -3
View File
@@ -269,17 +269,24 @@ async function resolveCookieHeist(
}
);
/*
* ============================================================
* HEIST
* ============================================================
*/
await trackProfileEvent(
interaction,
playerId,
{
type:
"vault_steal",
type: "vault_steal",
source: "heist",
game: "heist",
result: "win",
amount
}
);
const [
playerAfter,
vaultAfter
+1
View File
@@ -304,6 +304,7 @@ async function startBlackjack(
game: "blackjack",
source,
bet,
wager: bet,
allIn,
previousAllIn,
previousBet
+3 -2
View File
@@ -87,14 +87,15 @@ async function collectCookies(
);
await trackProfileEvent(
await trackProfileEvent(
interaction,
userId,
{
type: "cookie_gain",
source: "collect",
amount
}
);
);
const balance = await getCookieBalance(
+3 -2
View File
@@ -495,7 +495,7 @@ async function playRoulette(
const allIn =
bet === playerBalance;
await trackProfileEvent(
await trackProfileEvent(
interaction,
playerId,
{
@@ -503,11 +503,12 @@ async function playRoulette(
game: "roulette",
source,
bet,
wager: bet,
allIn,
previousAllIn,
previousBet
}
);
);
await interaction.update({
embeds: [
+8 -3
View File
@@ -199,16 +199,21 @@ async function playSlots(
throw error;
}
await trackProfileEvent(
await trackProfileEvent(
interaction,
playerId,
{
type: "game_start",
game: "slots",
source,
bet
bet,
wager: bet,
allIn:
bet === playerBalance,
previousAllIn,
previousBet
}
);
);
await interaction.update({
embeds: [