Skip to content

Commit 0a08709

Browse files
authored
Merge branch 'lichess-org:main' into 1043-add-castling-method-option-v2
2 parents 27bb2dd + 9d15f6e commit 0a08709

File tree

52 files changed

+2273
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2273
-578
lines changed

.github/workflows/draft_github_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- name: Draft release with release notes
2222
id: create_release
23-
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
23+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
2424
with:
2525
tag_name: ${{ github.event.inputs.version }}
2626
draft: true

docs/setting_dev_env.md

Lines changed: 119 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ This project uses Flutter.
1111
1. Follow [the flutter install guide](https://docs.flutter.dev/get-started/install).
1212
This project is meant to run on iOS and Android, so you need to follow the "Platform setup" section of that guide to
1313
install the iOS and/or Android platform.
14+
1415
> [!WARNING]
15-
> Installing on Linux using `snapd` might cause some [problems](../../issues/123) building stockfish.
16+
> Installing on Linux using `snapd` might cause some [problems](https://github.com/lichess-org/mobile/issues/123) building stockfish.
1617
> Installing flutter manually is a known workaround.
18+
1719
2. Switch to the beta channel by running `flutter channel beta` and `flutter upgrade`
20+
1821
> [!NOTE]
1922
> We'll use Flutter's `beta` channel while the app itself is in Beta.
23+
2024
3. Ensure Flutter is correctly configured by running `flutter doctor`
2125

2226
Note that this application is not meant to be run on web platform.
@@ -47,68 +51,76 @@ The fastest and most straight-forward way to get started is using [lila-docker](
4751

4852
Instructions to install both `lila` and `lila-ws` locally can be found in [the lila wiki](https://github.com/lichess-org/lila/wiki/Lichess-Development-Onboarding).
4953

50-
**Do not use any scheme (https:// or ws://) in url in host, since it's already handled by URI helper methods**
54+
## Setting up a device
5155

52-
To run the application with a local server, you can use the following command:
56+
### Real device
5357

54-
```bash
55-
flutter run --dart-define=LICHESS_HOST=localhost:9663 --dart-define=LICHESS_WS_HOST=localhost:9664
56-
```
58+
#### Android
5759

58-
> [!NOTE]
59-
> The hosts above are the default ports for lila, if you have changed them, you
60-
will need to adjust the command accordingly.
60+
To use a real device you will need to [enable developer options](https://developer.android.com/studio/debug/dev-options) on it and have [adb](https://developer.android.com/tools/adb) installed on your computer.
6161

62-
## Setting up the emulators
62+
Once that done, you can [connect your device](https://developer.android.com/studio/run/device) either with USB or with Wi-Fi.
6363

64-
### iOS
64+
##### Connect with USB
6565

66-
Simply follow the instructions in the flutter guide to install Xcode and the iOS
67-
simulator.
66+
Enable USB debugging and connect your phone with USB.
6867

68+
Run `adb devices` to check that your device is connected.
6969

70-
### Android
70+
##### Connect with Wi-Fi
7171

72-
#### When using a manually installed lila server
72+
On your Android phone:
7373

74-
If you are working with a local `lila` server, you need to expose some ports from the emulator. You can do this by
75-
running the following command (once the emulator is running):
74+
1. Connect your phone to the same wifi network as your host machine
75+
2. In Developer Options, toggle Wireless Debugging to ON
76+
3. Tap "Wireless Debugging" to enter its menu
77+
4. Select **Pair device with pairing code**
7678

77-
```bash
78-
adb reverse tcp:9663 tcp:9663
79-
adb reverse tcp:9664 tcp:9664
80-
```
79+
On your computer:
8180

82-
This will allow the app to communicate with the local server. 9663 is for `http`
83-
and 9664 is for `websocket`. It assumes that the server is running on the
84-
default ports.
81+
1. Pair your phone with `adb pair [phone_ip_address]:[pair_port] [pairing_code]`.
82+
2. Connect your phone with `adb connect [phone_ip_address]:[connection_port]`.
83+
Your phone IP address and connection port should be written on the wireless debugging menu.
84+
3. Check that your device is connected with `adb devices`
8585

86-
#### When using lila-docker
86+
### Emulators
8787

88-
When using [lila-docker](https://github.com/lichess-org/lila-docker), first run `./lila-docker hostname` and select your
89-
computer's IP address. Then, instead of the commands above, use this:
88+
#### iOS
9089

91-
```bash
92-
adb reverse tcp:9663 tcp:8080
93-
adb reverse tcp:9664 tcp:8080
94-
```
90+
Simply follow the instructions in the flutter guide to install Xcode and the iOS
91+
simulator.
9592

96-
#### Troubleshooting
93+
#### Android
9794

98-
If Chrome instacrashes, it is likely you need to disable vulkan in emulator settings.
95+
##### Troubleshooting
9996

100-
If you cannot access internet you can try launching the emulator with a DNS address:
97+
- If Chrome crashes, it is likely you need to disable Vulkan in emulator settings:
10198

102-
```bash
103-
$ emulator -avd <YourAVD> -dns-server 1.1.1.1
104-
```
99+
```bash
100+
$ emulator -avd <YourAVD> -feature -Vulkan
101+
```
105102

106-
If you experience high lags or freezes, check the memory settings and be sure to enable hardware acceleration (`-gpu host`)
107-
Also disabling the snapshot storage may help:
103+
You can read more about this issue [here](https://issuetracker.google.com/issues/277651135).
108104

109-
```bash
110-
$ emulator -avd <YourAVD> -no-snapshot-load -no-snapstorage -no-snapshot -no-snapshot-save'
111-
```
105+
- If you cannot access internet you can try launching the emulator with a DNS address:
106+
107+
```bash
108+
$ emulator -avd <YourAVD> -dns-server 1.1.1.1
109+
```
110+
111+
If you are on Linux it seems that the emulator will try to read `/etc/resolv.conf` to find DNS servers.
112+
You might want to check that your `/etc/resolv.conf` is configured properly rather than using the emulator `dns-server` flag first.
113+
If you use systemd-resolved, the recommended mode of handling `/etc/resolv.conf` is to symlink `/etc/resolv.conf` to `/run/systemd/resolve/stub-resolv.conf`.
114+
115+
- If you experience high lags or freezes, check the memory settings and be sure to enable hardware acceleration (`-gpu host`).
116+
117+
Also disabling the snapshot storage may help:
118+
119+
```bash
120+
$ emulator -avd <YourAVD> -no-snapshot-load -no-snapstorage -no-snapshot -no-snapshot-save
121+
```
122+
123+
- If you use Wayland, the emulator will not work. You can try to use Xwayland instead. The issue is tracked [here](https://issuetracker.google.com/issues/378421876).
112124

113125
## Code generation
114126

@@ -132,26 +144,85 @@ dart run build_runner watch
132144

133145
Flutter comes with an `analyze` command to run static analysis. While developing you can run:
134146

135-
```
147+
```bash
136148
flutter analyze --watch
137149
```
138150

139151
It will run analysis continuously, watching the filesystem for changes. It is important to always check for analysis errors.
140152

141153
## Run
142154

143-
Use the `flutter run` command to run on an emulator or device. If you need to change the lichess host you can do it like so:
155+
Use the `flutter run` command to run the app on an emulator or a real device. If you need to change the lichess host you can do it like so:
144156

157+
```bash
158+
flutter run \
159+
--dart-define=LICHESS_HOST=lichess.dev \
160+
--dart-define=LICHESS_WS_HOST=socket.lichess.org
145161
```
146-
flutter run --dart-define=LICHESS_HOST=lichess.dev
147-
--dart-define=LICHESS_WS_HOST=socket.lichess.dev
162+
163+
> [!WARNING]
164+
> Do not use any scheme (https:// or ws://) in url in host, since it's already handled by URI helper method
165+
166+
> [!NOTE]
167+
> You can also use the production server but note that you will not be able to log in.
168+
169+
### Android
170+
171+
#### When using lila-docker
172+
173+
When using [lila-docker](https://github.com/lichess-org/lila-docker), the easiest solution is to use the adb reverse command:
174+
175+
```bash
176+
adb reverse tcp:8080 tcp:8080
177+
```
178+
179+
You can then run the app with the following hosts:
180+
181+
```bash
182+
flutter run \
183+
--dart-define=LICHESS_HOST=localhost:8080 \
184+
--dart-define=LICHESS_WS_HOST=localhost:8080
148185
```
149186

187+
Another option is to use the `./lila-docker hostname` command and select your computer's IP address.
188+
189+
You can then run the app with the following hosts:
190+
191+
```bash
192+
flutter run \
193+
--dart-define=LICHESS_HOST=[your_computer_ip]:8080 \
194+
--dart-define=LICHESS_WS_HOST=[your_computer_ip]:8080
195+
```
196+
197+
#### When using a manually installed lila server
198+
199+
If you are working with a local `lila` server, you need to map some ports from the remote device to the local lila server.
200+
Once your device is available, you can do this by running the following command (you can check if your device is available with `adb devices`):
201+
202+
```bash
203+
adb reverse tcp:9663 tcp:9663
204+
adb reverse tcp:9664 tcp:9664
205+
```
206+
207+
This will allow the app to communicate with the local server. 9663 is for `http`
208+
and 9664 is for `websocket`.
209+
210+
To run the application with the local server, you can use the following command:
211+
212+
```bash
213+
flutter run \
214+
--dart-define=LICHESS_HOST=localhost:9663 \
215+
--dart-define=LICHESS_WS_HOST=localhost:9664
216+
```
217+
218+
> [!NOTE]
219+
> The ports above are the default ones for lila, if you have changed them, you
220+
will need to adjust the commands accordingly.
221+
150222
### Logging
151223

152-
```sh
224+
```bash
153225
dart devtools
154226
```
155227

156228
Then run the app with the `flutter run` command above, and a link to the logging page will be printed in the console.
157-

ios/Podfile.lock

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,49 @@ PODS:
1515
- FlutterMacOS
1616
- device_info_plus (0.0.1):
1717
- Flutter
18-
- Firebase/CoreOnly (11.4.0):
19-
- FirebaseCore (= 11.4.0)
20-
- Firebase/Crashlytics (11.4.0):
18+
- Firebase/CoreOnly (11.6.0):
19+
- FirebaseCore (~> 11.6.0)
20+
- Firebase/Crashlytics (11.6.0):
2121
- Firebase/CoreOnly
22-
- FirebaseCrashlytics (~> 11.4.0)
23-
- Firebase/Messaging (11.4.0):
22+
- FirebaseCrashlytics (~> 11.6.0)
23+
- Firebase/Messaging (11.6.0):
2424
- Firebase/CoreOnly
25-
- FirebaseMessaging (~> 11.4.0)
26-
- firebase_core (3.9.0):
27-
- Firebase/CoreOnly (= 11.4.0)
25+
- FirebaseMessaging (~> 11.6.0)
26+
- firebase_core (3.10.0):
27+
- Firebase/CoreOnly (= 11.6.0)
2828
- Flutter
29-
- firebase_crashlytics (4.2.0):
30-
- Firebase/Crashlytics (= 11.4.0)
29+
- firebase_crashlytics (4.3.0):
30+
- Firebase/Crashlytics (= 11.6.0)
3131
- firebase_core
3232
- Flutter
33-
- firebase_messaging (15.1.6):
34-
- Firebase/Messaging (= 11.4.0)
33+
- firebase_messaging (15.2.0):
34+
- Firebase/Messaging (= 11.6.0)
3535
- firebase_core
3636
- Flutter
37-
- FirebaseCore (11.4.0):
38-
- FirebaseCoreInternal (~> 11.0)
37+
- FirebaseCore (11.6.0):
38+
- FirebaseCoreInternal (~> 11.6.0)
3939
- GoogleUtilities/Environment (~> 8.0)
4040
- GoogleUtilities/Logger (~> 8.0)
41-
- FirebaseCoreExtension (11.4.1):
42-
- FirebaseCore (~> 11.0)
41+
- FirebaseCoreExtension (11.6.0):
42+
- FirebaseCore (~> 11.6.0)
4343
- FirebaseCoreInternal (11.6.0):
4444
- "GoogleUtilities/NSData+zlib (~> 8.0)"
45-
- FirebaseCrashlytics (11.4.0):
46-
- FirebaseCore (~> 11.4)
45+
- FirebaseCrashlytics (11.6.0):
46+
- FirebaseCore (~> 11.6.0)
4747
- FirebaseInstallations (~> 11.0)
4848
- FirebaseRemoteConfigInterop (~> 11.0)
4949
- FirebaseSessions (~> 11.0)
5050
- GoogleDataTransport (~> 10.0)
5151
- GoogleUtilities/Environment (~> 8.0)
5252
- nanopb (~> 3.30910.0)
5353
- PromisesObjC (~> 2.4)
54-
- FirebaseInstallations (11.4.0):
55-
- FirebaseCore (~> 11.0)
54+
- FirebaseInstallations (11.6.0):
55+
- FirebaseCore (~> 11.6.0)
5656
- GoogleUtilities/Environment (~> 8.0)
5757
- GoogleUtilities/UserDefaults (~> 8.0)
5858
- PromisesObjC (~> 2.4)
59-
- FirebaseMessaging (11.4.0):
60-
- FirebaseCore (~> 11.0)
59+
- FirebaseMessaging (11.6.0):
60+
- FirebaseCore (~> 11.6.0)
6161
- FirebaseInstallations (~> 11.0)
6262
- GoogleDataTransport (~> 10.0)
6363
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
@@ -66,9 +66,9 @@ PODS:
6666
- GoogleUtilities/UserDefaults (~> 8.0)
6767
- nanopb (~> 3.30910.0)
6868
- FirebaseRemoteConfigInterop (11.6.0)
69-
- FirebaseSessions (11.4.0):
70-
- FirebaseCore (~> 11.4)
71-
- FirebaseCoreExtension (~> 11.4)
69+
- FirebaseSessions (11.6.0):
70+
- FirebaseCore (~> 11.6.0)
71+
- FirebaseCoreExtension (~> 11.6.0)
7272
- FirebaseInstallations (~> 11.0)
7373
- GoogleDataTransport (~> 10.0)
7474
- GoogleUtilities/Environment (~> 8.0)
@@ -238,18 +238,18 @@ SPEC CHECKSUMS:
238238
connectivity_plus: 2256d3e20624a7749ed21653aafe291a46446fee
239239
cupertino_http: 94ac07f5ff090b8effa6c5e2c47871d48ab7c86c
240240
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
241-
Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
242-
firebase_core: 726c34112998e66d1ddaf4b1bef78ed2dd4b9804
243-
firebase_crashlytics: 1c2e2091a0b06bf6e3d6535010469a98c44c4d67
244-
firebase_messaging: a538130cb2bca3ea0ff0892b8c948bd7d20ecaed
245-
FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
246-
FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e
241+
Firebase: 374a441a91ead896215703a674d58cdb3e9d772b
242+
firebase_core: 2337982fb78ee4d8d91e608b0a3d4f44346a93c8
243+
firebase_crashlytics: 3b6a9a9cbdc5ab92afaf9b206e52c79c2321a0d4
244+
firebase_messaging: f3bddfa28c2cad70b3341bf461e987a24efd28d6
245+
FirebaseCore: 48b0dd707581cf9c1a1220da68223fb0a562afaa
246+
FirebaseCoreExtension: 2d77d6430c16cf43ca2b04608302ed02b3598361
247247
FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2
248-
FirebaseCrashlytics: 41bbdd2b514a8523cede0c217aee6ef7ecf38401
249-
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
250-
FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2
248+
FirebaseCrashlytics: b21c665fb50138766480bce73ebdb1aa30f7f300
249+
FirebaseInstallations: efc0946fc756e4d22d8113f7c761948120322e8c
250+
FirebaseMessaging: e1aca1fcc23e8b9eddb0e33f375ff90944623021
251251
FirebaseRemoteConfigInterop: e75e348953352a000331eb77caf01e424248e176
252-
FirebaseSessions: 3f56f177d9e53a85021d16b31f9a111849d1dd8b
252+
FirebaseSessions: 9529d14180868e29a8da164b3a729c036204918b
253253
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
254254
flutter_appauth: 914057fda669db5073d3ca9d94ea932e7df3c964
255255
flutter_local_notifications: 395056b3175ba4f08480a7c5de30cd36d69827e4

lib/src/model/broadcast/broadcast.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ typedef BroadcastTournamentInformation =
6161
String? location,
6262
BroadcastTournamentDates? dates,
6363
Uri? website,
64+
Uri? standings,
6465
});
6566

6667
typedef BroadcastTournamentDates = ({DateTime startsAt, DateTime? endsAt});

0 commit comments

Comments
 (0)