* 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
* 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
* 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
* 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
* 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>
* 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
* 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
* 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 :)
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
* 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
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.
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