Commit graph

1198 commits

Author SHA1 Message Date
Oleg Agafonov
9ad456239e GUI: stack - added card icon with targets info (announced and triggered targets, target choices); 2023-12-23 16:26:37 +04:00
Oleg Agafonov
d97b034711 cheats: fixed broken emblem commands (example: emblem:Human:ElspethSunsChampionEmblem:1) 2023-12-16 02:25:03 +04:00
ssk97
6cd8649857
GUI: lobby - improved details info about match (#11438) 2023-12-09 16:35:09 +04:00
Oleg Agafonov
6aaaa8cb46 GUI: improved main and battlefield menus (related to #11533):
- main menu: better naming for deck editor;
- battlefield menu: added deck view for computer players, better naming;
- network: improved experimental connection;
2023-12-09 15:20:29 +04:00
Oleg Agafonov
960e896903
Network upgrade and new reconnection mode (#11527)
Network upgrade and new reconnection mode:
* users can disconnect or close app without game progress loose now;
* disconnect dialog will show active tables stats and additional options;
* all active tables will be restored on reconnect (tables, tourneys, games, drafts, sideboarding, constructing);
* user must use same server and username on next connection;
* there are few minutes for reconnect until server kick off a disconnected player from all player's tables (concede/loose);
* now you can safety reconnect after IP change (after proxy/vpn/wifi/router restart);

Other improvements and fixes:
* gui: main menu - improved switch panel button, added stats about current tables/panels;
* gui: improved data sync and updates (fixes many use cases with empty battlefield, not started games/drafts/tourneys, not updatable drafts, etc);
* gui: improved stability on game updates (fixes some random errors related to wrong threads);
* server: fixed miss messages about player's disconnection problems for other players in the chat;
* refactor: simplified and improved connection and network related code, deleted outdated code, added docs;
* tests: improved load test to support lands only set for more stable performance/network testing (set TEST_AI_RANDOM_DECK_SETS = PELP and run test_TwoAIPlayGame_Multiple);
2023-12-07 20:56:52 +04:00
Oleg Agafonov
57a556105c Merge fix 2023-12-03 00:32:25 +04:00
Oleg Agafonov
1641698584 GUI: fixed mana symbols in add lands cheat command 2023-12-03 00:24:22 +04:00
Oleg Agafonov
eaa510b265 GUI: added restriction card icon to permanent (contains all applied restrictions and requirements, #7471) 2023-12-03 00:01:47 +04:00
Oleg Agafonov
0b0e947741 connection: improved error processing and stability in connect dialog 2023-11-30 21:52:47 +04:00
Oleg Agafonov
01dd8c33ba gui: fixed possible game error with player timer on client side 2023-11-28 21:48:41 +04:00
Oleg Agafonov
1af601bf11 Merge fix 2023-11-28 08:14:01 +04:00
Oleg Agafonov
2eac541b80 gui: fixed broken watcher view mode (closes #11481) 2023-11-28 08:04:14 +04:00
Oleg Agafonov
c5632f6868 refactor: removed client side threads from a server, improved test log files rotation; 2023-11-27 18:13:05 +04:00
Oleg Agafonov
4500b79008 GUI: added changeable card popup mode for chats/logs by card name clicks (alternative to mouse wheel from game cards);
other: fixed duplicated chat popups in game, added miss error logs from popup related code, added additional checks for good code usage;
2023-11-26 12:48:41 +04:00
Oleg Agafonov
ab515e60fe refactor: removed outdated code with databases sync (cards db downloads from a server); 2023-11-25 18:11:44 +04:00
Oleg Agafonov
63290d3ed6 GUI: fixed not working card popup near screen border, improved card popup for chat and choose dialogs; 2023-11-25 17:27:59 +04:00
Oleg Agafonov
d1f9e9cc90 Improved stability and other related fixes:
* server: added limit to max chat message (related to #11285);
* gui: fixed possible error after auto-submit deck;
* gui: fixed possible error after end game dialog;
* refactor: other code improves;
2023-11-25 12:29:54 +04:00
Oleg Agafonov
53add71826 Improved network stability and other related fixes:
* server: fixed that a critical errors ignored in user commands threads (now it will be added to the logs);
* network: fixed frozen user responses in some use cases;
* network: fixed accidental and incorrect user responses (only latest response will be used now);
* network: improved freeze logs, added problem method name and code's line number;
* cheats: removed outdated deck and card load logic (only init.txt commands supports now);
* cheats: fixed wrong priority after add card dialog (closes #11437);
* cheats: improved stability and random errors on cheat executes (related to #11437);
* docs: added details on network and thread logic, human feedback life cycle, etc (see HumanPlayer, ThreadExecutorImpl);
2023-11-24 21:22:16 +04:00
Oleg Agafonov
5691ffa40e Merge fix 2023-11-23 09:32:07 +04:00
Oleg Agafonov
75958e3710 refactor: improved and reorganized client-server api, added additional logs, fixed miss admin checks for some commands 2023-11-23 09:12:02 +04:00
Oleg Agafonov
a4073a83c6 GUI: added custom tooltip support on mouse move over table's cell (related to #11438); 2023-11-22 07:37:04 +04:00
Oleg Agafonov
cb53ca4382 tests: render dialog - fixed not working tap/untap on double clicks 2023-11-22 00:25:41 +04:00
Oleg Agafonov
2bbe2b3c43 GUI - new card hints window features:
* new help window can be opened from a player panel;
* it collect and show all visible game hints from all players and all zones;
* it updates in real time on game update;
* allows to customize visible data;
* allows to open multiple windows (current limit is 5 windows, can be slow to render);
* allows to minimize opened windows;
* workable card popup on mouse move over card name or card id;
* filter modes:
  * all - show hints from all players;
  * player - show hints from single player;
* group mode:
  * by hints - show same hints as one with all used cards;
  * by cards - show full cards list with own hints;
* search mode:
  * allows to filter card hints by player name, card name, card id or card hint;
  * allows to search multiple words (equals to "or")
* current limitation:
  * card popup shows a card instead a real object, e.g. miss card hints in it (relelated to game logs problem);
  * unsupport of emblems, dungeons and other non card objects from a command zone;
  * unsupport of revealed and library's top cards;

GUI - player's panel improves:
* added hints helper button;
* added player hithlight as possible target in choose dialogs;
* improved player name button in small mode;
* fixed wrong height in small mode;

Other fixes:
* game logs: added card popup support for logs with custom object name;
2023-11-18 14:48:25 +04:00
Tirth Bharatiya
44b8a0faf4
refactor: improved code to increase readability. (#11418)
Moved the cardViewEquals method from CardPanelRenderModeMTGO to CardView
Decomposed conditional to increase readability.
Changed the variable/constant names to increase the readability.
2023-11-17 10:47:53 +04:00
Oleg Agafonov
3abdb72910
dev: improved code coverage (jacoco) and static analyser (sonar) support (#11367):
* fixed code coverage data lost on failed tests;
* fixed code coverage report duplication and improved performance;
* fixed that sonar analyser can't see code coverage for some modules;
* added new aggregation module: Mage.Reports (used for code coverage report generation);
* reorganized pom and added additional instructions for jacoco and sonar usage;
2023-10-30 09:19:12 +04:00
Oleg Agafonov
36ccfb0a2a Performance: fixed memory leaks on each card viewer or draft open (10 Mb per call, related to #11285, fixes #9548) 2023-10-14 12:39:49 +04:00
Oleg Agafonov
fe8b8e1def server: fixed npe error on load tests (miss buffer timer), code refactor 2023-10-11 14:15:15 +04:00
Susucre
b8ba2da23e
fix infoText of tournament causing NPE (#11290) 2023-10-09 15:25:30 -04:00
Susucre
f14479c53c
Add custom options for starting life total and starting hand size (#11259)
* add startHandSize / startLife to the custom option panel

* use the custom startLife/startHandsize in all Game Modes
2023-10-06 23:22:48 -04:00
Artemis Kearney
41874b0b4b
new feature: Emblem Cards (#10498)
* new feature: Emblem Cards

Allows match/tournament creator to specify cards to give each player
emblem versions of (or just the starting player for symmetric effects).

Technical details:
- new UI for specifying emblem cards (.dck files)
  - available for all match/tournament types
- new class `EmblemOfCard`
- new method `copyWithZone` on `AbilityImpl` (used to make abilities
  work from command zone)
- new fields on `GameOptions` and `MatchOptions` for emblem cards
- emblems are granted after mulligans, before first turn (technically
  after Planechase starting plane creation)

* fixes

* defaults for emblem cards in match options (fixes quick game buttons)

* minor fixes

* use DeckCardInfo instead of Card for emblem cards options

* restore accessible parent properties

* fix images for card emblems

* look up cards in a way that preserves which art

* fix typos; make Emblem.sourceObject protected

* add descriptions to planechase and emblem cards

* fixes

* add some unit tests for known working cards

* fix author name

* add explanation comment

* fix up tests

* copyWithZone: no longer modifies zone for singleton abilities

* directly check for MageSingleton
2023-09-26 22:47:13 -04:00
Oleg Agafonov
a3e5754d10 GUI: improved preferences dialog and battlefield:
* removed outdated storm counter button and settings (related cards must have same card hint);
* clean preferences dialog from empty events/actions;
* fixed logs folder names to release names in the labels;
2023-09-23 21:13:59 +04:00
Oleg Agafonov
abda1fb53b GUI: fixed wrong feedback panel status in computer games (related to #11189) 2023-09-22 11:00:47 +04:00
Oleg Agafonov
342979a55a
network: reworked client-server events (related to triggers dialog problem from #11173) (#11189)
* added bad connection mode to test client works on slow network, use -Dxmage.badconnection;
* added bad connection protection in events processing due event type;
* split events to different types (can be ignored, must be synced, etc);
* removed some unused server events.
2023-09-21 18:40:52 +04:00
Oleg Agafonov
9b634d44c6 server: fixed broken work on network's non-compress mode (-Dxmage.network.nocompress) 2023-09-18 12:05:55 +04:00
bobwoco
a7b06483ab
dev: added back concurrent and add dep comments, related to #11028 (#11059)
Co-authored-by: Ethan Ward <ethanandrewward@gmail.com>
2023-08-29 04:06:43 +04:00
ssk97
c50e913398
Add Smoothed London Mulligan option (#10965)
* Add Smoothed London Mulligan (similar to but weaker than MTGA's)

* Make SmoothedLondonMulligan extend LondonMulligan instead of copying code

* modified to be have no effect within +1/-1 of the expected lands
fixed tests by always putting nonchosen hand on the bottom

* Inherit the primary mulligan logic as well, add comments

* Make drawHand public and part of Mulligan, use it on opening 7
use Card::isLand instead of reimplementing it, remove unused imports
Use standard spacing

* Better account for half-land MDFCs

* Don't count TDFCs as half-lands

* Remove "crossover_point" calculation to make algorithm clearer

* Genericize the tests, undo changed access that's no longer needed, unbox bool

* Use standard case in function naming

* Add Override

* Add mulligan type to TableView info, add tourneyMatchOptions local variable
2023-08-27 15:08:27 -04:00
Ethan Ward
8f7b19a64d Remove old unused dependency 2023-08-26 19:35:05 -04:00
Susucre
5062c84098
Refactor: removed server side objects from a client side game's data (#10788)
* Clean original values transmitted with CardView.originalObject
* Move RateCard to mage.Common, support cardView as argument.
* Clean PermanentView constructor for TestCardRenderDialog
2023-08-24 12:04:07 +04:00
Susucre
8457ce31c5
fix the CardViewer not displaying tokens (#10789) 2023-08-13 14:10:48 -04:00
PurpleCrowbar
d9a23d505a
Add image number support for command objects (#10774) 2023-08-10 00:47:32 +01:00
Artemis Kearney
9ba0da00ff
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size

* extra deck handling in deckbuilder

* move responsibility for extraDeckCard boolean to CardImpl

* remove redundant field copy
2023-08-06 21:06:32 -04:00
Susucre
f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00
Alexander Novotny
519b3988be
game timer: Add chess-style buffer time option (#10598)
* UI Changes

* Add new buffer time options

* Main functionality

* Final implementation

Also added player UI for when they are using their buffer time (timer turns green)
2023-07-28 22:05:21 -04:00
Alexander Novotny
a36a7d9b7f
[LTR] Add Goldberry, River-Daughter (#10524)
* Added Goldberry

* Slight optimizaztion

* Happy Path Test

* More unhappy tests

* Sanity check for Goldberry's counter choices

* Updated player.getMultiAmount to support individual constraints

* Some cleanup

Also modified ResourcefulDefense to use new multi amount api

* Updated logging

* Added hint for number of counters

* Fixed issue with Resourceful Defense

* Improvements to defaults

Default list will properly make sure to stay within individual maximums
If a player is asked for a choice that isn't actually a choice because each choice's min and max are equal, instead the default response is immediately returned. This helps with situations like moving a counter off of Goldberry when she only has one counter on her.

* -1/-1 Counter test

* Fixed issue with -1/-1 counters

* Adjusted dialog to properly enforce constraints
2023-07-28 21:29:40 -04:00
Susucre
14235b6320
Rework Ring-bearer implementation. Add GUI + gamelogs. (#10596)
* Fix Ring-bearer choosing & add some GUI + logs

* use a ring svg in a separate gold panel

* use a fontawesome svg

* add a couple null checks, group icon with commander

* rework rinbearer logic according to review

* fix typo in game log

* small fixes
2023-07-12 19:40:09 -04:00
Alexander Novotny
fae63d9d4b
Add additional ability icons (#10549)
* Slightly revamped basic card icons

All icon classes which were just static text have been removed, and instead replaced with a static instance.

A new icon for reach has been added

Some icons have been reused for new abilities (hexproof for shroud and ward, infect for toxic)

When a card would have two icons of the same type, the icons are instead combines into one with a combined hover tooltip.

* Fixed missing capitalization on ward, hexproof
2023-07-04 01:22:07 +04:00
Oleg Agafonov
23d9fc50ba actual beta version instead release 2023-06-17 18:20:09 +04:00
Oleg Agafonov
94dfbdfed4 gui: fixed miss playable mark for emblems and other objects from command zone (example: momir emblem) 2023-06-17 17:32:02 +04:00
Alexander Novotny
76f30b3046
Added attachment controller info (#10440)
Fixes magefree/mage#9971
2023-06-09 05:34:26 +04:00
Evan Kranzler
60e488cf05
rename classes (#10383) 2023-05-17 18:49:30 -04:00