diff --git a/app.ts b/app.ts index 5955280..4273928 100644 --- a/app.ts +++ b/app.ts @@ -9,6 +9,8 @@ import { insertRematchMatch, loadUsernamesForUserPair, computeRcPrizeFromEntryFee, + getBetFeePercentFromSettings, + getDefaultMatchEntryFeeRc, MATCH_ENTRY_FEE_RC, registerMatchRoutes, updateMatchUserBlue, @@ -95,31 +97,32 @@ function removeUserFromQueue(userId: number): void { } /** GET / JSON only: same order as match DB — first joined = red, second = blue. Always includes `entry_fee`. */ -function roomResponseForViewer(room: Room, viewerUserId: number): Room { +function roomResponseForViewer(room: Room, viewerUserId: number, betFeePercent: number): Room { const idx = room.Players.findIndex((p) => p.UserId === viewerUserId); const your_team: 'red' | 'blue' | null = idx === 0 ? 'red' : idx === 1 ? 'blue' : null; const entry_fee = room.entry_fee ?? MATCH_ENTRY_FEE_RC; - const rc_prize = computeRcPrizeFromEntryFee(entry_fee); + const rc_prize = computeRcPrizeFromEntryFee(entry_fee, betFeePercent); return { ...room, entry_fee, rc_prize, your_team }; } /** Same envelope as `POST /internal/rematch` success: both sides when seated, else `null` for open slot. */ -function roomMatchSuccessEnvelope(room: Room): MatchRoomSuccessEnvelope { +function roomMatchSuccessEnvelope(room: Room, betFeePercent: number): MatchRoomSuccessEnvelope { const entry_fee = room.entry_fee ?? MATCH_ENTRY_FEE_RC; - const rc_prize = computeRcPrizeFromEntryFee(entry_fee); + const rc_prize = computeRcPrizeFromEntryFee(entry_fee, betFeePercent); const redId = room.Players[0]?.UserId; const blueId = room.Players[1]?.UserId; return { ok: true, entry_fee, rc_prize, - for_red: redId != null ? roomResponseForViewer(room, redId) : null, - for_blue: blueId != null ? roomResponseForViewer(room, blueId) : null, + for_red: redId != null ? roomResponseForViewer(room, redId, betFeePercent) : null, + for_blue: blueId != null ? roomResponseForViewer(room, blueId, betFeePercent) : null, }; } const createRematchRoom: CreateRematchRoomFn = async ({ userRedId, userBlueId, entryFee }) => { return runMatchmakerExclusive(async () => { + const betFeePercent = await getBetFeePercentFromSettings(typedSettings); const names = await loadUsernamesForUserPair(typedSettings, userRedId, userBlueId); if (!names) { return { ok: false, status: 404, error: 'One or both players not found' }; @@ -168,24 +171,30 @@ const createRematchRoom: CreateRematchRoomFn = async ({ userRedId, userBlueId, e `Rematch room port ${newPort} match ${matchId} — ${redName} vs ${blueName} (entry_fee ${entryFee})` ); - return roomMatchSuccessEnvelope(newRoom); + return roomMatchSuccessEnvelope(newRoom, betFeePercent); }); }; registerMatchRoutes(app, typedSettings, { createRematchRoom }); -app.get('/settings', (req: Request, res: Response) => { +app.get('/settings', async (req: Request, res: Response) => { if (req.query.password !== typedSettings.password) { res.send("403 Unauthorized"); return; } + const entry_fee = await getDefaultMatchEntryFeeRc(typedSettings); + const bet_fee = await getBetFeePercentFromSettings(typedSettings); + const rc_prize = computeRcPrizeFromEntryFee(entry_fee, bet_fee); const m_settings = { minimum_players: typedSettings.minimum_players, maximum_players: typedSettings.maximum_players, waiting_time: typedSettings.waiting_time, port_range_min: typedSettings.port_range_min, port_range_max: typedSettings.port_range_max, - games: typedSettings.games + games: typedSettings.games, + entry_fee, + bet_fee, + rc_prize, }; logInfo(m_settings); res.send(m_settings); @@ -236,6 +245,8 @@ app.get('/', async (req: Request, res: Response) => { try { await runMatchmakerExclusive(async () => { + const betFeePercent = await getBetFeePercentFromSettings(typedSettings); + // Check query let joinedRoom: Room | null = null; let alreadyOnQueue = false; @@ -306,13 +317,14 @@ app.get('/', async (req: Request, res: Response) => { if (joinedRoom !== null) { // Already in a room. Stopping here removeUserFromQueue(userId); - res.json(roomMatchSuccessEnvelope(joinedRoom)); + res.json(roomMatchSuccessEnvelope(joinedRoom, betFeePercent)); return; } // Neither in a room nor in queue, Let's see if (possibleRoom === null) { if (Queue.length >= typedSettings.minimum_players) { + const insertResult = await insertMatchForNewRoom(typedSettings, userId); const newPort = GetRandomPort(typedSettings.port_range_min, typedSettings.port_range_max); const l10 = await getPlayerLast10MatchRecord(typedSettings, userId); const newRoom: Room = { @@ -320,18 +332,17 @@ app.get('/', async (req: Request, res: Response) => { GameName: gameName, Port: newPort, InitTime: Date.now(), - entry_fee: MATCH_ENTRY_FEE_RC, + entry_fee: insertResult.entry_fee, }; - const matchId = await insertMatchForNewRoom(typedSettings, userId); - if (matchId != null) { - newRoom.match_id = matchId; + if (insertResult.matchId != null) { + newRoom.match_id = insertResult.matchId; } Rooms.push(newRoom); removeUserFromQueue(userId); recordHistory( `${username} created a room on port ${newPort} (match id ${newRoom.match_id ?? '—'}) — waiting for opponent` ); - res.json(roomMatchSuccessEnvelope(newRoom)); + res.json(roomMatchSuccessEnvelope(newRoom, betFeePercent)); return; } } else { @@ -353,7 +364,7 @@ app.get('/', async (req: Request, res: Response) => { `new room created with port ${room.Port} and matchId ${room.match_id ?? '—'} for ${p0.Name} and ${p1.Name}` ); } - res.json(roomMatchSuccessEnvelope(room)); + res.json(roomMatchSuccessEnvelope(room, betFeePercent)); return; } @@ -443,17 +454,17 @@ app.get('/reopen', async (req: Request, res: Response) => { return; } + const insertResult = await insertMatchForNewRoom(typedSettings); const newRoom: Room = { Players: [], GameName: gameName, Port: port, InitTime: Date.now(), - entry_fee: MATCH_ENTRY_FEE_RC, + entry_fee: insertResult.entry_fee, instance_started: true, }; - const matchId = await insertMatchForNewRoom(typedSettings); - if (matchId != null) { - newRoom.match_id = matchId; + if (insertResult.matchId != null) { + newRoom.match_id = insertResult.matchId; } Rooms.push(newRoom); diff --git a/games/soccar/soccar_Data/Log.txt b/games/soccar/soccar_Data/Log.txt index d8fdb71..476475b 100644 --- a/games/soccar/soccar_Data/Log.txt +++ b/games/soccar/soccar_Data/Log.txt @@ -1,3 +1,3 @@ -Logger initiated at 05/04/2026 12:01:54 +Logger initiated at 05/05/2026 20:00:37 -[05/04/2026 12:01:54] Configured dedicated match reporting for match id 248 with secret 38516e39d3406225b7c3015a66e5d25c54e9b2024c0755212122bdcea3e3a328 and internal api base https://kickkingsapi.playpoolstudios.com +[05/05/2026 20:00:37] Configured dedicated match reporting for match id 261 with secret 38516e39d3406225b7c3015a66e5d25c54e9b2024c0755212122bdcea3e3a328 and internal api base https://kickkingsapi.playpoolstudios.com diff --git a/games/soccar/soccar_Data/Logs/249.txt b/games/soccar/soccar_Data/Logs/249.txt new file mode 100644 index 0000000..13b938b --- /dev/null +++ b/games/soccar/soccar_Data/Logs/249.txt @@ -0,0 +1,42 @@ +[05/04/2026 17:55:48] Starting server at port 26766 +[05/04/2026 17:55:48] Failed to fetch red and blue names, isServer? +[05/04/2026 17:55:48] Starting auto close watchdog +[05/04/2026 17:55:48] Active player connections: 0 +[05/04/2026 17:55:53] Server will be closed due to no players in, 60 +[05/04/2026 17:55:54] Active player connections: 1 +[05/04/2026 17:55:55] Client 15 set team to Red +[05/04/2026 17:55:55] Dedicated match PATCH success: 200 {"ok":true,"id":249} +[05/04/2026 17:55:59] Active player connections: 2 +[05/04/2026 17:55:59] Game started On Server +[05/04/2026 17:55:59] Client 16 set team to Blue +[05/04/2026 17:55:59] Dedicated match PATCH success: 200 {"ok":true,"id":249} +[05/04/2026 17:56:08] force = 70 * 0.3274674 = 22.92272 +[05/04/2026 17:56:08] launching puck at (0.02, -1.06) with (-0.40, 24.41) force +[05/04/2026 17:56:13] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 17:56:13] launching puck at (-3.65, 3.42) with (254.07, -238.47) force +[05/04/2026 17:56:21] force = 70 * 0.9373422 = 65.61395 +[05/04/2026 17:56:21] launching puck at (-0.34, -4.35) with (22.60, 285.55) force +[05/04/2026 17:56:21] Red goal scored, red score is now 1 +[05/04/2026 17:56:29] force = 70 * 0.7538527 = 52.76969 +[05/04/2026 17:56:29] launching puck at (-2.27, 1.72) with (119.79, -90.85) force +[05/04/2026 17:56:35] force = 70 * 0.7580514 = 53.0636 +[05/04/2026 17:56:35] launching puck at (-0.04, -2.88) with (1.99, 152.58) force +[05/04/2026 17:56:36] Red goal scored, red score is now 2 +[05/04/2026 17:56:44] force = 70 * 0.9458287 = 66.20801 +[05/04/2026 17:56:44] launching puck at (-3.41, 2.87) with (225.56, -190.10) force +[05/04/2026 17:56:50] force = 70 * 0.8543559 = 59.80492 +[05/04/2026 17:56:50] launching puck at (-0.04, -3.58) with (2.20, 214.07) force +[05/04/2026 17:56:51] Red goal scored, red score is now 3 +[05/04/2026 17:56:52] Dedicated match PATCH success: 200 {"ok":true,"id":249} +[05/04/2026 17:56:53] Dedicated match PATCH success: 200 {"ok":true,"id":249,"winner_id":4,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/04/2026 17:57:01] Rematch requested +[05/04/2026 17:57:59] Active player connections: 1 +[05/04/2026 17:58:00] Active player connections: 0 +[05/04/2026 17:58:05] Server will be closed due to no players in, 60 +[05/04/2026 17:58:15] Server will be closed due to no players in, 50 +[05/04/2026 17:58:25] Server will be closed due to no players in, 40 +[05/04/2026 17:58:35] Server will be closed due to no players in, 30 +[05/04/2026 17:58:45] Server will be closed due to no players in, 20 +[05/04/2026 17:58:55] Server will be closed due to no players in, 10 +[05/04/2026 17:59:05] All players left, exiting +[05/04/2026 17:59:06] Dedicated match PATCH success: 200 {"ok":true,"id":249} diff --git a/games/soccar/soccar_Data/Logs/250.txt b/games/soccar/soccar_Data/Logs/250.txt new file mode 100644 index 0000000..68cfdd7 --- /dev/null +++ b/games/soccar/soccar_Data/Logs/250.txt @@ -0,0 +1,36 @@ +[05/04/2026 18:03:26] Starting server at port 26100 +[05/04/2026 18:03:26] Failed to fetch red and blue names, isServer? +[05/04/2026 18:03:26] Starting auto close watchdog +[05/04/2026 18:03:26] Active player connections: 0 +[05/04/2026 18:03:31] Server will be closed due to no players in, 60 +[05/04/2026 18:03:32] Active player connections: 1 +[05/04/2026 18:03:32] Client 15 set team to Blue +[05/04/2026 18:03:33] Active player connections: 2 +[05/04/2026 18:03:33] Game started On Server +[05/04/2026 18:03:33] Client 16 set team to Red +[05/04/2026 18:03:33] Dedicated match PATCH success: 200 {"ok":true,"id":250} +[05/04/2026 18:03:33] Dedicated match PATCH success: 200 {"ok":true,"id":250} +[05/04/2026 18:03:38] force = 70 * 0.2050931 = 14.35652 +[05/04/2026 18:03:38] launching puck at (0.03, -0.87) with (-0.43, 12.42) force +[05/04/2026 18:03:45] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:03:45] launching puck at (-3.75, 3.31) with (261.14, -230.71) force +[05/04/2026 18:03:50] force = 70 * 0.9188094 = 64.31666 +[05/04/2026 18:03:50] launching puck at (-0.09, -4.17) with (5.72, 268.46) force +[05/04/2026 18:03:51] Red goal scored, red score is now 1 +[05/04/2026 18:03:58] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:03:58] launching puck at (-3.31, 3.74) with (230.99, -260.89) force +[05/04/2026 18:04:13] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:04:13] launching puck at (0.07, -5.00) with (-5.20, 348.41) force +[05/04/2026 18:04:13] Red goal scored, red score is now 2 +[05/04/2026 18:04:20] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:04:20] launching puck at (-3.81, 3.24) with (265.58, -225.58) force +[05/04/2026 18:04:25] force = 70 * 0.8454155 = 59.17908 +[05/04/2026 18:04:25] launching puck at (0.09, -3.50) with (-5.61, 207.38) force +[05/04/2026 18:04:26] Red goal scored, red score is now 3 +[05/04/2026 18:04:27] Dedicated match PATCH success: 200 {"ok":true,"id":250} +[05/04/2026 18:04:28] Dedicated match winner PATCH success: 200 {"ok":true,"id":250,"winner_id":5,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/04/2026 18:04:34] Rematch requested +[05/04/2026 18:04:40] Rematch was confirmed, closing in 5 secs. new room : +[05/04/2026 18:04:40] {"ok":true,"entry_fee":16,"rc_prize":28,"for_red":{"Players":[{"Name":"warlock2","LastSeen":1777917880090,"l10_wins":3,"l10_losses":3,"UserId":5,"rc":0.0},{"Name":"warlock","LastSeen":1777917880090,"l10_wins":3,"l10_losses":3,"UserId":4,"rc":0.0}],"GameName":"soccar","Port":26529,"InitTime":1777917880090,"instance_started":true,"match_id":251,"entry_fee":16,"rc_prize":28,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock2","LastSeen":1777917880090,"l10_wins":3,"l10_losses":3,"UserId":5,"rc":0.0},{"Name":"warlock","LastSeen":1777917880090,"l10_wins":3,"l10_losses":3,"UserId":4,"rc":0.0}],"GameName":"soccar","Port":26529,"InitTime":1777917880090,"instance_started":true,"match_id":251,"entry_fee":16,"rc_prize":28,"your_team":"blue"},"your_team":""} +[05/04/2026 18:04:44] Exiting for rematch. +[05/04/2026 18:04:45] Dedicated match PATCH success: 200 {"ok":true,"id":250} diff --git a/games/soccar/soccar_Data/Logs/251.txt b/games/soccar/soccar_Data/Logs/251.txt new file mode 100644 index 0000000..fcfb6bc --- /dev/null +++ b/games/soccar/soccar_Data/Logs/251.txt @@ -0,0 +1,12 @@ +[05/04/2026 18:04:42] Starting server at port 26529 +[05/04/2026 18:04:42] Failed to fetch red and blue names, isServer? +[05/04/2026 18:04:42] Starting auto close watchdog +[05/04/2026 18:04:42] Active player connections: 0 +[05/04/2026 18:04:47] Server will be closed due to no players in, 60 +[05/04/2026 18:04:57] Server will be closed due to no players in, 50 +[05/04/2026 18:05:07] Server will be closed due to no players in, 40 +[05/04/2026 18:05:17] Server will be closed due to no players in, 30 +[05/04/2026 18:05:27] Server will be closed due to no players in, 20 +[05/04/2026 18:05:37] Server will be closed due to no players in, 10 +[05/04/2026 18:05:47] No players joined, exiting +[05/04/2026 18:05:48] Dedicated match PATCH success: 200 {"ok":true,"id":251} diff --git a/games/soccar/soccar_Data/Logs/252.txt b/games/soccar/soccar_Data/Logs/252.txt new file mode 100644 index 0000000..561e12c --- /dev/null +++ b/games/soccar/soccar_Data/Logs/252.txt @@ -0,0 +1,44 @@ +[05/04/2026 18:11:34] Starting server at port 26753 +[05/04/2026 18:11:34] Failed to fetch red and blue names, isServer? +[05/04/2026 18:11:34] Starting auto close watchdog +[05/04/2026 18:11:34] Active player connections: 0 +[05/04/2026 18:11:39] Server will be closed due to no players in, 60 +[05/04/2026 18:11:40] Active player connections: 1 +[05/04/2026 18:11:40] Active player connections: 2 +[05/04/2026 18:11:40] Game started On Server +[05/04/2026 18:11:40] Client 15 set team to Red +[05/04/2026 18:11:40] Client 16 set team to Blue +[05/04/2026 18:11:40] Dedicated match PATCH success: 200 {"ok":true,"id":252} +[05/04/2026 18:11:40] Dedicated match PATCH success: 200 {"ok":true,"id":252} +[05/04/2026 18:11:47] force = 70 * 0.3319603 = 23.23722 +[05/04/2026 18:11:47] launching puck at (-0.01, -1.07) with (0.27, 24.95) force +[05/04/2026 18:11:52] force = 70 * 0.7957928 = 55.7055 +[05/04/2026 18:11:52] launching puck at (-2.40, 2.00) with (133.88, -111.58) force +[05/04/2026 18:11:57] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:11:57] launching puck at (-0.15, -5.00) with (10.71, 348.29) force +[05/04/2026 18:11:58] Red goal scored, red score is now 1 +[05/04/2026 18:12:04] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:12:04] launching puck at (-3.60, 3.47) with (250.96, -241.75) force +[05/04/2026 18:12:09] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:12:09] launching puck at (0.19, -5.00) with (-13.32, 348.20) force +[05/04/2026 18:12:09] Red goal scored, red score is now 2 +[05/04/2026 18:12:15] force = 70 * 0.8561524 = 59.93067 +[05/04/2026 18:12:15] launching puck at (-2.91, 2.11) with (174.53, -126.30) force +[05/04/2026 18:12:20] force = 70 * 0.9270817 = 64.89572 +[05/04/2026 18:12:20] launching puck at (0.11, -4.26) with (-6.98, 276.31) force +[05/04/2026 18:12:20] Red goal scored, red score is now 3 +[05/04/2026 18:12:21] Dedicated match PATCH success: 200 {"ok":true,"id":252} +[05/04/2026 18:12:22] Dedicated match winner PATCH success: 200 {"ok":true,"id":252,"winner_id":4,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/04/2026 18:12:41] Rematch requested +[05/04/2026 18:12:54] Rematch was confirmed, closing in 5 secs. new room : +[05/04/2026 18:12:54] {"ok":true,"entry_fee":20,"rc_prize":36,"for_red":{"Players":[{"Name":"warlock","LastSeen":1777918374597,"l10_wins":2,"l10_losses":3,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918374597,"l10_wins":3,"l10_losses":2,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26410,"InitTime":1777918374597,"instance_started":true,"match_id":253,"entry_fee":20,"rc_prize":36,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock","LastSeen":1777918374597,"l10_wins":2,"l10_losses":3,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918374597,"l10_wins":3,"l10_losses":2,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26410,"InitTime":1777918374597,"instance_started":true,"match_id":253,"entry_fee":20,"rc_prize":36,"your_team":"blue"},"your_team":""} +[05/04/2026 18:12:54] Active player connections: 1 +[05/04/2026 18:12:54] Active player connections: 0 +[05/04/2026 18:12:59] Server will be closed due to no players in, 60 +[05/04/2026 18:13:09] Server will be closed due to no players in, 50 +[05/04/2026 18:13:19] Server will be closed due to no players in, 40 +[05/04/2026 18:13:29] Server will be closed due to no players in, 30 +[05/04/2026 18:13:39] Server will be closed due to no players in, 20 +[05/04/2026 18:13:49] Server will be closed due to no players in, 10 +[05/04/2026 18:13:59] All players left, exiting +[05/04/2026 18:14:00] Dedicated match PATCH success: 200 {"ok":true,"id":252} diff --git a/games/soccar/soccar_Data/Logs/253.txt b/games/soccar/soccar_Data/Logs/253.txt new file mode 100644 index 0000000..ad70f7b --- /dev/null +++ b/games/soccar/soccar_Data/Logs/253.txt @@ -0,0 +1,12 @@ +[05/04/2026 18:12:56] Starting server at port 26410 +[05/04/2026 18:12:56] Failed to fetch red and blue names, isServer? +[05/04/2026 18:12:56] Starting auto close watchdog +[05/04/2026 18:12:56] Active player connections: 0 +[05/04/2026 18:13:01] Server will be closed due to no players in, 60 +[05/04/2026 18:13:11] Server will be closed due to no players in, 50 +[05/04/2026 18:13:21] Server will be closed due to no players in, 40 +[05/04/2026 18:13:31] Server will be closed due to no players in, 30 +[05/04/2026 18:13:41] Server will be closed due to no players in, 20 +[05/04/2026 18:13:51] Server will be closed due to no players in, 10 +[05/04/2026 18:14:01] No players joined, exiting +[05/04/2026 18:14:01] Dedicated match PATCH success: 200 {"ok":true,"id":253} diff --git a/games/soccar/soccar_Data/Logs/254.txt b/games/soccar/soccar_Data/Logs/254.txt new file mode 100644 index 0000000..c2e8436 --- /dev/null +++ b/games/soccar/soccar_Data/Logs/254.txt @@ -0,0 +1,43 @@ +[05/04/2026 18:14:21] Starting server at port 26270 +[05/04/2026 18:14:21] Failed to fetch red and blue names, isServer? +[05/04/2026 18:14:21] Starting auto close watchdog +[05/04/2026 18:14:21] Active player connections: 0 +[05/04/2026 18:14:26] Server will be closed due to no players in, 60 +[05/04/2026 18:14:27] Active player connections: 1 +[05/04/2026 18:14:28] Client 15 set team to Blue +[05/04/2026 18:14:28] Dedicated match PATCH success: 200 {"ok":true,"id":254} +[05/04/2026 18:14:28] Active player connections: 2 +[05/04/2026 18:14:28] Game started On Server +[05/04/2026 18:14:28] Client 16 set team to Red +[05/04/2026 18:14:29] Dedicated match PATCH success: 200 {"ok":true,"id":254} +[05/04/2026 18:14:37] force = 70 * 0.2137036 = 14.95925 +[05/04/2026 18:14:37] launching puck at (0.01, -0.88) with (-0.22, 13.13) force +[05/04/2026 18:14:41] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:14:41] launching puck at (-3.58, 3.49) with (249.46, -243.29) force +[05/04/2026 18:14:47] force = 70 * 0.9408115 = 65.8568 +[05/04/2026 18:14:47] launching puck at (0.01, -4.40) with (-0.89, 289.91) force +[05/04/2026 18:14:47] Red goal scored, red score is now 1 +[05/04/2026 18:14:52] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:14:52] launching puck at (-3.60, 3.47) with (251.21, -241.48) force +[05/04/2026 18:15:00] force = 70 * 0.8273905 = 57.91734 +[05/04/2026 18:15:00] launching puck at (0.05, -3.36) with (-2.79, 194.71) force +[05/04/2026 18:15:00] Red goal scored, red score is now 2 +[05/04/2026 18:15:07] force = 70 * 0.8637013 = 60.45909 +[05/04/2026 18:15:07] launching puck at (-2.63, 2.55) with (158.71, -154.13) force +[05/04/2026 18:15:13] force = 70 * 0.8029059 = 56.20341 +[05/04/2026 18:15:13] launching puck at (-0.01, -3.18) with (0.47, 178.69) force +[05/04/2026 18:15:14] Red goal scored, red score is now 3 +[05/04/2026 18:15:14] Dedicated match PATCH success: 200 {"ok":true,"id":254} +[05/04/2026 18:15:15] Dedicated match winner PATCH success: 200 {"ok":true,"id":254,"winner_id":4,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/04/2026 18:15:23] Rematch requested +[05/04/2026 18:15:31] Rematch was confirmed, closing in 5 secs. new room : +[05/04/2026 18:15:31] {"ok":true,"entry_fee":12,"rc_prize":21,"for_red":{"Players":[{"Name":"warlock","LastSeen":1777918531357,"l10_wins":3,"l10_losses":2,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918531357,"l10_wins":2,"l10_losses":3,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26659,"InitTime":1777918531357,"instance_started":true,"match_id":255,"entry_fee":12,"rc_prize":21,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock","LastSeen":1777918531357,"l10_wins":3,"l10_losses":2,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918531357,"l10_wins":2,"l10_losses":3,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26659,"InitTime":1777918531357,"instance_started":true,"match_id":255,"entry_fee":12,"rc_prize":21,"your_team":"blue"},"your_team":""} +[05/04/2026 18:15:31] Active player connections: 0 +[05/04/2026 18:15:36] Server will be closed due to no players in, 60 +[05/04/2026 18:15:46] Server will be closed due to no players in, 50 +[05/04/2026 18:15:56] Server will be closed due to no players in, 40 +[05/04/2026 18:16:06] Server will be closed due to no players in, 30 +[05/04/2026 18:16:16] Server will be closed due to no players in, 20 +[05/04/2026 18:16:26] Server will be closed due to no players in, 10 +[05/04/2026 18:16:36] All players left, exiting +[05/04/2026 18:16:37] Dedicated match PATCH success: 200 {"ok":true,"id":254} diff --git a/games/soccar/soccar_Data/Logs/255.txt b/games/soccar/soccar_Data/Logs/255.txt new file mode 100644 index 0000000..b35097b --- /dev/null +++ b/games/soccar/soccar_Data/Logs/255.txt @@ -0,0 +1,52 @@ +[05/04/2026 18:15:33] Starting server at port 26659 +[05/04/2026 18:15:33] Failed to fetch red and blue names, isServer? +[05/04/2026 18:15:33] Starting auto close watchdog +[05/04/2026 18:15:33] Active player connections: 0 +[05/04/2026 18:15:36] Active player connections: 2 +[05/04/2026 18:15:36] Game started On Server +[05/04/2026 18:15:36] Client 16 set team to Blue +[05/04/2026 18:15:36] Client 15 set team to Red +[05/04/2026 18:15:36] Dedicated match PATCH success: 200 {"ok":true,"id":255} +[05/04/2026 18:15:37] Dedicated match PATCH success: 200 {"ok":true,"id":255} +[05/04/2026 18:15:45] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:15:45] launching puck at (-0.05, -5.00) with (3.17, 348.44) force +[05/04/2026 18:15:54] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:15:54] launching puck at (-2.59, 4.28) with (180.64, -297.97) force +[05/04/2026 18:16:01] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:01] launching puck at (-4.37, 2.43) with (304.46, -169.48) force +[05/04/2026 18:16:06] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:06] launching puck at (-0.96, 4.91) with (66.84, -341.98) force +[05/04/2026 18:16:12] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:12] launching puck at (-3.10, -3.93) with (215.77, 273.61) force +[05/04/2026 18:16:21] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:21] launching puck at (-4.93, 0.83) with (343.63, -57.79) force +[05/04/2026 18:16:27] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:27] launching puck at (-1.43, -4.79) with (99.60, 333.92) force +[05/04/2026 18:16:32] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:32] launching puck at (-0.73, -4.95) with (50.58, 344.76) force +[05/04/2026 18:16:37] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:37] launching puck at (1.98, -4.59) with (-137.70, 320.09) force +[05/04/2026 18:16:37] Red goal scored, red score is now 1 +[05/04/2026 18:16:43] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:43] launching puck at (-3.69, 3.37) with (257.30, -234.98) force +[05/04/2026 18:16:48] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:16:48] launching puck at (-0.17, -5.00) with (11.91, 348.25) force +[05/04/2026 18:16:49] Red goal scored, red score is now 2 +[05/04/2026 18:16:59] force = 70 * 0.8738596 = 61.17017 +[05/04/2026 18:16:59] launching puck at (-3.01, 2.23) with (184.09, -136.68) force +[05/04/2026 18:17:05] force = 70 * 0.8715435 = 61.00805 +[05/04/2026 18:17:05] launching puck at (-0.01, -3.73) with (0.46, 227.42) force +[05/04/2026 18:17:05] Red goal scored, red score is now 3 +[05/04/2026 18:17:06] Dedicated match PATCH success: 200 {"ok":true,"id":255} +[05/04/2026 18:17:07] Dedicated match winner PATCH success: 200 {"ok":true,"id":255,"winner_id":4,"economy":{"entry_fee_rc":12,"rc_prize":21,"participant_cc":100}} +[05/04/2026 18:17:19] Rematch requested +[05/04/2026 18:17:34] Active player connections: 1 +[05/04/2026 18:17:36] Active player connections: 0 +[05/04/2026 18:17:41] Server will be closed due to no players in, 60 +[05/04/2026 18:17:51] Server will be closed due to no players in, 50 +[05/04/2026 18:18:01] Server will be closed due to no players in, 40 +[05/04/2026 18:18:11] Server will be closed due to no players in, 30 +[05/04/2026 18:18:21] Server will be closed due to no players in, 20 +[05/04/2026 18:18:31] Server will be closed due to no players in, 10 +[05/04/2026 18:18:41] All players left, exiting +[05/04/2026 18:18:41] Dedicated match PATCH success: 200 {"ok":true,"id":255} diff --git a/games/soccar/soccar_Data/Logs/256.txt b/games/soccar/soccar_Data/Logs/256.txt new file mode 100644 index 0000000..d474f78 --- /dev/null +++ b/games/soccar/soccar_Data/Logs/256.txt @@ -0,0 +1,54 @@ +[05/04/2026 18:19:50] Starting server at port 26271 +[05/04/2026 18:19:50] Failed to fetch red and blue names, isServer? +[05/04/2026 18:19:50] Starting auto close watchdog +[05/04/2026 18:19:50] Active player connections: 0 +[05/04/2026 18:19:55] Server will be closed due to no players in, 60 +[05/04/2026 18:19:55] Active player connections: 1 +[05/04/2026 18:19:55] Active player connections: 2 +[05/04/2026 18:19:55] Game started On Server +[05/04/2026 18:19:55] Client 15 set team to Blue +[05/04/2026 18:19:56] Client 16 set team to Red +[05/04/2026 18:19:56] Dedicated match PATCH success: 200 {"ok":true,"id":256} +[05/04/2026 18:19:56] Dedicated match PATCH success: 200 {"ok":true,"id":256} +[05/04/2026 18:20:02] force = 70 * 0.2513374 = 17.59362 +[05/04/2026 18:20:02] launching puck at (0.01, -0.93) with (-0.26, 16.42) force +[05/04/2026 18:20:08] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:08] launching puck at (-2.04, 4.56) with (142.38, -318.04) force +[05/04/2026 18:20:12] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:12] launching puck at (-2.97, -4.02) with (207.00, 280.30) force +[05/04/2026 18:20:21] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:21] launching puck at (-0.02, 5.00) with (1.20, -348.45) force +[05/04/2026 18:20:28] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:28] launching puck at (-3.63, 3.44) with (253.05, -239.55) force +[05/04/2026 18:20:28] Blue goal scored, blue score is now 1 +[05/04/2026 18:20:36] force = 70 * 0.1760664 = 12.32465 +[05/04/2026 18:20:36] launching puck at (0.01, -0.83) with (-0.18, 10.18) force +[05/04/2026 18:20:40] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:40] launching puck at (-3.42, 3.65) with (238.44, -254.10) force +[05/04/2026 18:20:48] force = 70 * 0.7923052 = 55.46136 +[05/04/2026 18:20:48] launching puck at (0.10, -3.10) with (-5.71, 172.07) force +[05/04/2026 18:20:48] Red goal scored, red score is now 1 +[05/04/2026 18:20:55] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:20:55] launching puck at (-3.59, 3.48) with (250.51, -242.20) force +[05/04/2026 18:21:00] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:21:00] launching puck at (0.00, -5.00) with (0.33, 348.45) force +[05/04/2026 18:21:00] Red goal scored, red score is now 2 +[05/04/2026 18:21:06] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:21:06] launching puck at (-3.46, 3.61) with (240.99, -251.68) force +[05/04/2026 18:21:13] force = 70 * 0.823643 = 57.65501 +[05/04/2026 18:21:13] launching puck at (-0.04, -3.33) with (2.09, 192.18) force +[05/04/2026 18:21:13] Red goal scored, red score is now 3 +[05/04/2026 18:21:14] Dedicated match PATCH success: 200 {"ok":true,"id":256} +[05/04/2026 18:21:15] Dedicated match winner PATCH success: 200 {"ok":true,"id":256,"winner_id":4,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/04/2026 18:21:22] Rematch requested +[05/04/2026 18:21:28] Rematch was confirmed, closing in 5 secs. new room : +[05/04/2026 18:21:28] {"ok":true,"entry_fee":28,"rc_prize":50,"for_red":{"Players":[{"Name":"warlock","LastSeen":1777918888413,"l10_wins":5,"l10_losses":2,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918888413,"l10_wins":2,"l10_losses":5,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26667,"InitTime":1777918888413,"instance_started":true,"match_id":257,"entry_fee":28,"rc_prize":50,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock","LastSeen":1777918888413,"l10_wins":5,"l10_losses":2,"UserId":4,"rc":0.0},{"Name":"warlock2","LastSeen":1777918888413,"l10_wins":2,"l10_losses":5,"UserId":5,"rc":0.0}],"GameName":"soccar","Port":26667,"InitTime":1777918888413,"instance_started":true,"match_id":257,"entry_fee":28,"rc_prize":50,"your_team":"blue"},"your_team":""} +[05/04/2026 18:21:28] Active player connections: 0 +[05/04/2026 18:21:33] Server will be closed due to no players in, 60 +[05/04/2026 18:21:43] Server will be closed due to no players in, 50 +[05/04/2026 18:21:53] Server will be closed due to no players in, 40 +[05/04/2026 18:22:03] Server will be closed due to no players in, 30 +[05/04/2026 18:22:13] Server will be closed due to no players in, 20 +[05/04/2026 18:22:23] Server will be closed due to no players in, 10 +[05/04/2026 18:22:33] All players left, exiting +[05/04/2026 18:22:34] Dedicated match PATCH success: 200 {"ok":true,"id":256} diff --git a/games/soccar/soccar_Data/Logs/257.txt b/games/soccar/soccar_Data/Logs/257.txt new file mode 100644 index 0000000..4116e4b --- /dev/null +++ b/games/soccar/soccar_Data/Logs/257.txt @@ -0,0 +1,40 @@ +[05/04/2026 18:21:30] Starting server at port 26667 +[05/04/2026 18:21:30] Failed to fetch red and blue names, isServer? +[05/04/2026 18:21:30] Starting auto close watchdog +[05/04/2026 18:21:30] Active player connections: 0 +[05/04/2026 18:21:33] Active player connections: 2 +[05/04/2026 18:21:33] Game started On Server +[05/04/2026 18:21:33] Client 15 set team to Blue +[05/04/2026 18:21:33] Client 16 set team to Red +[05/04/2026 18:21:33] Dedicated match PATCH success: 200 {"ok":true,"id":257} +[05/04/2026 18:21:33] Dedicated match PATCH success: 200 {"ok":true,"id":257} +[05/04/2026 18:21:37] force = 70 * 0.2513376 = 17.59363 +[05/04/2026 18:21:37] launching puck at (0.01, -0.93) with (-0.26, 16.42) force +[05/04/2026 18:21:42] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:21:42] launching puck at (-3.62, 3.45) with (252.04, -240.61) force +[05/04/2026 18:21:49] force = 70 * 0.7926332 = 55.48432 +[05/04/2026 18:21:49] launching puck at (-0.02, -3.11) with (0.91, 172.36) force +[05/04/2026 18:21:49] Red goal scored, red score is now 1 +[05/04/2026 18:21:55] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:21:55] launching puck at (-3.67, 3.39) with (256.03, -236.36) force +[05/04/2026 18:22:02] force = 70 * 0.8541347 = 59.78943 +[05/04/2026 18:22:02] launching puck at (-0.04, -3.58) with (2.15, 213.91) force +[05/04/2026 18:22:02] Red goal scored, red score is now 2 +[05/04/2026 18:22:09] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:22:09] launching puck at (3.93, -3.09) with (-273.84, 215.47) force +[05/04/2026 18:22:16] force = 70 * 0.9955804 = 69.69063 +[05/04/2026 18:22:16] launching puck at (-0.08, -5.00) with (5.57, 348.41) force +[05/04/2026 18:22:17] Red goal scored, red score is now 3 +[05/04/2026 18:22:17] Dedicated match PATCH success: 200 {"ok":true,"id":257} +[05/04/2026 18:22:18] Dedicated match winner PATCH success: 200 {"ok":true,"id":257,"winner_id":4,"economy":{"entry_fee_rc":28,"rc_prize":50,"participant_cc":100}} +[05/04/2026 18:22:31] Rematch requested +[05/04/2026 18:23:03] Active player connections: 1 +[05/04/2026 18:23:05] Active player connections: 0 +[05/04/2026 18:23:10] Server will be closed due to no players in, 60 +[05/04/2026 18:23:20] Server will be closed due to no players in, 50 +[05/04/2026 18:23:30] Server will be closed due to no players in, 40 +[05/04/2026 18:23:40] Server will be closed due to no players in, 30 +[05/04/2026 18:23:50] Server will be closed due to no players in, 20 +[05/04/2026 18:24:00] Server will be closed due to no players in, 10 +[05/04/2026 18:24:10] All players left, exiting +[05/04/2026 18:24:11] Dedicated match PATCH success: 200 {"ok":true,"id":257} diff --git a/games/soccar/soccar_Data/Logs/258.txt b/games/soccar/soccar_Data/Logs/258.txt new file mode 100644 index 0000000..76467fb --- /dev/null +++ b/games/soccar/soccar_Data/Logs/258.txt @@ -0,0 +1,60 @@ +[05/05/2026 19:05:27] Starting server at port 26455 +[05/05/2026 19:05:27] Failed to fetch red and blue names, isServer? +[05/05/2026 19:05:27] Starting auto close watchdog +[05/05/2026 19:05:27] Active player connections: 0 +[05/05/2026 19:05:32] Server will be closed due to no players in, 60 +[05/05/2026 19:05:32] Active player connections: 1 +[05/05/2026 19:05:33] Client 15 set team to Red +[05/05/2026 19:05:34] Dedicated match PATCH success: 200 {"ok":true,"id":258} +[05/05/2026 19:05:36] Active player connections: 2 +[05/05/2026 19:05:36] Game started On Server +[05/05/2026 19:05:36] Client 16 set team to Blue +[05/05/2026 19:05:36] Dedicated match PATCH success: 200 {"ok":true,"id":258} +[05/05/2026 19:06:11] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:11] launching puck at (4.90, -1.01) with (-341.20, 70.73) force +[05/05/2026 19:06:16] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:16] launching puck at (-3.49, 3.58) with (242.92, -249.82) force +[05/05/2026 19:06:22] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:22] launching puck at (-4.99, 0.32) with (347.75, -22.18) force +[05/05/2026 19:06:29] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:29] launching puck at (-3.29, 3.77) with (229.03, -262.62) force +[05/05/2026 19:06:35] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:35] launching puck at (-4.83, 1.28) with (336.89, -89.03) force +[05/05/2026 19:06:42] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:42] launching puck at (-2.47, 4.35) with (172.08, -303.00) force +[05/05/2026 19:06:52] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:06:52] launching puck at (-2.03, -4.57) with (141.20, 318.56) force +[05/05/2026 19:07:00] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:00] launching puck at (-2.21, 4.48) with (154.31, -312.42) force +[05/05/2026 19:07:08] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:08] launching puck at (-5.00, -0.09) with (348.40, 6.05) force +[05/05/2026 19:07:13] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:13] launching puck at (4.63, 1.88) with (-322.96, -130.82) force +[05/05/2026 19:07:19] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:19] launching puck at (2.66, 4.23) with (-185.26, -295.12) force +[05/05/2026 19:07:19] Blue goal scored, blue score is now 1 +[05/05/2026 19:07:25] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:25] launching puck at (2.67, -4.22) with (-186.36, 294.43) force +[05/05/2026 19:07:31] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:31] launching puck at (0.05, 5.00) with (-3.64, -348.43) force +[05/05/2026 19:07:31] Blue goal scored, blue score is now 2 +[05/05/2026 19:07:36] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:36] launching puck at (3.67, -3.40) with (-255.63, 236.80) force +[05/05/2026 19:07:41] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:07:41] launching puck at (-0.02, 5.00) with (1.20, -348.45) force +[05/05/2026 19:07:41] Blue goal scored, blue score is now 3 +[05/05/2026 19:07:42] Dedicated match PATCH success: 200 {"ok":true,"id":258} +[05/05/2026 19:07:43] Dedicated match winner PATCH success: 200 {"ok":true,"id":258,"winner_id":4,"economy":{"entry_fee_rc":21,"rc_prize":37,"participant_cc":100}} +[05/05/2026 19:07:57] Rematch requested +[05/05/2026 19:08:15] Rematch was confirmed, closing in 5 secs. new room : +[05/05/2026 19:08:15] {"ok":true,"entry_fee":27,"rc_prize":48,"for_red":{"Players":[{"Name":"warlock2","LastSeen":1778008095072,"l10_wins":1,"l10_losses":6,"UserId":5,"rc":0.0},{"Name":"warlock","LastSeen":1778008095072,"l10_wins":6,"l10_losses":1,"UserId":4,"rc":0.0}],"GameName":"soccar","Port":26968,"InitTime":1778008095072,"instance_started":true,"match_id":259,"entry_fee":27,"rc_prize":48,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock2","LastSeen":1778008095072,"l10_wins":1,"l10_losses":6,"UserId":5,"rc":0.0},{"Name":"warlock","LastSeen":1778008095072,"l10_wins":6,"l10_losses":1,"UserId":4,"rc":0.0}],"GameName":"soccar","Port":26968,"InitTime":1778008095072,"instance_started":true,"match_id":259,"entry_fee":27,"rc_prize":48,"your_team":"blue"},"your_team":""} +[05/05/2026 19:08:15] Active player connections: 1 +[05/05/2026 19:08:15] Active player connections: 0 +[05/05/2026 19:08:20] Server will be closed due to no players in, 60 +[05/05/2026 19:08:30] Server will be closed due to no players in, 50 +[05/05/2026 19:08:40] Server will be closed due to no players in, 40 +[05/05/2026 19:08:50] Server will be closed due to no players in, 30 +[05/05/2026 19:09:00] Server will be closed due to no players in, 20 +[05/05/2026 19:09:10] Server will be closed due to no players in, 10 +[05/05/2026 19:09:20] All players left, exiting +[05/05/2026 19:09:20] Dedicated match PATCH success: 200 {"ok":true,"id":258} diff --git a/games/soccar/soccar_Data/Logs/259.txt b/games/soccar/soccar_Data/Logs/259.txt new file mode 100644 index 0000000..6107d1c --- /dev/null +++ b/games/soccar/soccar_Data/Logs/259.txt @@ -0,0 +1,39 @@ +[05/05/2026 19:08:16] Starting server at port 26968 +[05/05/2026 19:08:16] Failed to fetch red and blue names, isServer? +[05/05/2026 19:08:16] Starting auto close watchdog +[05/05/2026 19:08:16] Active player connections: 0 +[05/05/2026 19:08:19] Active player connections: 1 +[05/05/2026 19:08:19] Active player connections: 2 +[05/05/2026 19:08:19] Game started On Server +[05/05/2026 19:08:19] Client 15 set team to Blue +[05/05/2026 19:08:20] Client 16 set team to Red +[05/05/2026 19:08:20] Dedicated match PATCH success: 200 {"ok":true,"id":259} +[05/05/2026 19:08:20] Dedicated match PATCH success: 200 {"ok":true,"id":259} +[05/05/2026 19:08:21] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:08:21] launching puck at (4.98, -0.45) with (-347.07, 31.04) force +[05/05/2026 19:08:26] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:08:26] launching puck at (-0.15, 5.00) with (10.17, -348.30) force +[05/05/2026 19:08:26] Blue goal scored, blue score is now 1 +[05/05/2026 19:08:32] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:08:32] launching puck at (4.06, -2.92) with (-282.73, 203.68) force +[05/05/2026 19:08:37] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:08:37] launching puck at (0.25, 4.99) with (-17.71, -348.00) force +[05/05/2026 19:08:37] Blue goal scored, blue score is now 2 +[05/05/2026 19:08:43] force = 70 * 0.7571987 = 53.00391 +[05/05/2026 19:08:43] launching puck at (1.88, -2.16) with (-99.89, 114.75) force +[05/05/2026 19:08:48] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:08:48] launching puck at (-0.01, 5.00) with (1.03, -348.45) force +[05/05/2026 19:08:48] Blue goal scored, blue score is now 3 +[05/05/2026 19:08:48] Dedicated match PATCH success: 200 {"ok":true,"id":259} +[05/05/2026 19:08:49] Dedicated match winner PATCH success: 200 {"ok":true,"id":259,"winner_id":4,"economy":{"entry_fee_rc":27,"rc_prize":48,"participant_cc":100}} +[05/05/2026 19:08:55] Rematch requested +[05/05/2026 19:09:32] Active player connections: 1 +[05/05/2026 19:09:49] Active player connections: 0 +[05/05/2026 19:09:54] Server will be closed due to no players in, 60 +[05/05/2026 19:10:04] Server will be closed due to no players in, 50 +[05/05/2026 19:10:14] Server will be closed due to no players in, 40 +[05/05/2026 19:10:24] Server will be closed due to no players in, 30 +[05/05/2026 19:10:34] Server will be closed due to no players in, 20 +[05/05/2026 19:10:44] Server will be closed due to no players in, 10 +[05/05/2026 19:10:54] All players left, exiting +[05/05/2026 19:10:54] Dedicated match PATCH success: 200 {"ok":true,"id":259} diff --git a/games/soccar/soccar_Data/Logs/260.txt b/games/soccar/soccar_Data/Logs/260.txt new file mode 100644 index 0000000..6b1c54f --- /dev/null +++ b/games/soccar/soccar_Data/Logs/260.txt @@ -0,0 +1,24 @@ +[05/05/2026 19:58:46] Starting server at port 26497 +[05/05/2026 19:58:46] Failed to fetch red and blue names, isServer? +[05/05/2026 19:58:46] Starting auto close watchdog +[05/05/2026 19:58:46] Active player connections: 0 +[05/05/2026 19:58:51] Server will be closed due to no players in, 60 +[05/05/2026 19:58:51] Active player connections: 1 +[05/05/2026 19:58:51] Client 15 set team to Blue +[05/05/2026 19:58:52] Dedicated match PATCH success: 200 {"ok":true,"id":260} +[05/05/2026 19:58:52] Active player connections: 2 +[05/05/2026 19:58:52] Game started On Server +[05/05/2026 19:58:53] Client 16 set team to Red +[05/05/2026 19:58:53] Dedicated match PATCH success: 200 {"ok":true,"id":260} +[05/05/2026 19:58:57] force = 70 * 0.9955804 = 69.69063 +[05/05/2026 19:58:57] launching puck at (4.86, -1.19) with (-338.42, 83.00) force +[05/05/2026 19:59:03] Active player connections: 1 +[05/05/2026 19:59:22] Active player connections: 0 +[05/05/2026 19:59:27] Server will be closed due to no players in, 60 +[05/05/2026 19:59:37] Server will be closed due to no players in, 50 +[05/05/2026 19:59:47] Server will be closed due to no players in, 40 +[05/05/2026 19:59:57] Server will be closed due to no players in, 30 +[05/05/2026 20:00:07] Server will be closed due to no players in, 20 +[05/05/2026 20:00:17] Server will be closed due to no players in, 10 +[05/05/2026 20:00:27] All players left, exiting +[05/05/2026 20:00:28] Dedicated match PATCH success: 200 {"ok":true,"id":260} diff --git a/games/soccar/soccar_Data/Logs/261.txt b/games/soccar/soccar_Data/Logs/261.txt new file mode 100644 index 0000000..ddb7914 --- /dev/null +++ b/games/soccar/soccar_Data/Logs/261.txt @@ -0,0 +1,17 @@ +[05/05/2026 20:00:37] Starting server at port 26248 +[05/05/2026 20:00:38] Failed to fetch red and blue names, isServer? +[05/05/2026 20:00:38] Starting auto close watchdog +[05/05/2026 20:00:38] Active player connections: 0 +[05/05/2026 20:00:43] Server will be closed due to no players in, 60 +[05/05/2026 20:00:43] Active player connections: 1 +[05/05/2026 20:00:43] Client 15 set team to Blue +[05/05/2026 20:00:43] Active player connections: 2 +[05/05/2026 20:00:43] Game started On Server +[05/05/2026 20:00:44] Dedicated match PATCH success: 200 {"ok":true,"id":261} +[05/05/2026 20:00:44] Client 16 set team to Red +[05/05/2026 20:00:44] Dedicated match PATCH success: 200 {"ok":true,"id":261} +[05/05/2026 20:00:55] Active player connections: 1 +[05/05/2026 20:00:57] Active player connections: 0 +[05/05/2026 20:01:02] Server will be closed due to no players in, 60 +[05/05/2026 20:01:12] Server will be closed due to no players in, 50 +[05/05/2026 20:01:22] Server will be closed due to no players in, 40 diff --git a/games/soccar/soccar_Data/Managed/Assembly-CSharp.dll b/games/soccar/soccar_Data/Managed/Assembly-CSharp.dll index 39e3960..3bea085 100644 Binary files a/games/soccar/soccar_Data/Managed/Assembly-CSharp.dll and b/games/soccar/soccar_Data/Managed/Assembly-CSharp.dll differ diff --git a/games/soccar/soccar_Data/boot.config b/games/soccar/soccar_Data/boot.config index 2a0f742..0c2f325 100644 --- a/games/soccar/soccar_Data/boot.config +++ b/games/soccar/soccar_Data/boot.config @@ -4,4 +4,4 @@ gfx-threading-mode=4 wait-for-native-debugger=0 hdr-display-enabled=0 gc-max-time-slice=3 -build-guid=5b9d9db858ab4c42af30a32b78576ef9 +build-guid=b73fb3f37c2e40d6824bba105a8d5264 diff --git a/games/soccar/soccar_Data/globalgamemanagers b/games/soccar/soccar_Data/globalgamemanagers index 291c099..2ef0f03 100644 Binary files a/games/soccar/soccar_Data/globalgamemanagers and b/games/soccar/soccar_Data/globalgamemanagers differ diff --git a/games/soccar/soccar_Data/globalgamemanagers.assets b/games/soccar/soccar_Data/globalgamemanagers.assets index e8eb110..cc7efd9 100644 Binary files a/games/soccar/soccar_Data/globalgamemanagers.assets and b/games/soccar/soccar_Data/globalgamemanagers.assets differ diff --git a/games/soccar/soccar_Data/level0 b/games/soccar/soccar_Data/level0 index 1b6445c..8e725c5 100644 Binary files a/games/soccar/soccar_Data/level0 and b/games/soccar/soccar_Data/level0 differ diff --git a/games/soccar/soccar_Data/resources.assets b/games/soccar/soccar_Data/resources.assets index b92c199..ffecf1e 100644 Binary files a/games/soccar/soccar_Data/resources.assets and b/games/soccar/soccar_Data/resources.assets differ diff --git a/games/soccar/soccar_Data/sharedassets0.assets b/games/soccar/soccar_Data/sharedassets0.assets index d708d75..5c8d33d 100644 Binary files a/games/soccar/soccar_Data/sharedassets0.assets and b/games/soccar/soccar_Data/sharedassets0.assets differ diff --git a/matches.ts b/matches.ts index 238658f..0411420 100644 --- a/matches.ts +++ b/matches.ts @@ -4,13 +4,62 @@ import type { SupabaseClient } from '@supabase/supabase-js'; import { Room, Settings } from './types'; import { createSupabase, supabaseConfigured } from './auth_bridge'; -/** Per player on the match: deducted when a winner is recorded. */ +/** Fallback when `public.settings` has no `entry_fee` row or value is invalid. */ export const MATCH_ENTRY_FEE_RC = 21; -/** `prize_pool = entry_fee * 2`, `server_fee = ceil(prize_pool / 10)`, returns `prize_pool - server_fee`. */ -export function computeRcPrizeFromEntryFee(entryFee: number): number { +const SETTINGS_KEY_ENTRY_FEE = 'entry_fee'; +const SETTINGS_KEY_BET_FEE = 'bet_fee'; + +/** Fallback when `public.settings` has no `bet_fee` row or value is invalid (percent of prize pool taken as server fee). */ +export const DEFAULT_BET_FEE_PERCENT = 10; + +/** RC entry fee for normal matchmaking (not rematches): `public.settings` row `key = entry_fee`, `value` integer string. */ +export async function getDefaultMatchEntryFeeRc(settings: Settings): Promise { + if (!supabaseConfigured(settings)) return MATCH_ENTRY_FEE_RC; + const supabase = createSupabase(settings); + const { data, error } = await supabase + .from('settings') + .select('value') + .eq('key', SETTINGS_KEY_ENTRY_FEE) + .maybeSingle(); + if (error || !data || typeof (data as { value?: unknown }).value !== 'string') { + return MATCH_ENTRY_FEE_RC; + } + const n = parseInt(String((data as { value: string }).value).trim(), 10); + if (!Number.isInteger(n) || n < 0) return MATCH_ENTRY_FEE_RC; + return n; +} + +/** Server fee percent of the prize pool (`entry_fee * 2`): `public.settings` row `key = bet_fee`, `value` integer 0–100. */ +export async function getBetFeePercentFromSettings(settings: Settings): Promise { + if (!supabaseConfigured(settings)) return DEFAULT_BET_FEE_PERCENT; + const supabase = createSupabase(settings); + const { data, error } = await supabase + .from('settings') + .select('value') + .eq('key', SETTINGS_KEY_BET_FEE) + .maybeSingle(); + if (error || !data || typeof (data as { value?: unknown }).value !== 'string') { + return DEFAULT_BET_FEE_PERCENT; + } + const n = parseInt(String((data as { value: string }).value).trim(), 10); + if (!Number.isInteger(n) || n < 0 || n > 100) return DEFAULT_BET_FEE_PERCENT; + return n; +} + +export type InsertMatchForNewRoomResult = { + matchId: number | null; + /** Same RC fee stored on `matches.entry_fee` and returned for in-memory rooms. */ + entry_fee: number; +}; + +/** + * `prize_pool = entry_fee * 2`, `server_fee = ceil(prize_pool * betFeePercent / 100)`, returns `prize_pool - server_fee`. + * `betFeePercent` comes from `public.settings` key `bet_fee` (default {@link DEFAULT_BET_FEE_PERCENT}). + */ +export function computeRcPrizeFromEntryFee(entryFee: number, betFeePercent: number = DEFAULT_BET_FEE_PERCENT): number { const prizePool = entryFee * 2; - const serverFee = Math.ceil(prizePool / 10); + const serverFee = Math.ceil((prizePool * betFeePercent) / 100); return prizePool - serverFee; } /** Added to each player's CC when a winner is recorded (default if `matches.prize_cc` is null). */ @@ -28,17 +77,23 @@ function coerceId(id: unknown): number | null { } /** Insert a match row when a new room is created. First player in the room = red (if provided). */ -export async function insertMatchForNewRoom(settings: Settings, userRedId?: number): Promise { - if (!supabaseConfigured(settings)) return null; +export async function insertMatchForNewRoom( + settings: Settings, + userRedId?: number +): Promise { + const entry_fee = await getDefaultMatchEntryFeeRc(settings); + if (!supabaseConfigured(settings)) { + return { matchId: null, entry_fee }; + } const supabase = createSupabase(settings); - const base = { entry_fee: MATCH_ENTRY_FEE_RC }; + const base = { entry_fee }; const payload = userRedId == null ? base : { ...base, user_red: userRedId }; const { data, error } = await supabase.from('matches').insert(payload).select('id').single(); if (error || !data) { console.error('matches: insert failed', error?.message); - return null; + return { matchId: null, entry_fee }; } - return coerceId(data.id); + return { matchId: coerceId(data.id), entry_fee }; } /** Dedicated server: rematch row with both players and custom `entry_fee` (RC). */ @@ -156,7 +211,7 @@ function coerceNonNegativeInt(v: unknown): number | null { } /** - * Each player pays `entry_fee` RC; winner receives `computeRcPrizeFromEntryFee(entry_fee)` RC; each gets `prizeCc` CC. + * Each player pays `entry_fee` RC; winner receives RC prize after `betFeePercent` server cut; each gets `prizeCc` CC. * Idempotent callers should set winner only once. */ async function applyMatchWinnerEconomy( @@ -165,12 +220,13 @@ async function applyMatchWinnerEconomy( userBlue: number | null, winnerId: number, entryFee: number, - prizeCc: number + prizeCc: number, + betFeePercent: number ): Promise { const ids = [...new Set([userRed, userBlue].filter((x): x is number => x != null && x >= 1))]; if (ids.length === 0) return null; - const rcPrize = computeRcPrizeFromEntryFee(entryFee); + const rcPrize = computeRcPrizeFromEntryFee(entryFee, betFeePercent); const { data: rows, error: selErr } = await supabase.from('users').select('id, rc, cc').in('id', ids); if (selErr) return selErr.message; @@ -439,6 +495,8 @@ export function registerMatchRoutes( return; } + const betFeePercent = await getBetFeePercentFromSettings(settings); + const { data: updated, error: updErr } = await supabase .from('matches') .update({ winner_id: winnerId }) @@ -461,7 +519,15 @@ export function registerMatchRoutes( return; } - const payErr = await applyMatchWinnerEconomy(supabase, userRed, userBlue, winnerId, entryFee, prizeCc); + const payErr = await applyMatchWinnerEconomy( + supabase, + userRed, + userBlue, + winnerId, + entryFee, + prizeCc, + betFeePercent + ); if (payErr != null) { console.error('matches: economy after winner failed', matchId, payErr); await supabase.from('matches').update({ winner_id: null }).eq('id', matchId).eq('winner_id', winnerId); @@ -469,7 +535,7 @@ export function registerMatchRoutes( return; } - const rcPrize = computeRcPrizeFromEntryFee(entryFee); + const rcPrize = computeRcPrizeFromEntryFee(entryFee, betFeePercent); res.json({ ok: true, id: matchId, diff --git a/schemas/table_settings.md b/schemas/table_settings.md new file mode 100644 index 0000000..51e2665 --- /dev/null +++ b/schemas/table_settings.md @@ -0,0 +1,5 @@ +create table public.settings ( + key character varying not null, + value character varying not null, + constraint settings_pkey primary key (key) +) TABLESPACE pg_default; \ No newline at end of file