Skip to content

Commit ed71be8

Browse files
committed
Merge remote-tracking branch 'myfork/flopinguin-fix-nation-relation-exploit' into flopinguin-fix-nation-relation-exploit
2 parents f3d4ab2 + 543d0bb commit ed71be8

File tree

202 files changed

+7069
-2520
lines changed

Some content is hidden

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

202 files changed

+7069
-2520
lines changed

.github/workflows/pr-description.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
// Get the pull request data
7474
const milestone = context.payload.pull_request.milestone;
7575
if (!milestone) {
76-
core.setFailed('❌ Pull request must have a milestone assigned before merging.');
76+
core.setFailed('❌ Reviewer must assign a Milestone to this Pull request before merging.');
7777
return;
7878
}
7979
console.log(`✅ Milestone found: ${milestone.title}`);

API.md

Lines changed: 102 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

@@ -108,3 +109,100 @@ GET https://api.openfront.io/public/player/:playerId/sessions
108109
```bash
109110
curl "https://api.openfront.io/public/player/HabCsQYR/sessions"
110111
```
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/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
},
8888
{
8989
"coordinates": [1094, 1093],
90-
"name": "Democratic Republic of the Congo",
90+
"name": "DR Congo",
9191
"strength": 2,
9292
"flag": "cd"
9393
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
},
154154
{
155155
"coordinates": [517, 1483],
156-
"name": "People's Democratic Republic of Algeria",
156+
"name": "Algeria",
157157
"strength": 1,
158158
"flag": "dz"
159159
},
1.6 MB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "Four Islands",
3+
"nations": [
4+
{
5+
"coordinates": [403, 1296],
6+
"flag": "",
7+
"name": "Korinthal",
8+
"strength": 2
9+
},
10+
{
11+
"coordinates": [1152, 1251],
12+
"flag": "",
13+
"name": "Lunareth",
14+
"strength": 2
15+
},
16+
{
17+
"coordinates": [1328, 322],
18+
"flag": "",
19+
"name": "Sylvoria",
20+
"strength": 2
21+
},
22+
{
23+
"coordinates": [114, 121],
24+
"flag": "",
25+
"name": "Myrkwind",
26+
"strength": 2
27+
}
28+
]
29+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"coordinates": [1609, 1837],
72-
"name": "People's Republic of Algeria'",
72+
"name": "Algeria'",
7373
"strength": 2,
7474
"flag": "dz"
7575
},

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
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"coordinates": [143, 37],
72-
"name": "Lao People's Democratic Republic",
72+
"name": "Lao PDR",
7373
"strength": 1,
7474
"flag": "la"
7575
},
@@ -99,7 +99,7 @@
9999
},
100100
{
101101
"coordinates": [834, 215],
102-
"name": "Federated States of Micronesia",
102+
"name": "Micronesia",
103103
"strength": 1,
104104
"flag": "fm"
105105
},

0 commit comments

Comments
 (0)