* add `String.isUUID()` and game `gameId` in Chat nullable
* refactor `String.isUUID()`
* use `java.util.UUID` for better validation
* use `UUID` as `ChatStore` key
* make `gameId` nullable only for responses
* fix reversed logics
* introduce `isValidPlayerUuid()` and `isValidGameUuid()`
* fix `WebSocketSessionManager` session management
* refactor & simplify `UncivServer.jar`
* make `gameIdToChat` a `synchronizedMap`
* make `checkAndReturnUuiId()` nullable
* remove redundant imports
* revert `IDChecker` changes
* basic chat ui
* improve chat infustructure
* implement websockets
* fix TODO crash
* delkt fixes & minor refactoring
* refactor civColor lookup
* set `ChatPopup` `Scrollability` to `None`
* refactor `chatLabel`
* move `ChatButton` update actions to its own file and refactor `WorldScreen`
* refactor `ChatPopup` - make it simple
* add `ChatPopup` layout explaination
* make `CloseButton` an `ImageButton`
* update .gitignore, try to ensure correct civName, close previous session on reconnect
* better `Message.Join()` usage
* update .gitignore entry for lasterror.txt
* improve chat message handling and color visibility
* refactor chat auth header handling and event filtering
* connection reliability improvements
* global messages for System and Server messages
* set `chatTable` cell defaults
* make flow work. remove internal keywords. fix chain job cancellation bug. extensively tested.
Made flow work, SomeHow.
Remove `internal` keywords, problematic.
One reconnect cancels another. This cancellation triggers another reconnect. Thus we get stuck in an infinite reconnect loop.
This was fixed by the force flag.
* added `Color.coerceLightnessAtLeast` and many comments
* faster `Color.coerceLightnessAtLeast`
* wait for `session` in `ChatWebSocketManager.requestMessageSend()`
* refactor some imports and simplify `ChatButton.updatePosition`
* move `Color.coerceLightnessAtLeast` with other `Color` extension functions
* remove `Event` suffix from event names and move events and files to better locations
* refactor multiplayer event handling and move event classes
Moved ServerUrlChanged, UserIdChanged, and PasswordChanged event classes from multiplayer/storage to models/metadata. Updated event dispatch logic for userId, server URL, and password changes to be handled within GameSettingsMultiplayer. Introduced ServerFeatureSetChanged event for feature set updates. Refactored usages and imports across chat, UI, and multiplayer modules to reflect these changes and removed redundant event dispatches.
* move `ServerFeatureSetChanged` to `ServerFeatureSet.kt`
* add chat and send icons, update atlas and chat ui elements
* make `Enter` key press work
* remove `yield()` calls
* refactor `WebSocket` error handling conditional branches
* remove unnecessary `ChatMessageSendRequested` event
* remove flow and reintroduce `yeild()`
* add translatable lines to `English.properties` and call `tr()`
* increase first session waiting time to `RECONNECT_TIME_MS * 2`
* add dynamically translatable global messages
* handle errors on `GlobalScope.launch`
* refactor `chatUrl` to `getChatUrl()` and remove the `yeild()` call after `delay()`
* add `ChatRestartException`
* implemented exponential backoff
* refactor chat error logging in `handleWebSocketThrowables`
* refactor `globalMessages` and revert unnecessary changes
* mark global messages as one time
* mark global messages that I forgot about as one time
* remove unnecessary event usage
* some necessary refactorings
1. start / stop chat based on `ChatButton` visibilty
2. fix `restart()` calls with `force = true` where needed
3. remove `try-catch` block from `restart()`
* fix websocket reconnection issues
* fix missing `}`
* fix problems for real
* fix import
* use `maxOf()`
* minor refactorings
* add support for `UncivServer.jar`
* get rid of `EventBus`
* rename and increase value to `60%` for `CIVNAME_COLOR_MIN_LIGHTNESS`
* get rid of setters
* fix 1
* fix `checkServerStatus()` not calling `setServer()`
* fix some issues
* fix crashes and remove redundant `ChatMessageReceived` data class
* fix some reviews
* remove `re-established` notification
* set type for `globalMessages` to `Queue`
* improve stability of `UncivServer.jar`
* Added ConditionalWhenBetweenStatResource unique
* Currently the ConditionalBetweenHappiness function only applies to Happiness. Wouldn't it be more better if it could also be extended to other stats and resources. 😊
* Resolved the issue with ConditionalWhenAboveStatResource, ConditionalWhenBelowStatResource, and their modified speed versions not functioning properly on city-level stats (food & production).
This new unique has been tested using the following examples:
1. In GlobalUniques.json:
- "[+12]% [Gold] [in all cities] <when between [1] to [100] [Gold]>",
- "[+24]% [Gold] [in all cities] <when between [1] to [100] [Gold] (modified by game speed)>",
2. In Buildings.json:
- "[+12]% [Production] [in this city] <when between [1] to [5] [Production]>",
- "[+12]% [Food] [in this city] <when between [1] to [5] [Food]>",
* Update uniques.md
* Correct english mistake of the new unique
* Refactor checkResourceOrStatAmount function
* Unified all related functions into one
* ci: improved detekt configuration
it still needs some work but it's getting there
* detekt: separated errors from warnings
Detekt doesn't currently have a mechanism for failing only on specific issues
workaround suggested by the maintainer of Detekt
* rebased on master
* fix: resolve ExplicitItLambdaParameter
* fix: fix last star import
* Add serialization version to GameInfo
* Add handling of incompatible saves due to a dfiferent save version
* Fix compilation?
* Fix ios compilation
* Refactor: Make it clearer that GameInfo serialization version is only supposed to be incremented when it's guaranteed to cause issues & rename to compatibility version
* Update initial version
* Update initial version
* Fix merge mistake
* Make popups and text fields nicer to interact with on Android
* Refactor: Rename createTextField to UncivTextField.create
* Fix multiplayer save delete text
* 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>
* Add some very small Quality-of-Life improvements for multiplayer games
- GameInfo.kt
- Add timestamp for the start of the last turn to save info, hopefully
this will enable a multiplayer turn timer in the near future
- MultiplayerScreen.kt
- Current turn indicator for multiplayer games now shows for how long it
has been the current player's turn.
- WorldScreen.kt
- Next Turn Action will display which player we are waiting for rather
than the generic "Waiting for other players..."
* Update text for translations and add better elapsed times
template.properties
- Add translation templates for waiting turn information
German.properties
- Provide German translation for waiting turn info
Japanese.properties
- Provide Japanese translation for waiting turn info
MultiplayerScreen.kt
- Add translation brackets for waiting turn info
- Add a function which determines whether to represent
elapsed time in Minutes, Hours, or Days (and does so)
WorldScreen.kt
- Add translation brackets for waiting turn info
* Fix line translated endings as per request
MultiplayerScreen.kt
- Translation for the "Last refresh:/Current Turn:" display no longer
includes line endings
- "Last refresh:/Current Turn:" display now uses LF line endings only
* Show generic "Waiting for" message in single player
WorldScreen.kt
- Place an additional condition for getNextTurnAction which selects the
generic "Waiting for" message in single player and the civ-specific
one in multiplayer
Co-authored-by: Colin S. Vanden Heuvel <colin.vandenheuvel@wisc.edu>
Follow-up to #5017 ? Better?
- That GameSettingsOld.json was from my predecessor account 17 months ago, an unwitting inclusion of a change meant for local use only.
- Maybe inform Collaborators that `.git/info/exclude` is the correct place for 'personal' exclusions...
* Adding units to map editor.
* loadScenario checkbox Prototype added to MapOptions table.
* adds switch for Scenario and Unit editor debug
* New Scenario class
* Background step1:
1. Create a new class Scenario, containing TileMap, GameParameters and string name (doesn't really matter where, we can move it around later)
2. Create SaveScenario and LoadScenario functions in MapSaver (save to/ load from scenario name)
* Prototype of Save/Load scenario implementation.
* Add update method to NewGameOptionsTable
* First working Save/Load scenario prototype
* First working prototype of Load/Save scenario
* Added test conditions for the new debug modes
* Resolve merge conflict
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* .gitignore: mods SaveFiles transients
* Simple transposition prevents mod improvements from appearing below roads&removals
should also move modded nations to the top in new game player picker
* Reworked Notification service to remove Nullpointer crashes due to non-final static variables being null. Instead moved all state to Worker specific architecture. Also switched to Android based localization because core-based one can be unavailable to worker.
* Added missing blanks
* Added more internationalization
Added missing androidX declaration (neccessary for newer Gradle versions)
Updated Gradle for new Android Studio Version
* Optimization
* Removed missing translations error