Skip to content

Commit d0df602

Browse files
committed
Merge branch 'master' into feat/dataset-loger-improvements
2 parents 6244af4 + 5a345da commit d0df602

15 files changed

+27
-92
lines changed

megamek/docs/history.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ MEGAMEK VERSION HISTORY:
2929
+ Fix #6751: Princess will now deploy mines on her turn instead of at the start of the phase.
3030
+ PR #6829: Expanded MathUtility Integer Parsing
3131
+ PR #6832: Corrects custom armor calculation required for megameklab#1820 that fixes megameklab#1808: Conventional infantry custom armor not appearring on record sheet
32-
+ PR #6835 Fixed issue with Ammo Counts showing 0 when configuring from Lobby
32+
+ PR #6835: Fixed issue with Ammo Counts showing 0 when configuring from Lobby
33+
+ PR #6837: Removes broken event from server
3334

3435
0.50.04 (2025-03-22 1600 UTC)
3536
+ PR #6494: Cap splashscreen button width

megamek/src/megamek/ai/dataset/TabSeparatedValueSerializer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitActionField.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitActionSerializer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitAttackAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitAttackField.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitAttackSerializer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitState.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitStateField.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/dataset/UnitStateSerializer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/utility/EntityFeatureUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

megamek/src/megamek/ai/utility/Memory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2024-2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*

megamek/src/megamek/server/Server.java

-78
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,12 @@
5050
import megamek.Version;
5151
import megamek.client.ui.swing.util.PlayerColour;
5252
import megamek.codeUtilities.StringUtility;
53-
import megamek.common.Coords;
5453
import megamek.common.Game;
5554
import megamek.common.IGame;
5655
import megamek.common.Player;
5756
import megamek.common.Roll;
5857
import megamek.common.annotations.Nullable;
5958
import megamek.common.commandline.AbstractCommandLineParser.ParseException;
60-
import megamek.common.enums.GamePhase;
61-
import megamek.common.event.GameListenerAdapter;
62-
import megamek.common.event.GamePhaseChangeEvent;
6359
import megamek.common.icons.Camouflage;
6460
import megamek.common.net.connections.AbstractConnection;
6561
import megamek.common.net.enums.PacketCommand;
@@ -1369,80 +1365,6 @@ protected void handle(int connId, Packet packet) {
13691365

13701366
private void wargamesResponse() {
13711367
sendServerChat(WARGAMES_RESPONSE);
1372-
wargamesAttack(3, new Random().nextInt(5, 13));
1373-
}
1374-
1375-
private void wargamesAttack(int rounds, int numberOfStrikes) {
1376-
if (rounds <= 0) {
1377-
return;
1378-
}
1379-
1380-
if (this.getGame() != null && this.getGame().getBoard() != null) {
1381-
int height = this.getGame().getBoard().getHeight();
1382-
int width = this.getGame().getBoard().getWidth(); // Fixed width retrieval
1383-
1384-
Random random = new Random();
1385-
List<Coords> selectedCoords = new ArrayList<>();
1386-
1387-
int maxAttempts = 100;
1388-
int maxStrikes = rounds == 1 ? numberOfStrikes : new Random().nextInt(1, numberOfStrikes + 1);
1389-
for (int i = 0; i < maxStrikes; i++) {
1390-
Coords newCoord = null;
1391-
1392-
for (int attempt = 0; attempt < maxAttempts; attempt++) {
1393-
int x = random.nextInt(width);
1394-
int y = random.nextInt(height);
1395-
Coords candidate = new Coords(x, y);
1396-
1397-
boolean isValid = true;
1398-
for (Coords coords : selectedCoords) {
1399-
int dx = Math.abs(coords.getX() - x);
1400-
int dy = Math.abs(coords.getY() - y);
1401-
if (Math.max(dx, dy) <= 9) {
1402-
isValid = false;
1403-
break;
1404-
}
1405-
}
1406-
1407-
if (isValid) {
1408-
newCoord = candidate;
1409-
break;
1410-
}
1411-
}
1412-
1413-
if (newCoord != null) {
1414-
selectedCoords.add(newCoord);
1415-
} else {
1416-
break; // Stop if we can't find a valid coordinate
1417-
}
1418-
}
1419-
1420-
if (!selectedCoords.isEmpty()) {
1421-
sendServerChat("!!!WARNING!!! LAUNCH OF STRATEGIC WEAPONS DETECTED");
1422-
sendServerChat("!!!WARNING!!! LAUNCH OF STRATEGIC WEAPONS DETECTED");
1423-
sendServerChat("!!!WARNING!!! LAUNCH OF STRATEGIC WEAPONS DETECTED");
1424-
}
1425-
1426-
for (Coords coords : selectedCoords) {
1427-
numberOfStrikes--;
1428-
processCommand(SERVER_CONN, "/ob " + coords.getX() + 1 + " " + coords.getY() + 1);
1429-
sendServerChat("DANGER ZONE: Incoming strategic strike at " +
1430-
(coords.getX() + 1) +
1431-
", " +
1432-
(coords.getY() + 1));
1433-
}
1434-
}
1435-
1436-
final int strikesRemaining = numberOfStrikes;
1437-
this.getGame().addGameListener(new GameListenerAdapter() {
1438-
@Override
1439-
public void gamePhaseChange(GamePhaseChangeEvent e) {
1440-
if (e.getNewPhase() == GamePhase.PREMOVEMENT) {
1441-
wargamesAttack(rounds - 1, strikesRemaining);
1442-
getGame().removeGameListener(this);
1443-
}
1444-
}
1445-
});
14461368
}
14471369

14481370
/**

megamek/unittests/megamek/common/EntityFeatureUtilsTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*
2-
* Copyright (C) 2017-2025 The MegaMek Team. All Rights Reserved.
2+
* Copyright (C) 2025 The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MegaMek.
55
*
6+
*
67
* MegaMek is free software: you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License (GPL),
89
* version 3 or (at your option) any later version,

0 commit comments

Comments
 (0)