Skip to content

Commit 6272f7c

Browse files
committed
feat: Add two-stage confirmation for breaking alliances
Implement safe-unally feature to prevent accidental alliance breaks: - Requires two clicks: first to initiate, second to confirm - Visual feedback with purple color on confirmation stage - Uses new TraitorIconConfirmWhite icon for confirm state - Maintains state between clicks using RadialMenuState - Menu stays open during confirmation flow - Comprehensive test coverage with 3 new test cases This prevents accidental ally breaks during intense gameplay while maintaining intuitive UX with clear visual indicators.
2 parents 0e187bd + 5993429 commit 6272f7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2178
-568
lines changed

API.md

Lines changed: 118 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## API Usage
1+
# API Usage
2+
3+
## Games
24

35
### List Game Metadata
46

@@ -40,8 +42,7 @@ curl "https://api.openfront.io/public/games?start=2025-10-25T00:00:00Z&end=2025-
4042
"type": "Singleplayer",
4143
"mode": "Free For All",
4244
"difficulty": "Medium"
43-
},
44-
...
45+
}
4546
]
4647
```
4748

@@ -75,7 +76,7 @@ curl "https://api.openfront.io/public/game/ABSgwin6?turns=false"
7576

7677
**Note:** Public player IDs are stripped from game records for privacy.
7778

78-
---
79+
## Players
7980

8081
### Get Player Info
8182

@@ -92,3 +93,116 @@ GET https://api.openfront.io/public/player/:playerId
9293
```bash
9394
curl "https://api.openfront.io/public/player/HabCsQYR"
9495
```
96+
97+
### Get Player Sessions
98+
99+
Retrieve a list of games & client ids (session ids) for a specific player.
100+
101+
**Endpoint:**
102+
103+
```
104+
GET https://api.openfront.io/public/player/:playerId/sessions
105+
```
106+
107+
**Example:**
108+
109+
```bash
110+
curl "https://api.openfront.io/public/player/HabCsQYR/sessions"
111+
```
112+
113+
## Clans
114+
115+
### Clan Leaderboard
116+
117+
Shows the top 100 clans by `weighted wins`.
118+
119+
**Endpoint:**
120+
121+
```
122+
GET https://api.openfront.io/public/clans/leaderboard
123+
```
124+
125+
Weighted wins have a half-life of 30 days to favor recent wins.
126+
127+
Weighted wins are calculated using the following formula:
128+
129+
```
130+
FUNCTION calculateScore(session: ClanSession, decay: NUMBER = 1) → NUMBER
131+
// 1. Calculate average team size
132+
avgTeamSize ← session.totalPlayerCount ÷ session.numTeams
133+
134+
// 2. Determine how much the clan contributed to their team
135+
// (clan players divided by average players per team)
136+
clanMemberRatio ← session.clanPlayerCount ÷ avgTeamSize
137+
138+
// 3. Apply decay factor (e.g., for older sessions)
139+
weightedValue ← clanMemberRatio × decay
140+
141+
// 4. Calculate match difficulty based on number of teams
142+
// More teams → harder to win → higher reward for victory
143+
// Uses square root to avoid extreme scaling
144+
difficulty ← MAX(1, √(session.numTeams - 1))
145+
146+
// 5. Return final score:
147+
// - Win: reward is multiplied by difficulty
148+
// - Loss: penalty is divided by difficulty (less punishment in harder matches)
149+
IF session.hasWon THEN
150+
RETURN weightedValue × difficulty
151+
ELSE
152+
RETURN weightedValue ÷ difficulty
153+
END IF
154+
END FUNCTION
155+
```
156+
157+
### Clan stats
158+
159+
Displays comprehensive clan performance statistics for a specified clan over a chosen time range. If no time range is provided, it shows lifetime stats (starting from early November 2025).
160+
161+
Key metrics include:
162+
163+
- Total games, wins, losses, and win rate
164+
- Win/loss ratio and weighted win/loss ratio\* broken down by:
165+
- Team type (e.g., 2 teams, 3 teams, duos, trios, etc)
166+
- Number of teams in the game (2 teams, 5 teams, 20 teams, etc)
167+
168+
**Note:** No decay is used, so weighted wins will be different from in the leaderboard.
169+
170+
**Endpoint**
171+
172+
```
173+
GET https://openfront.io/public/clan/:clanTag
174+
```
175+
176+
**Query Parameters:**
177+
178+
- `start` (optional): ISO 8601 timestamp
179+
- `end` (optonal): ISO 8601 timestamp
180+
181+
**Example**
182+
183+
```bash
184+
curl https://api.openfront.io/public/clan/UN?start=2025-11-15T00:00:00Z &
185+
end=2025-11-18T23:59:59Z
186+
```
187+
188+
### Clan Sessions
189+
190+
A clan session is created any time a player with that clan tag is in a public team game. If no start or end query parameter is provided, lifetime sessions (starting early November 2025) are shown.
191+
192+
**Endpoint**
193+
194+
```
195+
GET https://api.openfront.io/public/clan/:clanTag/sessions
196+
```
197+
198+
**Query Parameters:**
199+
200+
- `start` (optional): ISO 8601 timestamp
201+
- `end` (optonal): ISO 8601 timestamp
202+
203+
**Example**
204+
205+
```bash
206+
curl https://api.openfront.io/public/clan/UN/sessions?start=2025-11-15T00:00:00Z &
207+
end=2025-11-18T23:59:59Z
208+
```

CREDITS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ Licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)
2525

2626
## Icons
2727

28-
Icons from [The Noun Project](https://thenounproject.com/)
28+
### [The Noun Project](https://thenounproject.com/)
29+
30+
Stats icon by [Meko](https://thenounproject.com/mekoda/)https://thenounproject.com/icon/stats-4942475/
-11 Bytes
Loading

map-generator/assets/maps/mena/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"coordinates": [1409, 372],
54-
"name": "Palestinian Territory",
54+
"name": "Palestine",
5555
"strength": 1,
5656
"flag": "ps"
5757
},

0 commit comments

Comments
 (0)