39 Commits

Author SHA1 Message Date
yairm210
2ddb278eec 4.19.13 2026-02-15 13:15:32 +02:00
yairm210
132195ad1a 4.18.0 2025-09-10 17:27:35 +03:00
yairm210
ee98075651 chore(purity) 2025-08-24 09:58:07 +03:00
Md. Touhidur Rahman
95eb97d517 Goodies before chat retention & UncivServer.jar Chat Session Management fixes (#13735)
* 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
2025-08-01 13:11:37 +03:00
Md. Touhidur Rahman
fdc7733054 Multiplayer Chat Support (#13599)
* 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`
2025-07-23 22:20:41 +03:00
yairm210
888a06cd0b chore: Hexmath purity round 1 2025-07-16 11:53:31 +03:00
yairm210
87c096b085 chore: Rename StateForConditionals -> GameContext 2025-07-14 11:43:18 +03:00
Md. Touhidur Rahman
3616a39caa Server Cleanup (#13598)
* update server dependencies and do necessary cleanup for chat support later

* resolve versions issue
2025-07-11 16:52:39 +03:00
SomeTroglodyte
f3c8e2d009 UniqueDocsWriter escapes examples that include conditionals (#13525)
* Escape`<>` in docDescription rendering, and don't glue the "Applies to" to its end

* gitignore mkdocs output
2025-06-28 22:51:09 +03:00
yairm210
f9d21d2767 Cache online mod list for fast load 2024-10-14 17:06:06 +03:00
Jeremy Woo
31931d3849 Added ConditionalWhenBetweenStatResource unique (#11212)
* 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
2024-03-05 22:40:27 +02:00
alexban011
841a1aa564 ci: improved detekt configuration and ci (#9380)
* 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
2023-05-14 21:55:36 +03:00
SomeTroglodyte
8f7db469b9 Little documentation cleanup (#9226) 2023-04-19 19:33:34 +03:00
Yair Morgenstern
b9299ac50d Pangaea maps are always largely land connected 2023-01-23 00:52:40 +02:00
Timo T
57ed61af41 Save compatibility handling (#7255)
* 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
2022-07-01 09:34:41 +03:00
Timo T
68cc4303ec Make popups and text fields nicer to interact with on Android (#7211)
* Make popups and text fields nicer to interact with on Android

* Refactor: Rename createTextField to UncivTextField.create

* Fix multiplayer save delete text
2022-06-22 09:32:20 +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
Yair Morgenstern
1430d7f89d Testing external changelog generation 2022-03-08 20:38:26 +02:00
Colin Vanden Heuvel
4c19347a89 Provide more information to waiting players in multiplayer (#5508)
* 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>
2021-10-25 19:09:03 +03:00
SomeTroglodyte
f3a53516da Update .gitignore (#5028)
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...
2021-08-30 14:12:07 +03:00
Yair Morgenstern
105d9690ff Resolved #3600 - multiplayer game reloading and screen resize no longer reset map zoom and position 2021-02-16 20:00:47 +02:00
Alexander Korolyov
c3da044c43 Adding units on map editor. (#2667)
* 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>
2020-06-13 22:53:04 +03:00
Daniel Bälz
47d7e8ef09 Gradle Kotlin DSL (#2634)
* Ease migration to Gradle Kotlin DSL by changing quotes, function calls and plugin definitions

* Migrate build scripts to Gradle Kotlin DSL
2020-05-19 00:14:01 +03:00
proteus-anguinus
c40dd09e11 Complex ruleset merge order (#2240)
* .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
2020-03-25 12:52:20 +02:00
wrov
9188c7790f Multiplayer Notification Fix for random Termination (#2024)
* 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
2020-02-27 19:35:40 +02:00
Yair Morgenstern
eace5a46b4 Disabled GL 3.0 because it causes problems in Mac computers 2019-12-08 09:10:02 +02:00
Yair Morgenstern
f626381c31 I think we're ready to pack! 2019-11-24 22:22:47 +02:00
Yair Morgenstern
2a139ff732 Resolved #1364 - Policy picker screen won't appear from the world screen if there are no possible policies to pick 2019-11-24 00:02:28 +02:00
Yair Morgenstern
2df7bcafbd Added tests for Travis to fail if the jsons don't parse or something 2019-11-10 21:39:10 +02:00
Yair Morgenstern
91ac744692 Added "user id from clipboard" button in New Game screen
Fixed other user id problems
2019-09-03 23:22:27 +03:00
Yair Morgenstern
56b3f1c77a City founding tutorial no longer activates if the AI founded a city before you 2019-08-18 23:25:01 +03:00
Yair Morgenstern
3a990434f3 Added initial map editor! Woohoo! 2019-02-02 22:43:02 +02:00
Yair Morgenstern
9ba73c4a6f No height difference between hills and hills with jungle/forest 2019-01-21 23:10:03 +02:00
Yair Morgenstern
d1df5a2fdf Chinese font downloaded per-use basis - makes the android app require Internet permissions, but that was coming anyway 2018-12-09 19:47:21 +02:00
Yair Morgenstern
44d5017f6f MoveHereButton creation deferred to main thread, in order to LibGDX errors caused by concurrent UI alteration 2018-12-06 12:30:02 +02:00
Yair Morgenstern
24b27a791f Added Replacable Parts tech and Great War Infantry
Musketman now upgrades to Rifleman
Solved more rare concurrency problems
2018-12-02 23:05:05 +02:00
Yair Morgenstern
c088c02b1e Added Roboto font and finally figured out how to make TrueType fonts look good! 2018-06-05 21:53:51 +03:00
Yair Morgenstern
2f9d6af693 Improvements on tiles can advance
Cannot create adjacent cities
Standardized function and parameter names
2017-11-30 22:25:20 +02:00
Yair Morgenstern
0319602092 Initial commit 2017-11-22 00:09:35 +02:00