Commit Graph

59 Commits

Author SHA1 Message Date
Yair Morgenstern
a999ba8f28
Gradle 8.2->8.7, AGP 8.2.2->8.5.0 (#12325)
* Gradle 8.2->8.7, AGP 8.2.2->8.5.0

* *Conditionally* add android project only if ANDROID_HOME is set
2024-10-22 21:53:30 +03:00
yairm210
c6fc6a2078 Docker build doesn't like linking version numbers of plugins 2024-09-05 22:00:34 +03:00
yairm210
c9f5b94993 Update gradle libraries 2024-09-05 21:50:18 +03:00
Yair Morgenstern
52a9eebe28 Gradle 8.2, remove all IOS references due to robovm bug (which we don't use) 2024-01-28 12:35:29 +02:00
Yair Morgenstern
927aa8a788 chore: Updated LibGDX to 1.12.1 2023-11-04 23:03:47 +02:00
Yair Morgenstern
e8c740da31 build: unify coroutines version to buildconfig variable 2023-09-06 15:20:32 +03:00
Yair Morgenstern
0c089f0e6d Revert "build: Kotlin plugins tied to kotlin version"
This reverts commit d7ccc11d8c.
2023-09-06 12:24:33 +03:00
Yair Morgenstern
4081b76025 build: removed 'testImplementation' double-imports for tests project 2023-09-06 12:18:31 +03:00
Yair Morgenstern
adbbb18685 build: remove unused mockk library 2023-09-06 12:11:55 +03:00
Yair Morgenstern
d7ccc11d8c build: Kotlin plugins tied to kotlin version 2023-09-06 12:05:07 +03:00
Yair Morgenstern
66eed083f2 Fixed broken build 2023-06-23 09:26:53 +03:00
Yair Morgenstern
e4e997a189 Remove GWT dependency which is broken 2023-06-23 09:10:09 +03:00
Crsi
bd3aa54670
Multiplayer v2: networking stack, dependencies & API definition (#9589)
* Added new ktor dependency for developing multiplayer API v2

* Added the api package, including endpoint implementations, cookie helpers, serializers and structs

* Fixed a bunch of problems related to error handling

* Fixed some API incompatibilities, added getFriends() method

Rename the Api class to ApiV2Wrapper, added a chat room screen

Replaced logging dependency, renamed the endpoint implementations

* Dropped the extra logger to remove dependencies, added the APIv2 class

* Restructured the project to make ApiV2 class the center

* Improved chat handling, added server game detail caching

Added a generic HTTP request wrapper that can retry requests easily

Added a default handler to retry requests after session refreshing

* Updated the API structs based on the new OpenAPI specifications

Switched endpoint implementations to use the new 'request', updated WebSocket structs

* Updated the auth helper, added the UncivNetworkException

Fixed some more issues due to refactoring APIv2 handler

Fixed some issues and some minor incompatibilities with the new API

* Implemented the LobbyBrowserTable, added missing API endpoint

Fixed login and auth issues in the main menu screen

* Added new WebSocket structs for handling invites and friends

Updated the API reference implementation

* Added GET cache, allowed all WS messages to be Events, added missing endpoints

Added func to dispose and refresh OnlineMultiplayer, only show set username for APIv2

* Reworked the ApiV2 class to improve WebSocket handling for every login

Added small game fetch, fixed lobby start, some smaller fixes

* Change the user ID after logging in to fix later in-game issues

Attention: Afterwards, there is restoration of the
previous player ID. Therefore, it won't be possible to
revert back to APIv0 or APIv1 behavior easily (i.e., without
saving the player ID before logging in the first time).

Added serializer class for WebSocket's FriendshipEvent enum

Fixed chat room access and cancelling friendships

* Fixed WebSocket re-connecting, outsourced configs

Updated the RegisterLoginPopup to ask if the user wants to use the new servers

Implemented a self-contained API version check with side-effects

Fixed various problems with WebSocket connections

Don't show kick button for lobby owner, handle network issues during login

* Added English translations for ApiStatusCode, fixed broken APIv1 games for uncivserver.xyz

Fixed subpaths in baseUrl, added server settings button

* Added WS-based Android turn checker, added a new event channel, fixed APIWrapper

Added a logout hook, implemented ensureConnectedWebSocket

Merge branch 'master' into dev

* Throttle auto-reconnect for WS on Android in background, added reload notice for your turn popup

Implemented real pinging with awaiting responses, fixed ping-related problems

* Adapted new getAllChats API, added outstanding friend request list, improved styling

* Added the ApiVersion enum and the ApiV2 storage emulator

* Updated the APIv2 file storage emulator

* Replaced all wildcard imports with named imports
2023-06-18 18:17:59 +03:00
Yair Morgenstern
26f0fc74eb
chore: Android Gradle Plugin upgrade (7.3.1 -> 7.4.2) (#9564) 2023-06-11 12:42:36 +03:00
Yair Morgenstern
a4fb6a1701 4.6.17 2023-06-03 23:04:24 +03:00
alexban011
0d05a658df
ci: added Detekt code analysis (#9322)
* ci: added Detetk code analysis

* ci: made some configs, removed report generation and renamed yml file
2023-05-10 11:46:16 +03:00
Crsi
5e88dbd7a1
Extended CI with various extra tests, added Java 17 support in unit tests (fixes #8835) (#8839)
* Added a pure build stage with various versions

* Added build artifacts from GitHub CI

* Upgrade mocking and testing libraries

* Extended GitHub CI test stages, added Windows tests

* Fixed job name

* Split some jobs for increased speed due to better parallelism
2023-03-08 16:39:32 +02:00
Yair Morgenstern
d59bcb42c6 Android Studio does not support Gradle above 7.3.1 2023-02-06 16:33:43 +02:00
lishaoxia1985
4b2d4a3877
Gradle update, offerButton.isEnabled = false in initial (#8600) 2023-02-06 14:21:46 +02:00
Yair Morgenstern
f04297acfd Removed use of Anuken packr, removing windows32 builds. 2022-10-12 23:39:57 +03:00
lishaoxia1985
f3a4340348
update Chinese mirrors for dependent libraries (#7720) 2022-08-29 07:34:49 +03:00
Timo T
83d5d1ab36
Add a simple GDX application to help with developing UI components (#7411)
* Add a simple GDX application to help with developing UI components

* Add UI development docs
2022-07-13 21:58:43 +03:00
Timo T
08cede4f5a
Fix OutOfMemoryError when loading a game and another is already loaded (#7306)
* Fix OutOfMemoryError when loading a game and another is already loaded

* Fix merge error...
2022-07-01 09:34:33 +03:00
Timo T
bc9a42e452
Save uncaught exception to file (#7247)
* Refactor: Rename GameSaver to UncivFiles

* Save last uncaught exception to file

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-06-25 22:30:27 +03:00
Timo T
ea03b97639
#6914 Multiplayer Status Display (#6916)
* Handle subclassing of Events properly

Previously, you could only listen to the exact class

* Add relevant parent classes for the multiplayer events

* Refactor: use the old name as the main name in MultiplayerGameNameChanged event

* Add being able to stop listening to events in the EventBus

* Add tests for EventBus

* Refactor: Extract GameList into standalone file

* Refactor: safeUpdateIf to more generic throttle function

* Refactor: Extract multiplayer UI helper functions into separate file

* Refactor: Extract load/download multiplayer game into logic class from UI

* Make loading a multiplayer game automatically update the in-memory game in OnlineMultiplayer

* Refactor: Extract multiplayer settings into separate object

* Add multiplayer status display

* Fix error with multiplayer games not correctly being cleaned up after successful update

* Prevent loadLatestMultiplayerState() while next turn update is running

* Show "Working..." while waiting for next turn calculations instead of "Waiting for [civ]..."

* Fix race condition while updating online game state
2022-05-25 22:22:58 +02:00
SomeTroglodyte
3d6a01d633
Build warnings cleanup (#6827) 2022-05-19 02:12:18 +02:00
Timo T
df9b62ff6f
Fix coroutines not being added to desktop:dist (#6822)
* Use kotlin coroutines instead of raw threads (+ refactorings)

Equal to f8e0f572

* Fix coroutine class files not being added to desktop:dist
2022-05-17 08:37:12 -07:00
Yair Morgenstern
7ef2bbc56c Revert "Use kotlin coroutines instead of raw threads (+ refactorings) (#6801)"
This reverts commit f8e0f572
2022-05-15 19:20:23 +03:00
Timo T
f8e0f572e4
Use kotlin coroutines instead of raw threads (+ refactorings) (#6801)
* Refactor: Move classes into their own files

* Handle 404 FileNotFound in UncivServer

* Refactor: Rename method

* Make GameSaver.saveGame throw the exception by default if it is not handled

* Add possibility to work with FileHandles in GameSaver

* Make OnlineMultiplayerGameSaver load the multiplayerServer setting each time it does something

This theoretically makes it unnecessary for the OnlineMultiplayerGameSaver to be re-instantiated each time it is used

* Refactor: Remove duplicated code

* Refactor: Extract NextTurnButton from WorldScreen

* Refactor: Remove WorldScreen-specific code from OptionsPopup

* Use kotlin coroutines everywhere instead of plain threads

This probably also cuts down on our raw thread usage, improving performance, since we now use a cached thread pool (in addition to coroutines being able to reuse threads anyway)

* Improve deep load from notification

* Refactor: Give music download coroutine the proper name
2022-05-15 00:52:45 +03:00
Yair Morgenstern
1ca1342816 Upgraded to libGDX 1.11.0 - resolves #6609, resolves #5679
Also cleaned up the build.gradle file
2022-05-13 15:16:54 +03:00
SomeTroglodyte
4290373cf1
Move UncivServer to own module (and jar) (#6468)
* Move UncivServer to own module (and jar)

* UncivServer isalive logged

* Separate UncivServer - some wiki hints

* Separate UncivServer - how to build UncivServer.jar

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-05-08 21:22:43 +03:00
Timo T
ceeb547fb8
Create turn notifier for when the game is running for Windows (#6682)
* Create turn notifier for when the game is running for Windows

If playing on Desktop, you often put the game into background, but still want to know if it's your turn. A standard Windows function for that is `FlashWindow` from winuser.h, which is implemented here

* Fix: Use the window from the listener instead of the static one from libGDL

* Only notify if it's the turn of the player that is playing

* Always notify spectators of the next players' turn

* Refactor: Move notifier into GeneralPlatformSpecificHelpers

* Only load Windows DLL when we're actually on Windows
2022-05-06 08:42:30 +03:00
Tang
ee1af44809
Update UncivServer: (#6427)
- Add `clikt` lib.
- Add custom multiplayer file's folder.
2022-03-28 17:36:42 +03:00
Yair Morgenstern
2b1251258c
Unciv server (#6384)
* Background implementation for Unciv server with ktor.

Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.

* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today

* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!

* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!

* Documentation for running and using the server

* Better texts, translations, etc

* Trog is right this should be a PUT not POST
2022-03-21 21:05:02 +02:00
Yair Morgenstern
16855f66f6
Gradle build tools upgrade (#6085)
* Gradle build tools upgrade
Apparently the magic is rewriting a specific line in the Android build file and downloading Android SDK 30.0.3

* Added wiki change, isn't that nice :)
2022-01-31 15:05:42 +02:00
Yair Morgenstern
45e96b948a
Gradle build tools upgrade (#6084)
Upgrading to 7.1 gives us the fun java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel) error so let's not
2022-01-31 14:27:30 +02:00
Yair Morgenstern
a1e0b686b1
Upgrading to LWJGL 3, which is now the default, as of LibGDX 1.10.1 (#5614)
* Upgrading to LWJGL 3, which is now the default, as of LibGDX 1.10.1
MacOS running problem solved by adding JVM args to desktop build.gradle
Should resolve #5601

* Apparently, keyTyped is ONLY for character keys. Esc and f12 are non-character keys, so we need to change from keyTyped to keyDown.
How does this affect out ctrl combinations? Dunno yet :) I couldn't find any actual uses in code, but it shouldn't be worse than keyTyped
This commit can be cherry-picked into the master branch as a preparation for the move to lwjgl3
2021-11-03 00:15:47 +02:00
yairm210
1530389507 3.16.13 2021-09-08 23:19:07 +03:00
Yair Morgenstern
f3a8188cb1
Kotlin 1.5.30 test (#5089)
* Kotlin bump to 1.5.30

* Needed change due to (correct!) new compile error
2021-09-05 00:28:21 +03:00
SomeTroglodyte
5403f28c77
Remove inactive server code and music (#5017) 2021-08-29 11:33:46 +03:00
yairm210
949f45497e Gradle upgrade! 2021-08-22 22:00:34 +03:00
yairm210
e26cae8738 Force kotlin reflect 1.4.30
Since the mockito upgrade didn't help
2021-08-20 16:02:44 +03:00
yairm210
5779bdaa4f Upgraded mockito versions.
Instead of forcing reflection to depend on latest kotlin version, I have a feeling the dependency is due to older mockito depending on older reflection.
2021-08-20 15:45:46 +03:00
yairm210
4e72cafc27 Removed manual kotlin-stdlib dependency
Kotlin 1.4+ auto-adds kotlin-stdlib dependency per https://kotlinlang.org/docs/whatsnew14.html#dependency-on-the-standard-library-added-by-default so we don't need it added manually.
Tested locally with ./gradlew desktop:dist and the jar worked.
2021-08-20 13:37:35 +03:00
yairm210
7da4056392 Kotlin 1.4+ auto-adds kotlin-stdlib dependency per https://kotlinlang.org/docs/whatsnew14.html#dependency-on-the-standard-library-added-by-default so we don't need it added manually.
Tested locally with ./gradlew desktop:dist and the jar worked.
2021-08-20 13:18:50 +03:00
yairm210
558c1fb662 Revert "Gradle wrapper upgrade"
Checking the Github actions shows that this doesn't seem to work with the current Github actions due to version confllicts, we'll need to resolve those
2021-08-15 00:13:54 +03:00
yairm210
2161790f13 Gradle wrapper upgrade 2021-08-13 00:54:46 +03:00
Yair Morgenstern
3a22a1127e Gradle upgrade 2021-05-07 13:18:48 +03:00
Yair Morgenstern
57fdff6897 Gradle changes towards LibGDX version increment 2021-04-19 21:41:47 +03:00
lishaoxia1985
b5c12ec17c
Carrier cannot attack, AS update to 4.1.3 (#3700) 2021-03-23 20:20:38 +02:00