Compare commits

...

437 Commits

Author SHA1 Message Date
87e4551f3a Merge pull request 'Update Rust crate actix-cors to v0.7.1' (#296) from renovate/actix-cors-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #296
2025-03-28 15:20:12 +00:00
1917183dc8 Merge pull request 'Update Rust crate reqwest to v0.12.14' (#298) from renovate/reqwest-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #298
2025-03-28 15:20:03 +00:00
c76f147a7a Merge pull request 'Update Rust crate serde_json to v1.0.140' (#299) from renovate/serde_json-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #299
2025-03-28 15:19:53 +00:00
fd11fb21dc Merge pull request 'Update Rust crate uuid to v1.16.0' (#301) from renovate/uuid-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #301
2025-03-28 15:19:43 +00:00
61f6a7b73e Merge pull request 'Update Rust crate log to v0.4.27' (#302) from renovate/log-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #302
2025-03-28 15:19:36 +00:00
f8da78f56b Update Rust crate log to v0.4.27
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-25 00:26:59 +00:00
86c98600f8 Update Rust crate uuid to v1.16.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-21 00:25:53 +00:00
8439e7049f Merge pull request 'Update Rust crate clap to v4.5.32' (#297) from renovate/clap-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #297
2025-03-20 19:56:24 +00:00
56edb02c5b Merge pull request 'Update Rust crate tokio to v1.44.1' (#300) from renovate/tokio-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #300
2025-03-20 19:56:10 +00:00
4865a592b9 Update Rust crate tokio to v1.44.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-14 00:07:55 +00:00
768c257eed Update Rust crate serde_json to v1.0.140
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-13 00:07:39 +00:00
40879d8b48 Update Rust crate reqwest to v0.12.14
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-13 00:07:35 +00:00
3161c9a91b Update Rust crate clap to v4.5.32
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-12 00:21:53 +00:00
200c29677f Update Rust crate actix-cors to v0.7.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-12 00:21:50 +00:00
de12dcb1bb Merge pull request 'Update Rust crate serde_json to v1.0.138' (#285) from renovate/serde_json-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #285
2025-03-11 13:08:50 +00:00
5e4b36c89b Merge pull request 'Update Rust crate tokio to v1.44.0' (#293) from renovate/tokio-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #293
2025-03-11 13:08:41 +00:00
669e12bb55 Merge pull request 'Update Rust crate actix-web to v4.10.2' (#295) from renovate/actix-web-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #295
2025-03-11 13:08:31 +00:00
b6c91e493e Merge pull request 'Update Rust crate clap to v4.5.28' (#286) from renovate/clap-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #286
2025-03-11 13:08:25 +00:00
bec17801af Merge pull request 'Update Rust crate serde to v1.0.219' (#294) from renovate/serde-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #294
2025-03-11 13:08:13 +00:00
2faba0519d Update Rust crate actix-web to v4.10.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-11 00:21:13 +00:00
73253235ce Update Rust crate serde to v1.0.219
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-10 00:21:19 +00:00
89cffdea2b Update Rust crate tokio to v1.44.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-08 00:20:34 +00:00
7494253e7b Merge pull request 'Update Rust crate serde to v1.0.218' (#288) from renovate/serde-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #288
2025-03-06 20:29:09 +00:00
e44fba5d25 Merge pull request 'Update Rust crate textwrap to v0.16.2' (#291) from renovate/textwrap-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #291
2025-03-06 20:28:54 +00:00
f7c27f4ad4 Merge pull request 'Update Rust crate uuid to v1.15.1' (#292) from renovate/uuid-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #292
2025-03-06 20:28:44 +00:00
d1c36c7c01 Update Rust crate uuid to v1.15.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-06 00:20:22 +00:00
ff9f9b57de Update Rust crate textwrap to v0.16.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-06 00:20:19 +00:00
d40196a6f9 Merge pull request 'Update Rust crate uuid to v1.13.1' (#287) from renovate/uuid-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #287
2025-03-05 20:40:39 +00:00
4ef766465d Merge pull request 'Update Rust crate semver to v1.0.26' (#290) from renovate/semver-1.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #290
2025-03-05 20:40:31 +00:00
1d1a219b69 Update Rust crate semver to v1.0.26
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-05 00:20:24 +00:00
1874c07623 Merge pull request 'Update Rust crate log to v0.4.26' (#289) from renovate/log-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #289
2025-03-04 19:50:21 +00:00
32edbb30a1 Update Rust crate log to v0.4.26
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-02-22 00:09:18 +00:00
d013673487 Update Rust crate serde to v1.0.218
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-02-21 00:09:24 +00:00
077503abe4 Update Rust crate uuid to v1.13.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-02-06 00:12:07 +00:00
2927463bcb Update Rust crate clap to v4.5.28
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-02-04 00:11:42 +00:00
d262b26306 Update Rust crate serde_json to v1.0.138
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-30 00:25:29 +00:00
b5c45113e0 Update Rust crate uuid to v1.12.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-22 00:25:55 +00:00
474d65207f Merge pull request 'Update Rust crate clap to v4.5.27' (#281) from renovate/clap-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #281
2025-01-21 07:05:44 +00:00
7c1d0eef8f Update Rust crate uuid to v1.12.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-21 01:04:27 +00:00
bb2b283397 Update Rust crate clap to v4.5.27
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-21 00:26:03 +00:00
711edf5591 Update Rust crate serde_json to v1.0.137
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-20 01:14:28 +00:00
a831dba286 Update Rust crate semver to v1.0.25
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-20 00:26:13 +00:00
1687b8b4d3 Merge pull request 'Update Rust crate uuid to v1.11.1' (#277) from renovate/uuid-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #277
2025-01-19 22:12:18 +00:00
6366e7f109 Merge pull request 'Update Rust crate tokio to v1.43.0' (#274) from renovate/tokio-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #274
2025-01-19 22:12:10 +00:00
e359c3b456 Merge pull request 'Update Rust crate log to v0.4.25' (#278) from renovate/log-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #278
2025-01-19 22:09:46 +00:00
4ec1f67db0 Update Rust crate log to v0.4.25
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-15 00:47:24 +00:00
14c960e5fc Update Rust crate uuid to v1.11.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-11 00:22:44 +00:00
b0bc07c1fd Update Rust crate log to v0.4.24
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-11 00:22:42 +00:00
353a01bb12 Update Rust crate clap to v4.5.26
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-10 00:22:39 +00:00
e0397a38b8 Update Rust crate tokio to v1.43.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-09 00:22:43 +00:00
452ed7d856 Update Rust crate serde_json to v1.0.135
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-08 01:07:16 +00:00
5d033b4edd Update Rust crate clap to v4.5.24
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-08 00:27:58 +00:00
91705d1882 Merge pull request 'Update Rust crate env_logger to v0.11.6' (#265) from renovate/env_logger-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #265
2025-01-03 08:22:53 +00:00
c66eb71b6a Merge pull request 'Update Rust crate reqwest to v0.12.12' (#271) from renovate/reqwest-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #271
2025-01-03 08:21:34 +00:00
0fd1df61bc Update Rust crate reqwest to v0.12.12
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-01-01 00:23:36 +00:00
8419ebe74f Update Rust crate serde to v1.0.217
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-28 01:28:43 +00:00
77296fdaf4 Update Rust crate reqwest to v0.12.11
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-28 00:25:00 +00:00
a5d3e9219c Update Rust crate reqwest to v0.12.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-27 00:23:40 +00:00
c202997bd2 Update Rust crate serde_with to v3.12.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-26 00:23:06 +00:00
847759e617 Update Rust crate serde_json to v1.0.134
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-22 00:24:09 +00:00
9ede11bbd9 Update Rust crate env_logger to v0.11.6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-21 00:24:04 +00:00
47801f7988 Merge pull request 'Update Rust crate semver to v1.0.24' (#264) from renovate/semver-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #264
2024-12-13 19:32:30 +00:00
a80c935bc1 Update Rust crate semver to v1.0.24
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-13 00:06:36 +00:00
5fec8fc074 Update Rust crate serde to v1.0.216
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-12 00:06:45 +00:00
918d36c28e Update Rust crate clap to v4.5.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 00:24:17 +00:00
fd3533ed8c Update Rust crate tokio to v1.42.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-05 00:24:15 +00:00
5f99f95d0d Update Rust crate serde to v1.0.215
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-04 01:48:42 +00:00
235328d942 Update Rust crate clap to v4.5.22
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-04 00:24:54 +00:00
15b9177ea1 Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-03 22:41:44 +01:00
bfd1c4db30 Merge pull request 'Update Rust crate uuid to v1.11.0' (#249) from renovate/uuid-1.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #249
2024-12-03 20:55:39 +00:00
04496c1eae Merge pull request 'Update Rust crate serde_with to v3.11.0' (#247) from renovate/serde_with-3.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #247
2024-12-03 20:55:33 +00:00
967ba8f570 Merge pull request 'Update Rust crate tokio to v1.41.0' (#254) from renovate/tokio-1.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #254
2024-12-03 20:55:27 +00:00
71ce2f2bde Merge pull request 'Update Rust crate serde to v1.0.214' (#256) from renovate/serde-1.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #256
2024-12-03 20:55:21 +00:00
fcf3790ca1 Merge pull request 'Update Rust crate clap to v4.5.21' (#257) from renovate/clap-4.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #257
2024-12-03 20:55:16 +00:00
80cfd5ff0d Update Rust crate serde_json to v1.0.133
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-18 00:07:07 +00:00
b5263a7226 Update Rust crate clap to v4.5.21
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-11-14 00:06:39 +00:00
a55f988977 Update Rust crate serde to v1.0.214
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-10-29 00:28:50 +00:00
a0f9be4bb0 Update Rust crate reqwest to v0.12.9
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-29 00:28:47 +00:00
2de9a9ecb8 Update Rust crate tokio to v1.41.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-10-23 00:09:55 +00:00
d92531428d Update Rust crate serde to v1.0.213
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-23 00:09:52 +00:00
f7ec33c07e Update Rust crate serde_json to v1.0.132
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-20 00:20:31 +00:00
aeffb43d9e Update Rust crate serde_json to v1.0.131
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-19 00:28:49 +00:00
5497fd8e0f Update Rust crate serde_json to v1.0.129
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-18 00:28:33 +00:00
1a013381d9 Update Rust crate uuid to v1.11.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-10-17 00:27:54 +00:00
da25e1e379 Update Rust crate clap to v4.5.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-09 00:27:28 +00:00
977c759195 Update Rust crate serde_with to v3.11.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-06 00:27:53 +00:00
a8a97d7df0 Update Rust crate futures to v0.3.31
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-06 00:27:50 +00:00
ef3b20775c Merge pull request 'Update Rust crate serde_with to v3.10.0' (#245) from renovate/serde_with-3.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #245
2024-10-02 20:13:57 +00:00
9ccc39fa72 Update Rust crate serde_with to v3.10.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-02 00:31:15 +00:00
cf1a01e7a1 Update Rust crate clap to v4.5.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-02 00:31:12 +00:00
67115ec6b0 Update Rust crate reqwest to v0.12.8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-01 00:31:16 +00:00
f5b3e7b6c2 Update Rust crate clap to v4.5.18
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-28 00:30:46 +00:00
a41c3c14d9 Merge pull request 'Update Rust crate clap to v4.5.17' (#237) from renovate/clap-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #237
2024-09-27 05:30:01 +00:00
42a9986689 Update Rust crate tokio to v1.40.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-14 00:32:29 +00:00
03f7a49363 Update Rust crate serde_json to v1.0.128
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-13 01:15:54 +00:00
deecb6b9e3 Update Rust crate serde to v1.0.210
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-13 00:33:42 +00:00
1d403a6fc3 Update Rust crate reqwest to v0.12.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-12 00:34:00 +00:00
9a877ed820 Update Rust crate clap to v4.5.17
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-09-12 00:33:55 +00:00
83d4ef90a7 Merge pull request 'Update Rust crate serde to v1.0.205' (#229) from renovate/serde-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #229
2024-08-23 07:14:47 +00:00
40b364f1c6 Update Rust crate tokio to v1.39.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-18 00:30:50 +00:00
c69cdf09f2 Update Rust crate clap to v4.5.16
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
2024-08-16 00:25:52 +00:00
40a04aef6b Update Rust crate serde_json to v1.0.125
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-15 15:19:01 +00:00
4868688ee1 Update Rust crate serde_json to v1.0.124
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-12 00:10:06 +00:00
9d28510fa9 Update Rust crate actix-web to v4.9.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-11 00:16:57 +00:00
95780dc0ee Update Rust crate clap to v4.5.15
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-11 00:10:36 +00:00
6fcef8eda8 Update Rust crate serde to v1.0.205
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-08-09 00:11:38 +00:00
1deec5a461 Update Rust crate clap to v4.5.14
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-09 00:11:31 +00:00
13a4ac1c6d Update Rust crate actix-web-actors to v4.3.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-08 00:09:50 +00:00
26036f1111 Update Rust crate serde_json to v1.0.122
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-02 00:10:21 +00:00
f3dad47770 Update Rust crate clap to v4.5.13
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-01 00:10:10 +00:00
c2ef293dc1 Update Rust crate serde_json to v1.0.121
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-29 00:10:31 +00:00
92b1ea37ab Update Rust crate tokio to v1.39.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-28 00:10:16 +00:00
a3ea64964a Update Rust crate env_logger to v0.11.5
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-26 01:38:19 +00:00
1cbb203f57 Update Rust crate clap to v4.5.11
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-26 00:11:27 +00:00
f75e3b8a83 Merge pull request 'Update Rust crate uuid to v1.10.0' (#214) from renovate/uuid-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #214
2024-07-25 12:39:34 +00:00
a8fe1755a7 Merge pull request 'Update Rust crate serde to v1.0.204' (#212) from renovate/serde-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #212
2024-07-25 12:39:25 +00:00
8fbaa02d47 Update Rust crate tokio to v1.39.1
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-25 00:55:16 +00:00
d6aa71a2db Update Rust crate env_logger to v0.11.4
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-24 01:12:41 +00:00
814e130c4d Update Rust crate clap to v4.5.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-24 00:10:03 +00:00
8662e6523c Update Rust crate tokio to v1.38.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-17 00:10:15 +00:00
73ec2675d6 Update Rust crate serde_with to v3.9.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-15 00:09:37 +00:00
96cae58e52 Update Rust crate uuid to v1.10.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-07-10 00:09:58 +00:00
af0d45f59a Update Rust crate clap to v4.5.9
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-10 00:09:56 +00:00
251677fc18 Update Rust crate serde to v1.0.204
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-07-07 00:23:13 +00:00
d9f9fec806 Update Rust crate serde_with to v3.8.3
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-04 01:22:34 +00:00
972398e3b8 Update Rust crate rustls-native-certs to v0.7.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-04 00:22:51 +00:00
51ffe2677c Merge pull request 'Update Rust crate serde_json to v1.0.120' (#209) from renovate/serde_json-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #209
2024-07-02 20:56:33 +00:00
8f1564e5fb Update Rust crate serde_json to v1.0.120
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-07-02 00:23:05 +00:00
a60ad3d4f8 Update Rust crate serde_with to v3.8.2
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-01 01:18:20 +00:00
0f14c1f480 Update Rust crate serde_json to v1.0.119
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-01 00:08:37 +00:00
ec11b1603f Merge pull request 'Update Rust crate clap to v4.5.8' (#205) from renovate/clap-4.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #205
2024-06-29 08:41:45 +00:00
4b62afda14 Merge pull request 'Update Rust crate log to v0.4.22' (#206) from renovate/log-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #206
2024-06-29 08:41:37 +00:00
63c5b70ef5 Update Rust crate log to v0.4.22
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-06-29 00:17:52 +00:00
63b8c72ef7 Update Rust crate clap to v4.5.8
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-06-29 00:17:49 +00:00
766660a3c1 Update Rust crate serde_json to v1.0.118
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-26 00:16:47 +00:00
4b3161ee77 Update Rust crate uuid to v1.9.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-25 00:16:31 +00:00
2cf87c301c Update Rust crate lazy_static to v1.5.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-22 00:16:20 +00:00
38c3aa6212 Update Rust crate actix-web to v4.8.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-21 00:16:08 +00:00
11487abf2b Update Rust crate reqwest to v0.12.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-18 00:17:02 +00:00
f3b267f0c5 Update Rust crate clap to v4.5.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-11 00:14:02 +00:00
219213ff6f Update Rust crate actix-rt to v2.10.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-10 00:20:20 +00:00
0593665350 Update Rust crate actix to v0.13.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-10 00:13:04 +00:00
c84f729dc1 Update Rust crate actix-web to v4.7.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-09 00:14:13 +00:00
7a90c9325f Update Rust crate clap to v4.5.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-07 00:13:56 +00:00
b28966e785 Update Rust crate tokio to v1.38.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-31 00:21:50 +00:00
aeb2c93f0d Update Rust crate serde to v1.0.203
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-26 00:26:38 +00:00
ca0f6982e6 Merge pull request 'Update Rust crate num to v0.4.3' (#187) from renovate/num-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #187
2024-05-23 09:24:33 +00:00
22850d58fc Update Rust crate actix-web to v4.6.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-20 00:26:56 +00:00
b621fa19b5 Update Rust crate serde to v1.0.202
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-16 00:22:06 +00:00
108755328a Update Rust crate serde_json to v1.0.117
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-11 00:33:36 +00:00
4a9af95458 Update Rust crate serde to v1.0.201
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-10 00:32:03 +00:00
0d9d966d63 Update Rust crate num to v0.4.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-05-10 00:31:59 +00:00
7c00dd061b Update Rust crate semver to v1.0.23
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-08 01:04:48 +00:00
28b1c80899 Update Rust crate num-traits to v0.2.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-08 00:30:49 +00:00
a243b040f5 Update Rust crate serde to 1.0.200
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-02 00:05:28 +00:00
a458f766b3 Update Rust crate serde_with to 3.8.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-29 00:05:16 +00:00
a33a99a886 Update Rust crate serde to 1.0.199
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-28 00:06:39 +00:00
2b9541ee42 Update Rust crate reqwest to 0.12.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-27 00:18:31 +00:00
9b00a6546f Update Rust crate serde_with to 3.8.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-25 00:17:24 +00:00
6806ef3ae8 Update Rust crate serde_json to 1.0.116
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-18 00:12:16 +00:00
4ce5f10b37 Merge pull request 'Update Rust crate num to 0.4.2' (#177) from renovate/num-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #177
2024-04-17 06:00:07 +00:00
f94d9d70fd Update Rust crate serde to 1.0.198
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-17 00:12:52 +00:00
f0ca40aa67 Update Rust crate num to 0.4.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-04-13 00:12:22 +00:00
2688eefbb7 Merge pull request 'Update Rust crate serde_json to 1.0.115' (#174) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #174
2024-04-06 08:07:13 +00:00
7c57ff0753 Update Rust crate serde_json to 1.0.115
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-04-06 00:13:46 +00:00
2c117b00b2 Merge pull request 'Update Rust crate tokio to 1.37.0' (#175) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #175
2024-04-05 05:52:25 +00:00
85a8d0f27d Merge pull request 'Update Rust crate hostname to 0.4.0' (#176) from renovate/hostname-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #176
2024-04-05 05:52:02 +00:00
5be1b72a4a Update Rust crate hostname to 0.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-04-02 00:09:04 +00:00
41d1a2511f Update Rust crate tokio to 1.37.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-29 00:22:11 +00:00
45183108e6 Update Rust crate clap to 4.5.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-26 00:27:51 +00:00
bf7899abe0 Merge pull request 'Update Rust crate serde_json to 1.0.114' (#153) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #153
2024-03-25 09:40:42 +00:00
7e773dbf45 Merge pull request 'Update Rust crate num-derive to 0.4.2' (#159) from renovate/num-derive-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #159
2024-03-25 09:40:30 +00:00
ec718bb6ea Merge pull request 'Update Rust crate env_logger to 0.11.3' (#148) from renovate/env_logger-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #148
2024-03-25 09:40:20 +00:00
1a7fded637 Update Rust crate env_logger to 0.11.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-23 00:28:25 +00:00
26cf43c0d5 Update Rust crate serde_json to 1.0.114
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-23 00:28:22 +00:00
3be1e4a6e9 Update Rust crate num-derive to 0.4.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-23 00:28:17 +00:00
600c55bebe Merge pull request 'Update Rust crate clap to 4.5.3' (#164) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #164
2024-03-22 06:56:06 +00:00
f02b7b15d5 Merge pull request 'Update Rust crate uuid to 1.8.0' (#171) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #171
2024-03-22 06:55:38 +00:00
427f511fa0 Merge pull request 'Update Rust crate reqwest to 0.12' (#172) from renovate/reqwest-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #172
2024-03-22 06:55:15 +00:00
8c3f7bd05f Update Rust crate reqwest to 0.12
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-21 00:07:08 +00:00
884eb37d56 Update Rust crate uuid to 1.8.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-20 00:06:52 +00:00
96f5ce5577 Update Rust crate clap to 4.5.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-16 00:09:08 +00:00
fa825120c6 Merge pull request 'Update Rust crate rustls to 0.22.2' (#146) from renovate/rustls-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #146
2024-03-15 13:36:58 +00:00
09b8c73cda Merge pull request 'Update Rust crate actix-web to 4.5.1' (#157) from renovate/actix-web-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #157
2024-03-15 13:36:45 +00:00
160a27e740 Merge pull request 'Update Rust crate log to 0.4.21' (#168) from renovate/log-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #168
2024-03-15 13:36:20 +00:00
83230384a9 Merge pull request 'Update Rust crate serde_with to 3.7.0' (#169) from renovate/serde_with-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #169
2024-03-15 13:35:04 +00:00
f12e2f43e3 Update Rust crate serde_with to 3.7.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-03-12 00:11:30 +00:00
38c618d384 Update Rust crate log to 0.4.21
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-02-29 00:13:41 +00:00
54819bb0ec Update Rust crate serde to 1.0.197
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-21 00:13:52 +00:00
b6298bcf4a Update Rust crate semver to 1.0.22
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-20 00:13:42 +00:00
1618e84f14 Update Rust crate textwrap to 0.16.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-18 00:13:35 +00:00
b79efa3444 Update Rust crate clap to 4.5.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-10 00:14:07 +00:00
86ba9c057a Update Rust crate serde_with to 3.6.1
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-09 00:22:14 +00:00
9fb275b537 Update Rust crate num-traits to 0.2.18
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-09 00:13:59 +00:00
ad39cc9ac0 Update Rust crate actix to 0.13.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-08 00:14:36 +00:00
8667f3b2aa Update Rust crate actix-web-actors to 4.3.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-05 00:33:23 +00:00
78523c52da Update Rust crate actix-web to 4.5.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-02-05 00:33:17 +00:00
2f336bda49 Update Rust crate tokio to 1.36.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-03 00:33:11 +00:00
e09623cf19 Update Rust crate actix to 0.13.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-02 00:35:05 +00:00
719d0346dc Update Rust crate serde_with to 3.6.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-31 00:33:01 +00:00
3e63f1e9e8 Update Rust crate serde to 1.0.196
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-27 00:33:01 +00:00
bbcbc0fb22 Update Rust crate serde_with to 3.5.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-24 00:32:59 +00:00
f653c993fe Update Rust crate serde_with to 3.5.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-21 00:33:12 +00:00
9b35f50424 Update Rust crate uuid to 1.7.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-20 00:33:20 +00:00
29e20769d3 Update Rust crate env_logger to 0.10.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-19 00:32:58 +00:00
d153bdd8b5 Update Rust crate rustls to 0.22.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-18 00:33:19 +00:00
9f8de67780 Update Rust crate clap to 4.4.18
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-18 00:33:16 +00:00
8619509fa8 Update Dockerfile version
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-17 19:18:43 +01:00
7b2fcce00d Updateed dependencies versions
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-17 19:13:18 +01:00
4050ae533a Removed useless dependency
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-17 19:12:00 +01:00
a2e1407578 Update Rustls dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-17 19:08:38 +01:00
f727ed284f Ran cargo fmt 2024-01-17 18:52:47 +01:00
ddbdb66dee Update tokio-tungstenite on the backend 2024-01-17 18:52:25 +01:00
5242abaf8f Ran cargo update 2024-01-17 18:47:07 +01:00
be9ba8fd5c Merge pull request 'Update Rust crate clap to 4.4.13' (#140) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #140
2024-01-17 17:41:58 +00:00
223aef95db Merge pull request 'Update Rust crate serde to 1.0.195' (#143) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #143
2024-01-17 17:41:37 +00:00
4431c8318b Update Rust crate actix-cors to 0.7.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-07 00:11:25 +00:00
6c90cfe79d Update Rust crate serde to 1.0.195
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-07 00:11:21 +00:00
1b1d0d64ae Update Rust crate clap to 4.4.13
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-05 00:10:52 +00:00
e310c4895d Merge pull request 'Update Rust crate serde_json to 1.0.110' (#112) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #112
2024-01-04 15:14:54 +00:00
4f182bcf52 Update Rust crate serde_json to 1.0.110
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-04 00:30:29 +00:00
7b4812789c Allow Renovate to perform major updates
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-03 10:05:13 +00:00
95d5d0ebe5 Update Rust crate serde to 1.0.194
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-03 00:36:24 +00:00
caa84a95cb Update Rust crate semver to 1.0.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-03 00:21:20 +00:00
40a49051f2 Update Rust crate clap to 4.4.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-29 00:21:54 +00:00
27a95189be Update Rust crate futures to 0.3.30
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-25 00:28:55 +00:00
7038462084 Update Rust crate actix-web to 4.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-25 00:20:18 +00:00
466ed50582 Update Rust crate tokio to 1.35.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-24 00:22:04 +00:00
c1b30f7aa9 Set resolver
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-23 14:39:13 +01:00
592207b997 Merge pull request 'Update Rust crate tokio to 1.35.0' (#133) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #133
2023-12-23 13:35:28 +00:00
e6e5c48a5c Merge pull request 'Update Rust crate serde to 1.0.193' (#106) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #106
2023-12-23 13:35:21 +00:00
2505d8c4ff Merge pull request 'Update Rust crate clap to 4.4.11' (#129) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #129
2023-12-23 13:35:05 +00:00
08c829df2b Update Rust crate tokio to 1.35.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-09 00:15:43 +00:00
78606dbe74 Update Rust crate actix-cors to 0.6.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-07 00:17:41 +00:00
7f017401dc Update Rust crate clap to 4.4.11
All checks were successful
continuous-integration/drone/pr Build is passing
2023-12-06 00:23:01 +00:00
93a84a43e9 Merge pull request 'Update Rust crate num-derive to 0.4.1' (#115) from renovate/num-derive-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #115
2023-11-29 09:35:31 +00:00
4c45550337 Update Rust crate tokio to 1.34.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-29 02:11:33 +00:00
685f714836 Update Rust crate serde to 1.0.193
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-11-29 00:14:58 +00:00
f1fba8b326 Update Rust crate num-derive to 0.4.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-11-29 00:14:46 +00:00
0ecd211245 Update Rust crate clap to 4.4.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-29 00:14:29 +00:00
09b40c8138 Merge pull request 'Update Rust crate actix to 0.13.1' (#111) from renovate/actix-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #111
2023-11-28 17:00:47 +00:00
242f8e32df Merge pull request 'Update Rust crate tokio to 1.33.0' (#118) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #118
2023-11-28 17:00:22 +00:00
89a5f104c2 Merge pull request 'Update Rust crate clap to 4.4.1' (#108) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #108
2023-11-28 17:00:09 +00:00
dcb3f9113f Update Rust crate uuid to 1.6.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-21 00:11:14 +00:00
f3ba509cc1 Update Rust crate rustls to 0.21.9
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-17 00:25:36 +00:00
221f43ea46 Update Rust crate env_logger to 0.10.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-11 00:31:52 +00:00
56d824504d Merge pull request 'Update Rust crate uuid to 1.5.0' (#120) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #120
2023-10-30 09:05:46 +00:00
7cda8c9dc1 Update Rust crate hyper-rustls to 0.24.2
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-27 01:14:34 +00:00
cfedebd2f6 Update Rust crate futures to 0.3.29
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-27 00:31:08 +00:00
d768650f23 Update Rust crate rustls to 0.21.8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-25 00:29:51 +00:00
21d8e0c01a Update Rust crate uuid to 1.5.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-19 00:11:39 +00:00
3dc46fc862 Update Rust crate serde_with to 3.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-18 00:10:10 +00:00
d6c6d57fee Update Rust crate tokio to 1.33.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-10 00:07:53 +00:00
e9e272c19c Update Rust crate semver to 1.0.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-10 00:07:43 +00:00
44d5437c5f Update Rust crate num-traits to 0.2.17
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-08 00:07:18 +00:00
df09e7ff8d Update Rust crate tokio-tungstenite to 0.20.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-24 00:08:20 +00:00
92a4f8b2f7 Update Rust crate semver to 1.0.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-23 00:09:28 +00:00
440a81c307 Update Rust crate actix to 0.13.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-08-31 00:30:55 +00:00
c476171e7a Update Rust crate actix-web to 4.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-30 00:30:15 +00:00
83c146e788 Update Rust crate rustls to 0.21.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-29 00:34:40 +00:00
79bfeb2597 Update Rust crate clap to 4.4.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-08-29 00:34:26 +00:00
52f16f5c33 Update Rust crate actix-rt to 2.9.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-27 00:36:01 +00:00
d75a5d7d5b Update Rust crate clap to 4.4.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-25 01:57:27 +00:00
473e6c0d1e Update Rust crate serde to 1.0.186
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-25 00:40:45 +00:00
9a93a29804 Update Rust crate serde to 1.0.185
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-22 00:40:14 +00:00
dad50314b0 Update Rust crate serde_with to 3.3.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-20 00:40:38 +00:00
b51aa8b7cb Update Rust crate clap to 4.3.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-19 00:29:37 +00:00
5a2fd31fa0 Update Rust crate clap to 4.3.22
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-18 00:29:12 +00:00
efcf33c539 Update Rust crate tokio to 1.32.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-17 00:25:07 +00:00
652a6d162b Update Rust crate serde_json to 1.0.105
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-16 00:32:29 +00:00
2ab3b5e55d Update Rust crate tokio to 1.31.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-13 01:12:09 +00:00
f52dc84b45 Update Rust crate log to 0.4.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-13 00:33:17 +00:00
567473a223 Update Rust crate tokio to 1.30.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-10 00:30:59 +00:00
e95830f644 Update Rust crate clap to 4.3.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-09 00:29:27 +00:00
5d2b3e55ef Update Rust crate serde to 1.0.183
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-08 00:29:38 +00:00
c1f5f5f624 Update Rust crate crossterm to 0.27.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-07 01:05:02 +00:00
c5b549244f Update Rust crate serde to 1.0.182
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-07 00:28:39 +00:00
7a93a1e3c6 Update Rust crate serde_with to 3.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-05 00:23:45 +00:00
1fff258248 Update Rust crate serde to 1.0.181
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-04 00:35:04 +00:00
0494847f2e Update Rust crate rustls to 0.21.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-03 00:22:07 +00:00
c9dd2fce12 Update Rust crate serde to 1.0.180
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-01 00:19:18 +00:00
a2b629d218 Update Rust crate serde_json to 1.0.104
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-30 00:26:23 +00:00
5379b84470 Update Rust crate serde to 1.0.178
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-29 00:29:22 +00:00
ef8772be97 Update Rust crate serde to 1.0.177
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 00:29:48 +00:00
007dae6fae Update Rust crate serde to 1.0.176
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 00:29:55 +00:00
29012b0f32 Update Rust crate serde to 1.0.175
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-26 07:04:49 +00:00
bf4aaada69 Update Rust crate tokio-tungstenite to 0.20.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-23 00:33:16 +00:00
c58c782219 Update Rust crate serde to 1.0.174
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-22 01:21:11 +00:00
90ae4a5193 Update Rust crate clap to 4.3.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-22 00:38:32 +00:00
b9085771a6 Update Rust crate num-traits to 0.2.16
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-21 00:36:58 +00:00
e7629f50e3 Update Rust crate serde to 1.0.173
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-20 00:52:08 +00:00
00603e4386 Update Rust crate clap to 4.3.17
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-20 00:16:45 +00:00
09eaabe43c Update Rust crate serde_with to 3.1.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-19 00:35:43 +00:00
09b2058934 Update Rust crate clap to 4.3.16
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-19 00:15:56 +00:00
c6143b3bec Update Rust crate uuid to 1.4.1
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-18 00:46:08 +00:00
f48c34c234 Update Rust crate clap to 4.3.14
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-18 00:16:23 +00:00
f1a179e12d Update Rust crate serde_json to 1.0.103
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 01:03:43 +00:00
067332b116 Update Rust crate semver to 1.0.18
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-16 00:15:56 +00:00
1257a637b1 Update Rust crate clap to 4.3.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-15 00:15:43 +00:00
e0822e3585 Update Rust crate serde_json to 1.0.102
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-13 00:15:53 +00:00
42bea6bba4 Update Rust crate serde_json to 1.0.101
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 00:51:14 +00:00
50e2db5256 Update Rust crate num to 0.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-12 00:16:01 +00:00
7ef779d804 Update Rust crate serde to 1.0.171
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-11 00:53:14 +00:00
13bb37fa51 Update Rust crate rustls to 0.21.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-11 00:16:11 +00:00
144848563b Update Rust crate serde to 1.0.170
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-10 00:16:30 +00:00
99bcf6e5ac Update Rust crate serde_json to 1.0.100
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-09 00:20:42 +00:00
daafca93a9 Update Rust crate rustls to 0.21.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-08 00:16:05 +00:00
04c4813cee Merge pull request 'Update Rust crate hyper-rustls to 0.24.1' (#58) from renovate/hyper-rustls-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #58
2023-07-07 15:54:51 +00:00
764f6f5112 Update Rust crate serde to 1.0.167
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-07 00:16:08 +00:00
0cfd2fc3f2 Update Rust crate hyper-rustls to 0.24.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-07 00:15:56 +00:00
46be9732de Attempt to enable auto merge
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-06 19:11:22 +02:00
6b4bd56684 Merge pull request 'Update Rust crate clap to 4.3.11' (#60) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #60
2023-07-06 17:08:08 +00:00
9a19272ba6 Merge pull request 'Update Rust crate serde to 1.0.166' (#57) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #57
2023-07-06 17:07:58 +00:00
c7f0be52cd Update Rust crate clap to 4.3.11
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-06 00:09:42 +00:00
37f7c20e36 Update Rust crate serde to 1.0.166
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-05 00:09:57 +00:00
75d55b4a23 Merge pull request 'Update Rust crate uuid to 1.4.0' (#55) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #55
2023-07-04 16:42:27 +00:00
0c394f301a Merge pull request 'Update Rust crate clap to 4.3.10' (#52) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #52
2023-07-04 16:42:14 +00:00
c87a549a8a Merge pull request 'Update Rust crate num-derive to 0.4.0' (#56) from renovate/num-derive-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #56
2023-07-04 16:42:02 +00:00
98cc8884af Merge pull request 'Update Rust crate serde_json to 1.0.99' (#53) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #53
2023-07-04 16:41:38 +00:00
03c842017c Merge pull request 'Update Rust crate tokio to 1.29.1' (#54) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #54
2023-07-04 16:41:26 +00:00
d87e5d816c Update Rust crate num-derive to 0.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-01 00:09:49 +00:00
eaf8d1c24e Update Rust crate clap to 4.3.10
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-01 00:09:36 +00:00
c4aa47f199 Update Rust crate tokio to 1.29.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-30 00:06:51 +00:00
9a623633cb Update Rust crate uuid to 1.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-28 00:08:46 +00:00
d1a28a0802 Update Rust crate serde_json to 1.0.99
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-25 00:09:04 +00:00
f6aa9977ba Merge pull request 'Update Rust crate clap to 4.3.5' (#51) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #51
2023-06-21 16:19:24 +00:00
7dd5464391 Update Rust crate clap to 4.3.5
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-21 00:16:55 +00:00
9f58d98a69 Merge pull request 'Update Rust crate serde_json to 1.0.97' (#50) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #50
2023-06-20 07:54:27 +00:00
841c6709cc Update Rust crate serde_json to 1.0.97
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-06-17 00:24:18 +00:00
e63566c6a9 Merge pull request 'Update Rust crate clap to 4.3.4' (#48) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #48
2023-06-15 13:31:01 +00:00
ac6f8987f4 Merge pull request 'Update Rust crate rustls to 0.21.2' (#49) from renovate/rustls-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #49
2023-06-15 13:30:54 +00:00
356fa75604 Update Rust crate rustls to 0.21.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-15 00:26:38 +00:00
563f33971f Update Rust crate clap to 4.3.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-15 00:26:26 +00:00
8f0db5cbe6 Merge pull request 'Update Rust crate log to 0.4.19' (#46) from renovate/log-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #46
2023-06-14 06:39:32 +00:00
5442536768 Merge pull request 'Update Rust crate uuid to 1.3.4' (#47) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #47
2023-06-14 06:39:23 +00:00
f6b0962ec3 Update Rust crate uuid to 1.3.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-14 00:26:18 +00:00
2909bbc1c9 Update Rust crate log to 0.4.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-06-12 00:25:46 +00:00
fd1025c4a8 Merge pull request 'Update Rust crate serde to 1.0.164' (#44) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #44
2023-06-09 09:20:41 +00:00
ccadddaf15 Update Rust crate serde to 1.0.164
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-09 00:26:23 +00:00
2a0987defd Merge pull request 'Update Rust crate clap to 4.3.2' (#43) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #43
2023-06-06 06:35:00 +00:00
cb6ca75515 Update Rust crate clap to 4.3.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-06 00:26:16 +00:00
964c90e0d8 Merge pull request 'Update Rust crate tokio to 1.28.2' (#41) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #41
2023-05-30 08:38:40 +00:00
81a05b8f66 Merge pull request 'Update Rust crate log to 0.4.18' (#42) from renovate/log-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #42
2023-05-30 08:38:31 +00:00
d2801c6b50 Update Rust crate log to 0.4.18
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-29 00:34:41 +00:00
1328baaba7 Update Rust crate tokio to 1.28.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-28 00:32:14 +00:00
d06585ad71 Update rustls, tokio-tungstenite & hyper-rustls
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-25 09:54:12 +02:00
3ab8201c13 Merge pull request 'Update Rust crate serde_with to v3' (#40) from renovate/serde_with-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #40
2023-05-25 07:43:00 +00:00
c0232f602e Merge pull request 'Update Rust crate clap to 4.3.0' (#38) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #38
2023-05-24 06:34:58 +00:00
5f2b7654be Merge pull request 'Update Rust crate uuid to 1.3.3' (#37) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #37
2023-05-24 06:34:49 +00:00
08a449352b Merge pull request 'Update Rust crate serde to 1.0.163' (#35) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #35
2023-05-23 11:37:40 +00:00
50fbbe50bf Merge pull request 'Update Rust crate tokio to 1.28.1' (#36) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #36
2023-05-23 11:37:32 +00:00
f4356c656b Update Rust crate clap to 4.3.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-23 09:51:50 +00:00
b12657ef3a Merge pull request 'Update Rust crate clap to 4.2.7' (#34) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #34
2023-05-16 09:56:37 +00:00
ad868a7961 Update Rust crate uuid to 1.3.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-16 00:32:59 +00:00
221d1dfa13 Update Rust crate tokio to 1.28.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-16 00:32:51 +00:00
33ed27b892 Update Rust crate serde to 1.0.163
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-16 00:32:46 +00:00
9e6df3c78d Update Rust crate clap to 4.2.7
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-11 00:11:09 +00:00
6faf38003f Merge pull request 'Update Rust crate clap to 4.2.5' (#33) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #33
2023-05-05 17:57:09 +00:00
cee12d89f6 Merge branch 'master' into renovate/clap-4.x
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-02 05:58:13 +00:00
887dd849c6 Merge pull request 'Update Rust crate serde to 1.0.160' (#29) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #29
2023-05-02 05:56:26 +00:00
2c8686e9d2 Update Rust crate serde_with to v3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-02 00:23:12 +00:00
7d92555a85 Merge pull request 'Update Rust crate serde_with to 2.3.3' (#31) from renovate/serde_with-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #31
2023-05-01 17:29:03 +00:00
0a7e9b9661 Merge branch 'master' into renovate/serde-1.x
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-01 17:21:14 +00:00
3af6fd730e Merge branch 'master' into renovate/serde_with-2.x
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-01 17:21:04 +00:00
b532324654 Merge pull request 'Update Rust crate uuid to 1.3.2' (#30) from renovate/uuid-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #30
2023-05-01 17:20:52 +00:00
de218d2ba1 Merge branch 'master' into renovate/uuid-1.x
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-01 11:40:23 +00:00
bb902cda9e Merge pull request 'Update Rust crate tokio to 1.28.0' (#32) from renovate/tokio-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #32
2023-05-01 08:35:57 +00:00
77d5b18f79 Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-01 10:28:43 +02:00
7125076f1f Update Rust crate uuid to 1.3.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2023-05-01 08:21:29 +00:00
4ed1c9c200 Update Rust crate serde_with to 2.3.3
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-04-29 00:09:17 +00:00
fa4b0bcdc2 Update Rust crate clap to 4.2.5
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2023-04-29 00:08:53 +00:00
40bff4f8e4 Update Rust crate tokio to 1.28.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2023-04-26 00:31:35 +00:00
283ea7d422 Update Rust crate serde to 1.0.160
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-04-26 00:31:21 +00:00
c746313c04 Merge pull request 'Update Rust crate clap to 4.2.4' (#28) from renovate/clap-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #28
2023-04-24 09:25:44 +00:00
86d45ad992 Merge pull request 'Update Rust crate serde_json to 1.0.96' (#27) from renovate/serde_json-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #27
2023-04-24 09:25:32 +00:00
5ba2e78fd0 Update Rust crate clap to 4.2.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-20 00:25:55 +00:00
1265d7f099 Merge pull request 'Update Rust crate clap to 4.2.2' (#25) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #25
2023-04-18 19:02:51 +00:00
b713117a70 Update Rust crate clap to 4.2.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-18 00:28:43 +00:00
a001017821 Update Rust crate serde_json to 1.0.96
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-13 00:28:31 +00:00
5acbe069c2 Merge pull request 'Update Rust crate serde_json to 1.0.95' (#23) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #23
2023-04-11 11:52:38 +00:00
6defd8edd2 Merge pull request 'Update Rust crate clap to 4.2.1' (#24) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #24
2023-04-11 11:52:28 +00:00
ef598dbff4 Update Rust crate clap to 4.2.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-01 00:09:41 +00:00
2abe1c95d0 Update Rust crate serde_json to 1.0.95
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-04-01 00:09:32 +00:00
f7bb0ddda2 Merge pull request 'Update Rust crate serde to 1.0.159' (#20) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #20
2023-03-29 08:35:44 +00:00
d1114f0295 Update Rust crate serde to 1.0.159
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-03-29 00:26:30 +00:00
f94a51027b Update dependencies to their latest versions
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-19 18:58:34 +01:00
f5f2efcfde cargo update 2023-03-19 18:56:46 +01:00
eb9999b85b Fix build issue 2023-03-19 18:54:44 +01:00
df1d678ab9 Add more emojies
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-18 10:05:43 +02:00
e88d64ff63 Bump to version 0.1.0 -> 0.2.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-10-18 09:39:54 +02:00
3ca6c43c9a Add additional routes for the future clients of SeaBattle 2022-10-18 09:34:26 +02:00
d4223be8b4 Improve test 2022-10-18 09:24:08 +02:00
83d0780954 Add a route to get default rules 2022-10-18 09:17:15 +02:00
6be3eae863 Clear terminal before returning to main menu
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-18 09:13:59 +02:00
c763a24ca9 Can press 'Esc' key to close windows 2022-10-18 09:11:08 +02:00
10c099e03b Handle connection errors in a better way 2022-10-18 09:04:25 +02:00
eea2ecbf63 Add version check system 2022-10-18 08:58:36 +02:00
915426849b Rename variable 2022-10-18 08:13:25 +02:00
be454cce03 Update READMEs
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-10-17 20:29:41 +02:00
a91a4c5ef6 Improve READMEs
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 20:25:19 +02:00
02477e6728 Specify crate version
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-10-17 19:18:13 +02:00
e389b59ab9 Add information to crates 2022-10-17 19:16:16 +02:00
dfaa5ce30b Rename crate 2022-10-17 19:13:16 +02:00
cf1d77f445 Fix appearance issues of game maps
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 19:04:27 +02:00
0280daf6d2 Fix appearance issues
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 19:00:13 +02:00
38656661b4 Fix appearance issues
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 18:54:03 +02:00
5b228de285 Fix issue on rematch request screen 2022-10-17 18:49:52 +02:00
d8f96f732a Can play using invites 2022-10-17 18:47:33 +02:00
e760bcbe33 Handle better small screens
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 09:42:24 +02:00
ccb3d36fae Complete previous test
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-17 08:38:03 +02:00
fcc7f30e10 Test strike timeout 2022-10-17 08:35:49 +02:00
171c88f303 Move result structures to a more appropriate location 2022-10-17 08:24:40 +02:00
9162c5eb24 Display timeout in game UI 2022-10-17 08:21:42 +02:00
b4772aa88e Fix automatic fire 2022-10-17 08:03:13 +02:00
42b0d84f9d Implement strike timeout on server side 2022-10-17 07:59:42 +02:00
ba1ed84b33 Add strike timeout setting 2022-10-17 07:42:17 +02:00
8c1a3f2c5f Fix typo 2022-10-16 20:29:34 +02:00
25871de084 Add a message to explain why connection are closed in case of invalid player names 2022-10-16 20:23:12 +02:00
9a38a634eb Can run cli as server
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-16 19:52:34 +02:00
8990badaa4 Handle screens too small for setting boats layout 2022-10-16 19:42:43 +02:00
b1145cc362 Limit player name length
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-16 18:51:05 +02:00
e0132b68ed Can notify a player that the server is waiting for opponent play configuration 2022-10-16 18:42:18 +02:00
e97f4b593a Can fire directly with the mouse 2022-10-16 18:38:22 +02:00
1c08e2ec01 Connections are properly closed 2022-10-16 18:35:17 +02:00
70d70c2851 Handle bug that happens when a player leaves the game in an early stage 2022-10-16 18:35:17 +02:00
04ee20dac2 Fix a few bugs 2022-10-16 18:06:31 +02:00
3c2b96f3a2 Can play against random player
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-16 17:47:41 +02:00
161391db04 Update dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-16 15:02:35 +02:00
19e1d559f6 Merge pull request 'Configure Renovate' (#1) from renovate/configure into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #1
2022-10-16 12:55:52 +00:00
341556636c Ignore Flutter & React client (in advance) 2022-10-16 12:54:28 +00:00
7d4cc52d7b Add drone CI pipeline 2022-10-16 14:50:05 +02:00
4501be6a43 Create docker image for release 2022-10-16 14:36:57 +02:00
146b009fe7 Add renovate.json 2022-10-16 00:33:30 +00:00
f2ec85b46f Can request & respond to rematch 2022-10-15 17:46:14 +02:00
a2c880814c Can get opponent last fire location 2022-10-15 16:33:45 +02:00
b832ef82ed Improve grid appearance 2022-10-15 16:27:22 +02:00
4341bdc682 Improve colors 2022-10-15 16:11:30 +02:00
58 changed files with 3192 additions and 1194 deletions

14
.drone.yml Normal file
View File

@@ -0,0 +1,14 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: cargo_check
image: rust
commands:
- cd rust
- rustup component add clippy
- cargo clippy -- -D warnings
- cargo test

View File

@@ -1,5 +1,17 @@
# SeaBattle
[![Build Status](https://drone.communiquons.org/api/badges/pierre/SeaBattle/status.svg)](https://drone.communiquons.org/pierre/SeaBattle)
Full stack sea battle game.
Current status: working on backend, and then building web ui...
## Implementations
Current implementations:
- [x] Rust shell implementations ([server](rust/sea_battle_backend) and [client](rust/sea_battle_cli_player))
- [ ] web implementation
- [ ] mobile implementation
## Screenshots
### Shell implementation
![Shell implementation example](rust/sea_battle_cli_player/img/SeaBattleCli.png)

10
renovate.json Normal file
View File

@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"ignorePaths": ["**/flutter/**", "**/react/**"],
"packageRules": [
{
"matchUpdateTypes": ["major", "minor", "patch"],
"automerge": true
}
]
}

2009
rust/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = [
"sea_battle_backend",
"cli_player"
"sea_battle_cli_player"
]

6
rust/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM debian:bookworm-slim
COPY sea_battle_backend /usr/local/bin/sea_battle_backend
ENTRYPOINT /usr/local/bin/sea_battle_backend

10
rust/build_docker_image.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
cargo build --release --bins
TEMP_DIR=$(mktemp -d)
cp target/release/sea_battle_backend "$TEMP_DIR"
docker build -f Dockerfile "$TEMP_DIR" -t pierre42100/seabattleapi
rm -r $TEMP_DIR

View File

@@ -1,24 +0,0 @@
[package]
name = "cli_player"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sea_battle_backend = { path = "../sea_battle_backend" }
clap = { version = "3.2.17", features = ["derive"] }
log = "0.4.17"
env_logger = "0.9.0"
tui = "0.19.0"
crossterm = "0.25.0"
lazy_static = "1.4.0"
tokio = "1.21.2"
num = "0.4.0"
num-traits = "0.2.15"
num-derive = "0.3.3"
textwrap = "0.15.1"
tokio-tungstenite = "0.17.2"
serde_urlencoded = "0.7.1"
futures = "0.3.23"
serde_json = "1.0.85"

View File

@@ -1,142 +0,0 @@
use std::error::Error;
use std::io;
use std::io::ErrorKind;
use crossterm::event::DisableMouseCapture;
use crossterm::event::EnableMouseCapture;
use crossterm::execute;
use crossterm::terminal::EnterAlternateScreen;
use crossterm::terminal::LeaveAlternateScreen;
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
use env_logger::Env;
use tui::backend::{Backend, CrosstermBackend};
use tui::Terminal;
use cli_player::cli_args::{cli_args, TestDevScreen};
use cli_player::client::Client;
use cli_player::server::start_server_if_missing;
use cli_player::ui_screens::configure_game_rules::GameRulesConfigurationScreen;
use cli_player::ui_screens::game_screen::GameScreen;
use cli_player::ui_screens::popup_screen::PopupScreen;
use cli_player::ui_screens::select_play_mode_screen::{SelectPlayModeResult, SelectPlayModeScreen};
use cli_player::ui_screens::*;
use sea_battle_backend::data::GameRules;
use sea_battle_backend::human_player_ws::ServerMessage;
/// Test code screens
async fn run_dev<B: Backend>(
terminal: &mut Terminal<B>,
d: TestDevScreen,
) -> Result<(), Box<dyn Error>> {
let res = match d {
TestDevScreen::Popup => popup_screen::PopupScreen::new("Welcome there!!")
.show(terminal)?
.as_string(),
TestDevScreen::Input => input_screen::InputScreen::new("What it your name ?")
.set_title("A custom title")
.show(terminal)?
.as_string(),
TestDevScreen::Confirm => {
confirm_dialog_screen::ConfirmDialogScreen::new("Do you really want to quit game?")
.show(terminal)?
.as_string()
}
TestDevScreen::SelectBotType => select_bot_type_screen::SelectBotTypeScreen::default()
.show(terminal)?
.as_string(),
TestDevScreen::SelectPlayMode => select_play_mode_screen::SelectPlayModeScreen::default()
.show(terminal)?
.as_string(),
TestDevScreen::SetBoatsLayout => {
let rules = GameRules {
boats_can_touch: true,
..Default::default()
};
set_boats_layout_screen::SetBoatsLayoutScreen::new(&rules)
.show(terminal)?
.as_string()
}
TestDevScreen::ConfigureGameRules => {
configure_game_rules::GameRulesConfigurationScreen::new(GameRules::default())
.show(terminal)?
.as_string()
}
};
Err(io::Error::new(
ErrorKind::Other,
format!("DEV result: {:?}", res),
))?
}
async fn run_app<B: Backend>(terminal: &mut Terminal<B>) -> Result<(), Box<dyn Error>> {
if let Some(d) = cli_args().dev_screen {
return run_dev(terminal, d).await;
}
let mut rules = GameRules::default();
loop {
match SelectPlayModeScreen::default().show(terminal)? {
// TODO : Play against random player
ScreenResult::Ok(SelectPlayModeResult::PlayRandom) => todo!(),
// Play against bot
ScreenResult::Ok(SelectPlayModeResult::PlayAgainstBot) => {
// First, ask for custom rules
rules = match GameRulesConfigurationScreen::new(rules.clone()).show(terminal)? {
ScreenResult::Ok(r) => r,
ScreenResult::Canceled => continue,
};
// Then connect to server
PopupScreen::new("Connecting...").show_once(terminal)?;
let client = Client::start_bot_play(&rules).await?;
// Wait for the server to become ready
while !matches!(
client.recv_next_message().await?,
ServerMessage::OpponentConnected
) {}
// Display game screen
GameScreen::new(client).show(terminal).await?;
}
ScreenResult::Canceled | ScreenResult::Ok(SelectPlayModeResult::Exit) => return Ok(()),
}
}
}
#[tokio::main]
pub async fn main() -> Result<(), Box<dyn Error>> {
env_logger::Builder::from_env(Env::default()).init();
start_server_if_missing().await;
// setup terminal
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
// create app and run it
let res = run_app(&mut terminal).await;
// restore terminal
disable_raw_mode()?;
execute!(
terminal.backend_mut(),
LeaveAlternateScreen,
DisableMouseCapture
)?;
terminal.show_cursor()?;
if let Err(err) = res {
println!("{:?}", err)
}
Ok(())
}

View File

@@ -1,372 +0,0 @@
use std::cmp::max;
use std::collections::HashMap;
use std::time::{Duration, Instant};
use crossterm::event;
use crossterm::event::{Event, KeyCode, MouseButton, MouseEventKind};
use tui::backend::Backend;
use tui::layout::{Constraint, Direction, Layout};
use tui::style::Color;
use tui::widgets::Paragraph;
use tui::{Frame, Terminal};
use sea_battle_backend::data::{Coordinates, CurrentGameMapStatus, CurrentGameStatus};
use sea_battle_backend::human_player_ws::{ClientMessage, ServerMessage};
use sea_battle_backend::utils::Res;
use crate::client::Client;
use crate::constants::*;
use crate::ui_screens::confirm_dialog_screen::confirm;
use crate::ui_screens::popup_screen::PopupScreen;
use crate::ui_screens::set_boats_layout_screen::SetBoatsLayoutScreen;
use crate::ui_screens::utils::{centered_rect_size, centered_text};
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::game_map_widget::{ColoredCells, GameMapWidget};
type CoordinatesMapper = HashMap<Coordinates, Coordinates>;
#[derive(Eq, PartialEq)]
enum GameStatus {
Pending,
WaitingForOpponentBoatsConfig,
OpponentReady,
Starting,
MustFire,
OpponentMustFire,
}
impl GameStatus {
pub fn can_show_game_maps(&self) -> bool {
self != &GameStatus::Pending
&& self != &GameStatus::WaitingForOpponentBoatsConfig
&& self != &GameStatus::OpponentReady
}
pub fn status_text(&self) -> &str {
match self {
GameStatus::Pending => "Game is pending...",
GameStatus::WaitingForOpponentBoatsConfig => "Waiting for ### boats configuration",
GameStatus::OpponentReady => "### is ready!",
GameStatus::Starting => "Game is starting...",
GameStatus::MustFire => "You must fire!",
GameStatus::OpponentMustFire => "### must fire!",
}
}
}
pub struct GameScreen {
client: Client,
status: GameStatus,
opponent_name: Option<String>,
game: CurrentGameStatus,
curr_shoot_position: Coordinates,
}
impl GameScreen {
pub fn new(client: Client) -> Self {
Self {
client,
status: GameStatus::Pending,
opponent_name: None,
game: Default::default(),
curr_shoot_position: Coordinates::new(0, 0),
}
}
pub async fn show<B: Backend>(mut self, terminal: &mut Terminal<B>) -> Res<ScreenResult> {
let mut last_tick = Instant::now();
let mut coordinates_mapper = CoordinatesMapper::new();
loop {
// Update UI
terminal.draw(|f| coordinates_mapper = self.ui(f))?;
let timeout = TICK_RATE
.checked_sub(last_tick.elapsed())
.unwrap_or_else(|| Duration::from_secs(0));
// Handle terminal events
if crossterm::event::poll(timeout)? {
let event = event::read()?;
// Keyboard event
if let Event::Key(key) = &event {
let mut new_shoot_pos = self.curr_shoot_position;
match key.code {
// Leave game
KeyCode::Char('q')
if confirm(terminal, "Do you really want to leave game?") =>
{
return Ok(ScreenResult::Canceled);
}
// Move shoot cursor
KeyCode::Left if self.can_fire() => new_shoot_pos = new_shoot_pos.add_x(-1),
KeyCode::Right if self.can_fire() => new_shoot_pos = new_shoot_pos.add_x(1),
KeyCode::Up if self.can_fire() => new_shoot_pos = new_shoot_pos.add_y(-1),
KeyCode::Down if self.can_fire() => new_shoot_pos = new_shoot_pos.add_y(1),
// Shoot
KeyCode::Enter if self.can_fire() => {
if self.game.can_fire_at_location(self.curr_shoot_position) {
self.client
.send_message(&ClientMessage::Fire {
location: self.curr_shoot_position,
})
.await?;
}
}
_ => {}
}
if new_shoot_pos.is_valid(&self.game.rules) {
self.curr_shoot_position = new_shoot_pos;
}
}
// Mouse event
if let Event::Mouse(mouse) = event {
if mouse.kind == MouseEventKind::Up(MouseButton::Left) {
if let Some(c) =
coordinates_mapper.get(&Coordinates::new(mouse.column, mouse.row))
{
self.curr_shoot_position = *c;
}
}
}
}
// Handle incoming messages
while let Some(msg) = self.client.try_recv_next_message().await? {
match msg {
ServerMessage::SetInviteCode { .. } => unimplemented!(),
ServerMessage::InvalidInviteCode => unimplemented!(),
ServerMessage::WaitingForAnotherPlayer => unimplemented!(),
ServerMessage::OpponentConnected => unimplemented!(),
ServerMessage::SetOpponentName { name } => self.opponent_name = Some(name),
ServerMessage::QueryBoatsLayout { rules } => {
match SetBoatsLayoutScreen::new(&rules)
.set_confirm_on_cancel(true)
.show(terminal)?
{
ScreenResult::Ok(layout) => {
self.client
.send_message(&ClientMessage::BoatsLayout { layout })
.await?
}
ScreenResult::Canceled => {
return Ok(ScreenResult::Canceled);
}
};
}
ServerMessage::RejectedBoatsLayout { .. } => {
PopupScreen::new("Server rejected boats layout!! (is your version of SeaBattle up to date?)")
.show(terminal)?;
}
ServerMessage::WaitingForOtherPlayerConfiguration => {
self.status = GameStatus::WaitingForOpponentBoatsConfig;
}
ServerMessage::OpponentReady => {
self.status = GameStatus::OpponentReady;
}
ServerMessage::GameStarting => {
self.status = GameStatus::Starting;
}
ServerMessage::OpponentMustFire { status } => {
self.status = GameStatus::OpponentMustFire;
self.game = status;
}
ServerMessage::RequestFire { status } => {
self.status = GameStatus::MustFire;
self.game = status;
}
ServerMessage::FireResult { .. } => {}
ServerMessage::OpponentFireResult { .. } => {}
ServerMessage::LostGame { .. } => {}
ServerMessage::WonGame { .. } => {}
ServerMessage::OpponentRequestedRematch => {}
ServerMessage::OpponentAcceptedRematch => {}
ServerMessage::OpponentRejectedRematch => {}
ServerMessage::OpponentLeftGame => {}
ServerMessage::OpponentReplacedByBot => {}
}
}
if last_tick.elapsed() >= TICK_RATE {
last_tick = Instant::now();
}
}
}
fn can_fire(&self) -> bool {
matches!(self.status, GameStatus::MustFire)
}
fn opponent_name(&self) -> &str {
self.opponent_name.as_deref().unwrap_or("opponent")
}
fn player_map(&self, map: &CurrentGameMapStatus, opponent_map: bool) -> GameMapWidget {
let mut map_widget = GameMapWidget::new(&self.game.rules);
// Current shoot position
if opponent_map {
map_widget = map_widget.add_colored_cells(ColoredCells {
color: match self.game.can_fire_at_location(self.curr_shoot_position) {
true => Color::Green,
false => Color::LightYellow,
},
cells: vec![self.curr_shoot_position],
});
}
// Sunk boats
let sunk_boats = ColoredCells {
color: Color::Gray,
cells: map
.sunk_boats
.iter()
.flat_map(|b| b.all_coordinates())
.collect::<Vec<_>>(),
};
// Touched boats
let touched_areas = ColoredCells {
color: Color::Red,
cells: map.successful_strikes.clone(),
};
// Failed strikes
let failed_strikes = ColoredCells {
color: Color::DarkGray,
cells: map.failed_strikes.clone(),
};
// Boats
let boats = ColoredCells {
color: Color::Blue,
cells: map
.boats
.0
.iter()
.flat_map(|b| b.all_coordinates())
.collect::<Vec<_>>(),
};
map_widget
.add_colored_cells(sunk_boats)
.add_colored_cells(touched_areas)
.add_colored_cells(failed_strikes)
.add_colored_cells(boats)
}
fn ui<B: Backend>(&mut self, f: &mut Frame<B>) -> CoordinatesMapper {
let status_text = self
.status
.status_text()
.replace("###", self.opponent_name());
// If the game is in a state where game maps can not be shown
if !self.status.can_show_game_maps() {
PopupScreen::new(&status_text).show_in_frame(f);
return HashMap::default();
}
// Draw main ui (default play UI)
let player_map = self
.player_map(&self.game.your_map, false)
.set_title("YOUR map");
let mut coordinates_mapper = HashMap::new();
let mut opponent_map = self
.player_map(&self.game.opponent_map, true)
.set_title(self.opponent_name())
.set_yield_func(|c, r| {
for i in 0..r.width {
for j in 0..r.height {
coordinates_mapper.insert(Coordinates::new(r.x + i, r.y + j), c);
}
}
});
if self.can_fire() {
opponent_map = opponent_map
.set_legend("Use arrows + Enter\nor click on the place\nwhere you want\nto shoot");
}
// Show both maps if there is enough room on the screen
let player_map_size = player_map.estimated_size();
let opponent_map_size = opponent_map.estimated_size();
let both_maps_width = player_map_size.0 + opponent_map_size.0 + 3;
let show_both_maps = both_maps_width <= f.size().width;
let maps_height = max(player_map_size.1, opponent_map_size.1);
let maps_width = match show_both_maps {
true => both_maps_width,
false => max(player_map_size.0, opponent_map_size.0),
};
let max_width = max(maps_width, status_text.len() as u16);
let total_height = 3 + maps_height + 3;
// Check if frame is too small
if max_width > f.size().width || total_height > f.size().height {
PopupScreen::new("Screen too small!").show_in_frame(f);
return HashMap::default();
}
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(3),
Constraint::Length(maps_height),
Constraint::Length(3),
])
.split(centered_rect_size(max_width, total_height, &f.size()));
// Render status
let paragraph = Paragraph::new(status_text.as_str());
f.render_widget(paragraph, centered_text(&status_text, &chunks[0]));
// Render maps
if show_both_maps {
let maps_chunks = Layout::default()
.direction(Direction::Horizontal)
.constraints([
Constraint::Length(player_map_size.0),
Constraint::Length(3),
Constraint::Length(opponent_map_size.0),
])
.split(chunks[1]);
f.render_widget(player_map, maps_chunks[0]);
f.render_widget(opponent_map, maps_chunks[2]);
} else {
// Render a single map
if self.can_fire() {
f.render_widget(opponent_map, chunks[1]);
} else {
f.render_widget(player_map, chunks[1]);
drop(opponent_map);
}
}
// Render buttons
// TODO : at the end of the game
coordinates_mapper
}
}

View File

@@ -1,28 +1,35 @@
[package]
name = "sea_battle_backend"
version = "0.1.0"
version = "0.2.1"
edition = "2021"
license = "GPL-2.0-or-later"
description = "A Sea Battle game backend server"
repository = "https://gitea.communiquons.org/pierre/SeaBattle"
readme = "README.md"
authors = ["Pierre Hubert <pierre.git@communiquons.org>"]
categories = [ "games" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
clap = { version = "3.2.17", features = ["derive"] }
log = "0.4.17"
env_logger = "0.9.0"
serde = { version = "1.0.144", features = ["derive"] }
serde_json = "1.0.85"
actix-web = "4.1.0"
actix-cors = "0.6.2"
actix = "0.13.0"
actix-web-actors = "4.1.0"
actix-rt = "2.7.0"
uuid = { version = "1.1.2", features = ["v4"] }
clap = { version = "4.5.4", features = ["derive"] }
log = "0.4.21"
env_logger = "0.11.3"
serde = { version = "1.0.200", features = ["derive"] }
serde_json = "1.0.116"
actix-web = "4.5.1"
actix-cors = "0.7.0"
actix = "0.13.3"
actix-web-actors = "4.3.0"
actix-rt = "2.9.0"
uuid = { version = "1.8.0", features = ["v4"] }
rand = "0.8.5"
serde_with = "2.0.1"
serde_with = "3.8.1"
tokio = { version = "1", features = ["full"] }
semver = "1.0.22"
[dev-dependencies]
#reqwest = { version = "0.11.11", default-features = false, features = ["json", "rustls-tls"] }
tokio-tungstenite = "0.17.2"
tokio-tungstenite = "0.21.0"
serde_urlencoded = "0.7.1"
futures = "0.3.23"
futures = "0.3.30"

View File

@@ -0,0 +1,30 @@
# Sea battle backend
[![Build Status](https://drone.communiquons.org/api/badges/pierre/SeaBattle/status.svg)](https://drone.communiquons.org/pierre/SeaBattle)
[![Crate](https://img.shields.io/crates/v/sea_battle_backend.svg)](https://crates.io/crates/sea_battle_backend)
[![Documentation](https://docs.rs/sea_battle_backend/badge.svg)](https://docs.rs/sea_battle_backend/)
A backend HTTP server for the Sea Battle game. The binary included in
this crate can be used to deploy a server that will allow players to
connect to play together.
The `actix-web` library is used to spawn HTTP server. The games are encapsulated
inside websockets.
An official server is running at https://seabattleapi.communiquons.org/
## Installation
You can install the backend using the following command:
```bash
cargo install sea_battle_backend
```
## Usage
```bash
sea_battle_backend -l 0.0.0.0:7000
```
> Note: a reverse-proxy must be used to protect
## Client
A command-line client is available in the [sea_battle_cli_player](https://crates.io/crates/sea_battle_cli_player) crate.

View File

@@ -12,3 +12,14 @@ pub struct Args {
#[clap(short, long, value_parser)]
pub cors: Option<String>,
}
#[cfg(test)]
mod test {
use crate::args::Args;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert()
}
}

View File

@@ -58,6 +58,8 @@ impl Player for BotPlayer {
unreachable!()
}
fn waiting_for_opponent_boats_layout(&self) {}
fn notify_other_player_ready(&self) {}
fn notify_game_starting(&self) {}

View File

@@ -1,5 +1,8 @@
//! # Project constants
pub const MIN_REQUIRED_VERSION: &str = "0.1.0";
pub const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const MIN_BOATS_NUMBER: usize = 1;
pub const MAX_BOATS_NUMBER: usize = 10;
@@ -21,3 +24,9 @@ pub const MULTI_PLAYER_PLAYER_BOATS: [usize; 5] = [2, 3, 3, 4, 5];
pub const ALPHABET: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
pub const INVITE_CODE_LENGTH: usize = 5;
pub const MIN_PLAYER_NAME_LENGTH: usize = 1;
pub const MAX_PLAYER_NAME_LENGTH: usize = 10;
pub const MIN_STRIKE_TIMEOUT: u64 = 5;
pub const MAX_STRIKE_TIMEOUT: u64 = 90;

View File

@@ -85,6 +85,10 @@ impl Coordinates {
}
}
pub fn invalid() -> Self {
Self { x: -1, y: -1 }
}
pub fn is_valid(&self, rules: &GameRules) -> bool {
self.x >= 0
&& self.y >= 0
@@ -357,7 +361,7 @@ impl BoatsLayout {
mod test {
use crate::data::boats_layout::{BoatDirection, BoatPosition, BoatsLayout, Coordinates};
use crate::data::game_map::GameMap;
use crate::data::{BotType, GameRules, PlayConfiguration, PrintableMap};
use crate::data::*;
#[test]
fn dist_coordinates_eq() {
@@ -484,8 +488,7 @@ mod test {
map_height: 5,
boats_str: "1,1".to_string(),
boats_can_touch: false,
player_continue_on_hit: false,
bot_type: BotType::Random,
..Default::default()
};
let mut boats = BoatsLayout(vec![

View File

@@ -78,6 +78,7 @@ impl PrintableMap for PrintableCurrentGameMapStatus {
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Default)]
pub struct CurrentGameStatus {
pub remaining_time_for_strike: Option<u64>,
pub rules: GameRules,
pub your_map: CurrentGameMapStatus,
pub opponent_map: CurrentGameMapStatus,
@@ -300,6 +301,12 @@ impl CurrentGameStatus {
BotType::Smart => self.find_smart_bot_fire_location(),
}
}
/// Check out whether game is over or not
pub fn is_game_over(&self) -> bool {
self.opponent_map.sunk_boats.len() == self.rules.boats_list().len()
|| self.your_map.sunk_boats.len() == self.rules.boats_list().len()
}
}
#[cfg(test)]

View File

@@ -1,6 +1,6 @@
use crate::consts::*;
use crate::data::{BotType, PlayConfiguration};
use serde_with::{serde_as, DisplayFromStr};
use serde_with::{serde_as, DisplayFromStr, NoneAsEmptyString};
#[serde_as]
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)]
@@ -15,6 +15,8 @@ pub struct GameRules {
pub boats_can_touch: bool,
#[serde_as(as = "DisplayFromStr")]
pub player_continue_on_hit: bool,
#[serde_as(as = "NoneAsEmptyString")]
pub strike_timeout: Option<u64>,
pub bot_type: BotType,
}
@@ -36,6 +38,7 @@ impl GameRules {
.join(","),
boats_can_touch: MULTI_PLAYER_BOATS_CAN_TOUCH,
player_continue_on_hit: MULTI_PLAYER_PLAYER_CAN_CONTINUE_AFTER_HIT,
strike_timeout: Some(30),
bot_type: BotType::Smart,
}
}
@@ -50,6 +53,11 @@ impl GameRules {
self
}
pub fn with_strike_timeout(mut self, timeout: u64) -> Self {
self.strike_timeout = Some(timeout);
self
}
/// Set the list of boats for this configuration
pub fn set_boats_list(&mut self, boats: &[usize]) {
self.boats_str = boats
@@ -121,12 +129,22 @@ impl GameRules {
}
}
if let Some(timeout) = self.strike_timeout {
if timeout < config.min_strike_timeout {
errors.push("Strike timeout is too short!");
}
if timeout > config.max_strike_timeout {
errors.push("Strike timeout is too long!");
}
}
errors
}
/// Check out whether these game rules are valid or not
pub fn is_valid(&self) -> bool {
return self.get_errors().is_empty();
self.get_errors().is_empty()
}
}

View File

@@ -4,6 +4,7 @@ pub use game_map::*;
pub use game_rules::*;
pub use play_config::*;
pub use printable_map::*;
pub use version::*;
mod boats_layout;
mod current_game_status;
@@ -11,3 +12,4 @@ mod game_map;
mod game_rules;
mod play_config;
mod printable_map;
mod version;

View File

@@ -57,6 +57,10 @@ pub struct PlayConfiguration {
pub max_boats_number: usize,
pub bot_types: &'static [BotDescription],
pub ordinate_alphabet: &'static str,
pub min_player_name_len: usize,
pub max_player_name_len: usize,
pub min_strike_timeout: u64,
pub max_strike_timeout: u64,
}
impl Default for PlayConfiguration {
@@ -72,6 +76,10 @@ impl Default for PlayConfiguration {
max_boats_number: MAX_BOATS_NUMBER,
bot_types: &BOTS_TYPES,
ordinate_alphabet: ALPHABET,
min_player_name_len: MIN_PLAYER_NAME_LENGTH,
max_player_name_len: MAX_PLAYER_NAME_LENGTH,
min_strike_timeout: MIN_STRIKE_TIMEOUT,
max_strike_timeout: MAX_STRIKE_TIMEOUT,
}
}
}

View File

@@ -0,0 +1,32 @@
//! # Version Info
//!
//! Contains server version requirements information
use crate::consts;
use crate::utils::res_utils::Res;
use semver::Version;
#[derive(serde::Serialize, serde::Deserialize)]
pub struct VersionInfo {
current: String,
min_required: String,
}
impl VersionInfo {
pub fn load_static() -> Self {
Self {
current: consts::CURRENT_VERSION.to_string(),
min_required: consts::MIN_REQUIRED_VERSION.to_string(),
}
}
/// Check if builtin version is compatible with a remote version or not
pub fn is_compatible_with_static_version(&self) -> Res<bool> {
let static_version = Self::load_static();
let local_current = Version::parse(&static_version.current)?;
let min_required = Version::parse(&self.min_required)?;
Ok(min_required <= local_current)
}
}

View File

@@ -89,7 +89,6 @@ impl Handler<CreateInvite> for DispatcherActor {
msg.1.do_send(ServerMessage::SetInviteCode {
code: invite_code.clone(),
});
msg.1.do_send(ServerMessage::WaitingForAnotherPlayer);
self.with_invite.insert(
invite_code,
PendingPlayer {

View File

@@ -1,4 +1,5 @@
use std::sync::Arc;
use std::time::Duration;
use actix::prelude::*;
use actix::{Actor, Context, Handler};
@@ -6,6 +7,7 @@ use uuid::Uuid;
use crate::bot_player::BotPlayer;
use crate::data::*;
use crate::utils::time_utils::time;
pub trait Player {
fn get_name(&self) -> &str;
@@ -22,6 +24,8 @@ pub trait Player {
fn rejected_boats_layout(&self, errors: Vec<&'static str>);
fn waiting_for_opponent_boats_layout(&self);
fn notify_other_player_ready(&self);
fn notify_game_starting(&self);
@@ -49,6 +53,9 @@ pub trait Player {
fn opponent_replaced_by_bot(&self);
}
/// How often strike timeout controller is run
const STRIKE_TIMEOUT_CONTROL: Duration = Duration::from_secs(1);
fn opponent(index: usize) -> usize {
match index {
0 => 1,
@@ -68,6 +75,14 @@ enum GameStatus {
RematchRejected,
}
impl GameStatus {
pub fn can_game_continue_with_bot(&self) -> bool {
*self != GameStatus::Finished
&& *self != GameStatus::RematchRejected
&& *self != GameStatus::RematchRequested
}
}
pub struct Game {
rules: GameRules,
players: Vec<Arc<dyn Player>>,
@@ -75,6 +90,7 @@ pub struct Game {
map_0: Option<GameMap>,
map_1: Option<GameMap>,
turn: usize,
curr_strike_request_started: u64,
}
impl Game {
@@ -86,6 +102,7 @@ impl Game {
map_0: None,
map_1: None,
turn: 0,
curr_strike_request_started: 0,
}
}
@@ -120,10 +137,14 @@ impl Game {
self.turn
);
self.request_fire();
self.request_fire(true);
}
fn request_fire(&self) {
fn request_fire(&mut self, reset_counter: bool) {
if reset_counter {
self.curr_strike_request_started = time();
}
self.players[self.turn].request_fire(self.get_game_status_for_player(self.turn));
self.players[opponent(self.turn)]
.opponent_must_fire(self.get_game_status_for_player(opponent(self.turn)));
@@ -138,6 +159,27 @@ impl Game {
.unwrap()
}
/// Replace user for a fire in case of timeout
fn force_fire_in_case_of_timeout(&mut self) {
if self.status != GameStatus::Started || self.rules.strike_timeout.is_none() {
return;
}
let timeout = self.rules.strike_timeout.unwrap_or_default();
if time() <= self.curr_strike_request_started + timeout {
return;
}
// Determine target of fire
let target = self
.get_game_status_for_player(self.turn)
.find_fire_coordinates_for_bot_type(self.rules.bot_type);
// Fire as player
self.handle_fire(target);
}
fn player_map_mut(&mut self, id: usize) -> &mut GameMap {
match id {
0 => self.map_0.as_mut(),
@@ -156,7 +198,7 @@ impl Game {
// Easiest case : player missed his fire
if result == FireResult::Missed {
self.turn = opponent(self.turn);
self.request_fire();
self.request_fire(true);
return;
}
@@ -178,7 +220,9 @@ impl Game {
self.turn = opponent(self.turn);
}
self.request_fire();
self.request_fire(
result != FireResult::AlreadyTargetedPosition && result != FireResult::Rejected,
);
}
fn handle_request_rematch(&mut self, player_id: Uuid) {
@@ -213,6 +257,9 @@ impl Game {
/// Get current game status for a specific player
fn get_game_status_for_player(&self, id: usize) -> CurrentGameStatus {
CurrentGameStatus {
remaining_time_for_strike: self.rules.strike_timeout.map(|v| {
((self.curr_strike_request_started + v) as i64 - time() as i64).max(0) as u64
}),
rules: self.rules.clone(),
your_map: self.player_map(id).current_map_status(false),
opponent_map: self
@@ -224,6 +271,14 @@ impl Game {
impl Actor for Game {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
if self.rules.strike_timeout.is_some() {
ctx.run_interval(STRIKE_TIMEOUT_CONTROL, |act, _ctx| {
act.force_fire_in_case_of_timeout();
});
}
}
}
#[derive(Message)]
@@ -286,6 +341,8 @@ impl Handler<SetBoatsLayout> for Game {
if self.map_0.is_some() && self.map_1.is_some() {
self.players.iter().for_each(|p| p.notify_game_starting());
self.start_fire_exchanges();
} else {
self.players[player_index].waiting_for_opponent_boats_layout();
}
}
}
@@ -363,7 +420,9 @@ impl Handler<PlayerLeftGame> for Game {
self.players[opponent(offline_player)].opponent_left_game();
// If the other player is a bot or if the game is not running, stop the game
if self.status != GameStatus::Started || self.players[opponent(offline_player)].is_bot() {
if !self.status.can_game_continue_with_bot()
|| self.players[opponent(offline_player)].is_bot()
{
ctx.stop();
} else {
// Replace the player with a bot
@@ -371,8 +430,11 @@ impl Handler<PlayerLeftGame> for Game {
Arc::new(BotPlayer::new(self.rules.bot_type, ctx.address()));
self.players[opponent(offline_player)].opponent_replaced_by_bot();
if self.turn == offline_player {
self.request_fire();
// Re-do current action
if self.status == GameStatus::Started {
self.request_fire(true);
} else if self.status == GameStatus::WaitingForBoatsDisposition {
self.players[offline_player].query_boats_layout(&self.rules);
}
}
}

View File

@@ -47,6 +47,11 @@ impl Player for HumanPlayer {
});
}
fn waiting_for_opponent_boats_layout(&self) {
self.player
.do_send(ServerMessage::WaitingForOtherPlayerConfiguration);
}
fn notify_other_player_ready(&self) {
self.player.do_send(ServerMessage::OpponentReady);
}
@@ -109,6 +114,7 @@ impl Player for HumanPlayer {
impl HumanPlayer {
pub fn handle_client_message(&self, msg: ClientMessage) {
log::debug!("Got message from client: {:?}", msg);
match msg {
ClientMessage::StopGame => self.game.do_send(PlayerLeftGame(self.uuid)),
ClientMessage::BoatsLayout { layout } => {

View File

@@ -8,6 +8,7 @@ use actix_web_actors::ws::{CloseCode, CloseReason, Message, ProtocolError, Webso
use uuid::Uuid;
use crate::bot_player::BotPlayer;
use crate::consts::{MAX_PLAYER_NAME_LENGTH, MIN_PLAYER_NAME_LENGTH};
use crate::data::{BoatsLayout, Coordinates, CurrentGameStatus, FireResult, GameRules};
use crate::dispatcher_actor::{AcceptInvite, CreateInvite, DispatcherActor, PlayRandom};
use crate::game::{AddPlayer, Game};
@@ -149,6 +150,13 @@ impl Actor for HumanPlayerWS {
type Context = WebsocketContext<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
// Check player name length
if self.name.len() < MIN_PLAYER_NAME_LENGTH || self.name.len() > MAX_PLAYER_NAME_LENGTH {
log::error!("Close connection due to invalid user name!");
ctx.stop();
return;
}
self.hb(ctx);
self.send_message(ServerMessage::WaitingForAnotherPlayer, ctx);
@@ -222,7 +230,7 @@ impl StreamHandler<Result<ws::Message, ProtocolError>> for HumanPlayerWS {
log::warn!("Got unsupported continuation message!");
}
Ok(Message::Pong(_)) => {
log::info!("Got pong message");
log::debug!("Got pong message");
self.hb = Instant::now();
}
Ok(Message::Close(reason)) => {
@@ -238,6 +246,7 @@ impl Handler<ServerMessage> for HumanPlayerWS {
type Result = ();
fn handle(&mut self, msg: ServerMessage, ctx: &mut Self::Context) -> Self::Result {
log::debug!("Send message through WS: {:?}", msg);
ctx.text(serde_json::to_string(&msg).unwrap());
}
}

View File

@@ -4,7 +4,7 @@ use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer, Responder};
use actix_web_actors::ws;
use crate::args::Args;
use crate::data::{GameRules, PlayConfiguration};
use crate::data::{BoatsLayout, GameRules, PlayConfiguration, VersionInfo};
use crate::dispatcher_actor::DispatcherActor;
use crate::human_player_ws::{HumanPlayerWS, StartMode};
@@ -18,11 +18,45 @@ async fn not_found() -> impl Responder {
HttpResponse::NotFound().json("You missed your strike lol")
}
/// Get bot configuration
/// Get version information
async fn version_information() -> impl Responder {
HttpResponse::Ok().json(VersionInfo::load_static())
}
/// Get game configuration
async fn game_configuration() -> impl Responder {
HttpResponse::Ok().json(PlayConfiguration::default())
}
/// Get default game rules
async fn default_game_rules() -> impl Responder {
HttpResponse::Ok().json(GameRules::random_players_rules())
}
/// Validate game rules
async fn validate_game_rules(rules: web::Json<GameRules>) -> impl Responder {
HttpResponse::Ok().json(rules.get_errors())
}
/// Generate random boats layout
async fn gen_boats_layout(rules: web::Json<GameRules>) -> impl Responder {
let errors = rules.get_errors();
if !errors.is_empty() {
return HttpResponse::BadRequest().json(errors);
}
match BoatsLayout::gen_random_for_rules(&rules) {
Ok(l) => HttpResponse::Ok().json(l),
Err(e) => {
log::error!(
"Failed to generate boats layout for valid game rules: {} ! / Rules: {:?}",
e,
rules
);
HttpResponse::InternalServerError().json("Failed to generate random layout!")
}
}
}
#[derive(serde::Serialize, serde::Deserialize, Eq, PartialEq, Debug)]
pub struct BotPlayQuery {
#[serde(flatten)]
@@ -130,7 +164,10 @@ async fn start_random(
log::info!("New random play");
resp
}
pub async fn start_server(args: Args) -> std::io::Result<()> {
log::info!("Start to listen on {}", args.listen_address);
let args_clone = args.clone();
let dispatcher_actor = DispatcherActor::default().start();
@@ -146,7 +183,11 @@ pub async fn start_server(args: Args) -> std::io::Result<()> {
App::new()
.app_data(web::Data::new(dispatcher_actor.clone()))
.wrap(cors)
.route("/version", web::get().to(version_information))
.route("/config", web::get().to(game_configuration))
.route("/game_rules/default", web::get().to(default_game_rules))
.route("/game_rules/validate", web::post().to(validate_game_rules))
.route("/generate_boats_layout", web::post().to(gen_boats_layout))
.route("/play/bot", web::get().to(start_bot_play))
.route("/play/create_invite", web::get().to(start_create_invite))
.route("/play/accept_invite", web::get().to(start_accept_invite))
@@ -161,6 +202,7 @@ pub async fn start_server(args: Args) -> std::io::Result<()> {
#[cfg(test)]
mod test {
use crate::data::GameRules;
use crate::server::BotPlayQuery;
#[test]
@@ -175,4 +217,20 @@ mod test {
assert_eq!(query, des)
}
#[test]
fn simple_bot_request_serialize_deserialize_no_timeout() {
let query = BotPlayQuery {
rules: GameRules {
strike_timeout: None,
..Default::default()
},
player_name: "Player".to_string(),
};
let string = serde_urlencoded::to_string(&query).unwrap();
let des = serde_urlencoded::from_str(&string).unwrap();
assert_eq!(query, des)
}
}

View File

@@ -39,7 +39,7 @@ pub struct BotClient {
requested_rules: GameRules,
layout: Option<BoatsLayout>,
number_plays: usize,
server_msg_callback: Option<Box<dyn FnMut(&ServerMessage)>>,
server_msg_callback: Option<Box<dyn FnMut(&mut ServerMessage)>>,
play_as_bot_type: BotType,
}
@@ -81,7 +81,7 @@ impl BotClient {
pub fn with_server_msg_callback<F>(mut self, cb: F) -> Self
where
F: FnMut(&ServerMessage) + 'static,
F: FnMut(&mut ServerMessage) + 'static,
{
self.server_msg_callback = Some(Box::new(cb));
self
@@ -152,7 +152,7 @@ impl BotClient {
};
while let Some(chunk) = socket.next().await {
let message = match chunk? {
let mut message = match chunk? {
Message::Text(message) => {
log::trace!("TEXT message from server: {}", message);
@@ -182,7 +182,7 @@ impl BotClient {
};
if let Some(cb) = &mut self.server_msg_callback {
(cb)(&message)
(cb)(&mut message)
}
match message {

View File

@@ -9,7 +9,7 @@ use crate::test::play_utils::check_no_replay_on_hit;
use crate::test::{bot_client, TestPort};
use crate::utils::network_utils::wait_for_port;
fn check_strikes_are_linear(msg: &ServerMessage) {
fn check_strikes_are_linear(msg: &mut ServerMessage) {
if let ServerMessage::RequestFire { status } = msg {
let mut in_fire_location = true;
for y in 0..status.rules.map_height {

View File

@@ -1,13 +1,16 @@
use tokio::task;
use crate::args::Args;
use crate::consts::MIN_STRIKE_TIMEOUT;
use crate::data::{BoatsLayout, GameRules};
use crate::human_player_ws::ServerMessage;
use crate::server::start_server;
use crate::test::bot_client;
use crate::test::bot_client::ClientEndResult;
use crate::test::play_utils::check_no_replay_on_hit;
use crate::test::TestPort;
use crate::utils::network_utils::wait_for_port;
use crate::utils::time_utils::time;
#[tokio::test]
async fn invalid_port() {
@@ -201,3 +204,37 @@ async fn full_game_no_replay_on_hit() {
})
.await;
}
#[tokio::test]
async fn check_fire_time_out() {
let _ = env_logger::builder().is_test(true).try_init();
let local_set = task::LocalSet::new();
local_set
.run_until(async move {
task::spawn_local(start_server(Args::for_test(TestPort::RandomCheckTimeout)));
wait_for_port(TestPort::RandomCheckTimeout.port()).await;
let start = time();
let mut did_skip_one = false;
let res = bot_client::BotClient::new(TestPort::RandomCheckTimeout.as_url())
.with_rules(
GameRules::random_players_rules().with_strike_timeout(MIN_STRIKE_TIMEOUT),
)
.with_server_msg_callback(move |msg| {
if matches!(msg, ServerMessage::RequestFire { .. }) && !did_skip_one {
*msg = ServerMessage::OpponentReplacedByBot;
did_skip_one = true;
}
})
.run_client()
.await
.unwrap();
assert!(matches!(res, ClientEndResult::Finished { .. }));
assert!(time() - start >= MIN_STRIKE_TIMEOUT);
})
.await;
}

View File

@@ -10,6 +10,7 @@ enum TestPort {
RandomBotInvalidBoatsLayoutLenOfABoat,
RandomBotFullGameMultipleRematch,
RandomBotNoReplayOnHit,
RandomCheckTimeout,
LinearBotFullGame,
LinearBotNoReplayOnHit,
IntermediateBotFullGame,

View File

@@ -1,7 +1,7 @@
use crate::human_player_ws::ServerMessage;
/// Make sure player can not replay after successful hit
pub fn check_no_replay_on_hit(msg: &ServerMessage) {
pub fn check_no_replay_on_hit(msg: &mut ServerMessage) {
if let ServerMessage::OpponentMustFire { status } | ServerMessage::RequestFire { status } = msg
{
let diff =

View File

@@ -1,12 +1,4 @@
use std::error::Error;
use std::fmt::Display;
use std::io::ErrorKind;
pub mod network_utils;
pub mod res_utils;
pub mod string_utils;
pub type Res<E = ()> = Result<E, Box<dyn Error>>;
pub fn boxed_error<D: Display>(msg: D) -> Box<dyn Error> {
Box::new(std::io::Error::new(ErrorKind::Other, msg.to_string()))
}
pub mod time_utils;

View File

@@ -0,0 +1,9 @@
use std::error::Error;
use std::fmt::Display;
use std::io::ErrorKind;
pub type Res<E = ()> = Result<E, Box<dyn Error>>;
pub fn boxed_error<D: Display>(msg: D) -> Box<dyn Error> {
Box::new(std::io::Error::new(ErrorKind::Other, msg.to_string()))
}

View File

@@ -0,0 +1,9 @@
use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch
pub fn time() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs()
}

View File

@@ -0,0 +1,34 @@
[package]
name = "sea_battle_cli_player"
version = "0.2.1"
edition = "2021"
license = "GPL-2.0-or-later"
description = "A Sea Battle game shell client"
repository = "https://gitea.communiquons.org/pierre/SeaBattle"
readme = "README.md"
authors = ["Pierre Hubert <pierre.git@communiquons.org>"]
categories = [ "games" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sea_battle_backend = { path = "../sea_battle_backend", version = "0.2.0" }
clap = { version = "4.5.4", features = ["derive"] }
log = "0.4.21"
env_logger = "0.11.3"
tui = "0.19.0"
crossterm = "0.27.0"
lazy_static = "1.4.0"
tokio = "1.37.0"
num = "0.4.2"
num-traits = "0.2.18"
num-derive = "0.4.2"
textwrap = "0.16.1"
tokio-tungstenite = { version = "0.21.0", features = ["__rustls-tls", "rustls-tls-native-roots"] }
serde_urlencoded = "0.7.1"
futures = "0.3.30"
serde_json = "1.0.116"
hostname = "0.4.0"
rustls = "0.22.2"
reqwest = { version = "0.12.4", features = ["json", "rustls-tls"], default-features = false }
rustls-native-certs = {version = "0.7.0"}

View File

@@ -0,0 +1,41 @@
# Sea battle cli player
[![Build Status](https://drone.communiquons.org/api/badges/pierre/SeaBattle/status.svg)](https://drone.communiquons.org/pierre/SeaBattle)
[![Crate](https://img.shields.io/crates/v/sea_battle_cli_player.svg)](https://crates.io/crates/sea_battle_cli_player)
[![Documentation](https://docs.rs/sea_battle_cli_player/badge.svg)](https://docs.rs/sea_battle_cli_player/)
![](img/SeaBattleCli.png)
A sea battle shell client player for the [sea_battle_backend](https://crates.io/crates/sea_battle_backend) crate, based on the [tui](https://crates.io/crates/tui) library.
## Available play modes
* 🤖 Play against bot (this mode does not require any Internet connection, a local server is automatically spawn)
* 🎲 Play against a random player
* Create play invite (online). In this mode, the server returns an invitation code to give to the opponent
* 🎫 Accept play invite (online)
For the 🤖 bot and create invite modes, game rules can be customized before starting the game.
## Installation
You can install the backend using the following command:
```bash
cargo install sea_battle_cli_player
```
## Usage
Simply launch using:
```bash
sea_battle_cli_player
```
## Offline LAN
If you want to run a local server to play offline LAN games, the cli player can also act as the server:
```bash
RUST_LOG=info sea_battle_cli_player -s -l 0.0.0.0:7000
```
Then all the players must specify the address of this server to use it instead of the default official one:
```bash
sea_battle_cli_player -r http://IP_OF_TARGET:7000
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -13,15 +13,14 @@ pub enum TestDevScreen {
#[derive(Parser, Debug)]
pub struct CliArgs {
// TODO: switch default sever uri to real one when we get one
/// Upstream server to use
#[clap(
short,
long,
value_parser,
default_value = "https://fixme.communiquons.org"
default_value = "https://seabattleapi.communiquons.org"
)]
pub server_uri: String,
pub remote_server: String,
/// Local server listen address
#[clap(short, long, default_value = "127.0.0.1:5679")]
@@ -29,6 +28,10 @@ pub struct CliArgs {
#[clap(long, value_enum)]
pub dev_screen: Option<TestDevScreen>,
/// Run as server instead of as client
#[clap(long, short)]
pub serve: bool,
}
impl CliArgs {
@@ -58,3 +61,14 @@ lazy_static::lazy_static! {
pub fn cli_args() -> &'static CliArgs {
&ARGS
}
#[cfg(test)]
mod test {
use crate::cli_args::CliArgs;
#[test]
fn verify_cli() {
use clap::CommandFactory;
CliArgs::command().debug_assert()
}
}

View File

@@ -2,18 +2,27 @@ use crate::cli_args::cli_args;
use crate::server;
use futures::stream::{SplitSink, SplitStream};
use futures::{SinkExt, StreamExt};
use sea_battle_backend::data::GameRules;
use sea_battle_backend::data::*;
use sea_battle_backend::human_player_ws::{ClientMessage, ServerMessage};
use sea_battle_backend::server::BotPlayQuery;
use sea_battle_backend::utils::{boxed_error, Res};
use std::sync::mpsc;
use sea_battle_backend::server::{
AcceptInviteQuery, BotPlayQuery, CreateInviteQuery, PlayRandomQuery,
};
use sea_battle_backend::utils::res_utils::{boxed_error, Res};
use std::error::Error;
use std::fmt::Display;
use std::sync::mpsc::TryRecvError;
use std::sync::{mpsc, Arc};
use tokio::net::TcpStream;
use tokio_tungstenite::tungstenite::Message;
use tokio_tungstenite::{MaybeTlsStream, WebSocketStream};
type WsStream = WebSocketStream<MaybeTlsStream<TcpStream>>;
pub enum GetRemoteVersionError {
ConnectionFailed,
Other(Box<dyn Error>),
}
/// Connection client
///
/// This structure acts as a wrapper around websocket connection that handles automatically parsing
@@ -24,6 +33,24 @@ pub struct Client {
}
impl Client {
/// Get remote server version
pub async fn get_server_version() -> Result<VersionInfo, GetRemoteVersionError> {
let url = format!("{}/version", cli_args().remote_server);
log::debug!("Getting remote information from {} ...", url);
let res = match reqwest::get(url).await {
Ok(r) => r,
Err(e) if e.is_timeout() || e.is_connect() => {
return Err(GetRemoteVersionError::ConnectionFailed)
}
Err(e) => return Err(GetRemoteVersionError::Other(Box::new(e))),
};
res.json()
.await
.map_err(|e| GetRemoteVersionError::Other(Box::new(e)))
}
/// Start to play against a bot
///
/// When playing against a bot, local server is always used
@@ -34,7 +61,7 @@ impl Client {
&cli_args().local_server_address(),
&format!(
"/play/bot?{}",
serde_urlencoded::to_string(&BotPlayQuery {
serde_urlencoded::to_string(BotPlayQuery {
rules: rules.clone(),
player_name: "Human".to_string()
})
@@ -44,14 +71,78 @@ impl Client {
.await
}
/// Start to play against a random player
pub async fn start_random_play<D: Display>(player_name: D) -> Res<Self> {
Self::connect_url(
&cli_args().remote_server,
&format!(
"/play/random?{}",
serde_urlencoded::to_string(PlayRandomQuery {
player_name: player_name.to_string()
})
.unwrap()
),
)
.await
}
/// Start a play by creating an invite
pub async fn start_create_invite<D: Display>(rules: &GameRules, player_name: D) -> Res<Self> {
Self::connect_url(
&cli_args().remote_server,
&format!(
"/play/create_invite?{}",
serde_urlencoded::to_string(CreateInviteQuery {
rules: rules.clone(),
player_name: player_name.to_string()
})
.unwrap()
),
)
.await
}
/// Start a play by accepting an invite
pub async fn start_accept_invite<D: Display>(code: String, player_name: D) -> Res<Self> {
Self::connect_url(
&cli_args().remote_server,
&format!(
"/play/accept_invite?{}",
serde_urlencoded::to_string(AcceptInviteQuery {
code,
player_name: player_name.to_string()
})
.unwrap()
),
)
.await
}
/// Do connect to a server, returning
async fn connect_url(server: &str, uri: &str) -> Res<Self> {
let mut url = server.replace("http", "ws");
url.push_str(uri);
log::debug!("Connecting to {}", url);
let mut ws_url = server.replace("http", "ws");
ws_url.push_str(uri);
log::debug!("Connecting to {}", ws_url);
let (socket, _) = if ws_url.starts_with("wss") {
// Perform a connection over TLS
let mut roots = rustls::RootCertStore::empty();
for cert in rustls_native_certs::load_native_certs()? {
roots.add(cert).unwrap();
}
let config = rustls::ClientConfig::builder()
.with_root_certificates(roots)
.with_no_client_auth();
let connector = tokio_tungstenite::Connector::Rustls(Arc::new(config));
tokio_tungstenite::connect_async_tls_with_config(ws_url, None, false, Some(connector))
.await?
} else {
// Perform an unsecure connection
tokio_tungstenite::connect_async(ws_url).await?
};
// Connect to websocket & split streams
let (socket, _) = tokio_tungstenite::connect_async(url).await?;
let (sink, mut stream) = socket.split();
// Receive server message on a separate task
@@ -61,12 +152,12 @@ impl Client {
match Self::recv_next_msg(&mut stream).await {
Ok(msg) => {
if let Err(e) = sender.send(msg.clone()) {
log::error!("Failed to forward ws message! {} (msg={:?})", e, msg);
log::debug!("Failed to forward ws message! {} (msg={:?})", e, msg);
break;
}
}
Err(e) => {
log::error!("Failed receive next message from websocket! {}", e);
log::debug!("Failed receive next message from websocket! {}", e);
break;
}
}
@@ -133,4 +224,11 @@ impl Client {
pub async fn recv_next_message(&self) -> Res<ServerMessage> {
Ok(self.receiver.recv()?)
}
/// Close connection
pub async fn close_connection(&mut self) {
if let Err(e) = self.sink.send(Message::Close(None)).await {
log::debug!("Failed to close WS connection! {:?}", e);
}
}
}

View File

@@ -2,7 +2,7 @@ extern crate core;
pub mod cli_args;
pub mod client;
pub mod constants;
pub mod consts;
pub mod server;
pub mod ui_screens;
pub mod ui_widgets;

View File

@@ -0,0 +1,231 @@
use std::error::Error;
use std::io;
use std::io::ErrorKind;
use crossterm::event::DisableMouseCapture;
use crossterm::event::EnableMouseCapture;
use crossterm::execute;
use crossterm::terminal::EnterAlternateScreen;
use crossterm::terminal::LeaveAlternateScreen;
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
use env_logger::Env;
use tui::backend::{Backend, CrosstermBackend};
use tui::Terminal;
use sea_battle_backend::consts::{
INVITE_CODE_LENGTH, MAX_PLAYER_NAME_LENGTH, MIN_PLAYER_NAME_LENGTH,
};
use sea_battle_backend::data::GameRules;
use sea_battle_backend::utils::res_utils::Res;
use sea_battle_cli_player::cli_args::{cli_args, TestDevScreen};
use sea_battle_cli_player::client::{Client, GetRemoteVersionError};
use sea_battle_cli_player::server::run_server;
use sea_battle_cli_player::ui_screens::configure_game_rules::GameRulesConfigurationScreen;
use sea_battle_cli_player::ui_screens::game_screen::GameScreen;
use sea_battle_cli_player::ui_screens::input_screen::InputScreen;
use sea_battle_cli_player::ui_screens::popup_screen::PopupScreen;
use sea_battle_cli_player::ui_screens::select_play_mode_screen::{
SelectPlayModeResult, SelectPlayModeScreen,
};
use sea_battle_cli_player::ui_screens::*;
/// Test code screens
async fn run_dev<B: Backend>(
terminal: &mut Terminal<B>,
d: TestDevScreen,
) -> Result<(), Box<dyn Error>> {
let res = match d {
TestDevScreen::Popup => PopupScreen::new("Welcome there!!")
.show(terminal)?
.as_string(),
TestDevScreen::Input => InputScreen::new("What it your name ?")
.set_title("A custom title")
.show(terminal)?
.as_string(),
TestDevScreen::Confirm => {
confirm_dialog_screen::ConfirmDialogScreen::new("Do you really want to quit game?")
.show(terminal)?
.as_string()
}
TestDevScreen::SelectBotType => select_bot_type_screen::SelectBotTypeScreen::default()
.show(terminal)?
.as_string(),
TestDevScreen::SelectPlayMode => {
SelectPlayModeScreen::default().show(terminal)?.as_string()
}
TestDevScreen::SetBoatsLayout => {
let rules = GameRules {
boats_can_touch: true,
..Default::default()
};
set_boats_layout_screen::SetBoatsLayoutScreen::new(&rules)
.show(terminal)?
.as_string()
}
TestDevScreen::ConfigureGameRules => {
GameRulesConfigurationScreen::new(GameRules::default())
.show(terminal)?
.as_string()
}
};
Err(io::Error::new(
ErrorKind::Other,
format!("DEV result: {:?}", res),
))?
}
/// Ask the user to specify the name he should be identified with
fn query_player_name<B: Backend>(terminal: &mut Terminal<B>) -> Res<String> {
let mut hostname = hostname::get()?.to_string_lossy().to_string();
if hostname.len() > MAX_PLAYER_NAME_LENGTH {
hostname = hostname[0..MAX_PLAYER_NAME_LENGTH].to_string();
}
let res =
InputScreen::new("Please specify the name to which other players should identify you:")
.set_title("Player name")
.set_value(&hostname)
.set_min_length(MIN_PLAYER_NAME_LENGTH)
.set_max_length(MAX_PLAYER_NAME_LENGTH)
.show(terminal)?;
Ok(res.value().unwrap_or(hostname))
}
async fn run_app<B: Backend>(terminal: &mut Terminal<B>) -> Res {
if let Some(d) = cli_args().dev_screen {
return run_dev(terminal, d).await;
}
let mut checked_online_compatibility = false;
let mut rules = GameRules::default();
let mut username = "".to_string();
loop {
terminal.clear()?;
let choice = SelectPlayModeScreen::default().show(terminal)?;
if let ScreenResult::Ok(c) = choice {
// Check compatibility
if c.is_online_play_mode() && !checked_online_compatibility {
PopupScreen::new("🖥 Checking remote server version...").show_once(terminal)?;
let valid_version = match Client::get_server_version().await {
Ok(v) => v.is_compatible_with_static_version().unwrap_or(false),
Err(GetRemoteVersionError::ConnectionFailed) => {
PopupScreen::new("❌ Could not connect to remote server!")
.show(terminal)?;
continue;
}
Err(GetRemoteVersionError::Other(e)) => {
log::error!("Could not load remote server information! {:?}", e);
false
}
};
if !valid_version {
PopupScreen::new("❌ Unfortunately, it seems that your version of Sea Battle Cli player is too old to be used online...\n\nPlease update it before trying to play online...").show(terminal)?;
continue;
}
checked_online_compatibility = true;
}
if c.need_player_name() && username.is_empty() {
username = query_player_name(terminal)?;
}
if c.need_custom_rules() {
rules = match GameRulesConfigurationScreen::new(rules.clone()).show(terminal)? {
ScreenResult::Ok(r) => r,
ScreenResult::Canceled => continue,
}
}
}
PopupScreen::new("🔌 Connecting...").show_once(terminal)?;
let client = match choice {
ScreenResult::Ok(SelectPlayModeResult::PlayRandom) => {
Client::start_random_play(&username).await
}
// Play against bot
ScreenResult::Ok(SelectPlayModeResult::PlayAgainstBot) => {
Client::start_bot_play(&rules).await
}
// Create invite
ScreenResult::Ok(SelectPlayModeResult::CreateInvite) => {
Client::start_create_invite(&rules, &username).await
}
// Join invite
ScreenResult::Ok(SelectPlayModeResult::AcceptInvite) => {
let code = match InputScreen::new("Invite code")
.set_min_length(INVITE_CODE_LENGTH)
.set_max_length(INVITE_CODE_LENGTH)
.show(terminal)?
.value()
{
None => continue,
Some(v) => v,
};
PopupScreen::new("🔌 Connecting...").show_once(terminal)?;
Client::start_accept_invite(code, &username).await
}
ScreenResult::Canceled | ScreenResult::Ok(SelectPlayModeResult::Exit) => return Ok(()),
};
match client {
Ok(client) => {
// Display game screen
GameScreen::new(client).show(terminal).await?;
}
Err(e) => {
log::error!("Failed to connect to server: {}", e);
PopupScreen::new("❌ Failed to connect to server!").show(terminal)?;
}
};
}
}
#[tokio::main]
pub async fn main() -> Result<(), Box<dyn Error>> {
env_logger::Builder::from_env(Env::default()).init();
if cli_args().serve {
run_server().await;
return Ok(());
}
// setup terminal
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
// create app and run it
let res = run_app(&mut terminal).await;
// restore terminal
disable_raw_mode()?;
execute!(
terminal.backend_mut(),
LeaveAlternateScreen,
DisableMouseCapture
)?;
terminal.show_cursor()?;
if let Err(err) = res {
println!("{:?}", err)
}
Ok(())
}

View File

@@ -6,6 +6,21 @@ use sea_battle_backend::utils::network_utils;
use crate::cli_args::cli_args;
pub async fn run_server() {
let local_set = task::LocalSet::new();
local_set
.run_until(async move {
sea_battle_backend::server::start_server(Args {
listen_address: cli_args().listen_address.clone(),
cors: None,
})
.await
.expect("Failed to run local server!")
})
.await;
}
pub async fn start_server_if_missing() {
if !network_utils::is_port_open(cli_args().listen_port()).await {
log::info!(
@@ -15,16 +30,9 @@ pub async fn start_server_if_missing() {
std::thread::spawn(move || {
let rt = Builder::new_current_thread().enable_all().build().unwrap();
let local_set = task::LocalSet::new();
rt.block_on(local_set.run_until(async move {
sea_battle_backend::server::start_server(Args {
listen_address: cli_args().listen_address.clone(),
cors: None,
})
.await
.expect("Failed to run local server!")
}));
rt.block_on(run_server());
});
network_utils::wait_for_port(cli_args().listen_port()).await;
}
}

View File

@@ -5,6 +5,9 @@ use std::time::{Duration, Instant};
use crossterm::event;
use crossterm::event::{Event, KeyCode};
use sea_battle_backend::consts::{
MAX_BOATS_NUMBER, MAX_MAP_HEIGHT, MAX_MAP_WIDTH, MAX_STRIKE_TIMEOUT,
};
use tui::backend::Backend;
use tui::layout::{Constraint, Direction, Layout, Margin};
use tui::style::{Color, Style};
@@ -13,7 +16,8 @@ use tui::{Frame, Terminal};
use sea_battle_backend::data::GameRules;
use crate::constants::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::consts::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::ui_screens::popup_screen::show_screen_too_small_popup;
use crate::ui_screens::select_bot_type_screen::SelectBotTypeScreen;
use crate::ui_screens::utils::centered_rect_size;
use crate::ui_screens::ScreenResult;
@@ -21,11 +25,12 @@ use crate::ui_widgets::button_widget::ButtonWidget;
use crate::ui_widgets::checkbox_widget::CheckboxWidget;
use crate::ui_widgets::text_editor_widget::TextEditorWidget;
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Eq, PartialEq)]
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Eq, PartialEq, Copy, Clone)]
enum EditingField {
MapWidth = 0,
MapHeight,
BoatsList,
StrikeTimeout,
BoatsCanTouch,
PlayerContinueOnHit,
BotType,
@@ -58,13 +63,13 @@ impl GameRulesConfigurationScreen {
.checked_sub(last_tick.elapsed())
.unwrap_or_else(|| Duration::from_secs(0));
if crossterm::event::poll(timeout)? {
if event::poll(timeout)? {
let mut cursor_pos = self.curr_field as i32;
if let Event::Key(key) = event::read()? {
match key.code {
// Quit app
KeyCode::Char('q') => return Ok(ScreenResult::Canceled),
KeyCode::Char('q') | KeyCode::Esc => return Ok(ScreenResult::Canceled),
// Navigate between fields
KeyCode::Up | KeyCode::Left => cursor_pos -= 1,
@@ -114,24 +119,46 @@ impl GameRulesConfigurationScreen {
{
self.rules.remove_last_boat();
}
if self.curr_field == EditingField::StrikeTimeout {
match self.rules.strike_timeout.unwrap_or(0) / 10 {
0 => self.rules.strike_timeout = None,
v => self.rules.strike_timeout = Some(v),
}
}
}
KeyCode::Char(c) if ('0'..='9').contains(&c) => {
KeyCode::Char(c) if c.is_ascii_digit() => {
let val = c.to_string().parse::<usize>().unwrap_or_default();
if self.curr_field == EditingField::MapWidth {
if self.curr_field == EditingField::MapWidth
&& self.rules.map_width <= MAX_MAP_WIDTH
{
self.rules.map_width *= 10;
self.rules.map_width += val;
}
if self.curr_field == EditingField::MapHeight {
if self.curr_field == EditingField::MapHeight
&& self.rules.map_height <= MAX_MAP_HEIGHT
{
self.rules.map_height *= 10;
self.rules.map_height += val;
}
if self.curr_field == EditingField::BoatsList {
if self.curr_field == EditingField::BoatsList
&& self.rules.boats_list().len() < MAX_BOATS_NUMBER
{
self.rules.add_boat(val);
}
if self.curr_field == EditingField::StrikeTimeout {
let mut timeout = self.rules.strike_timeout.unwrap_or(0);
if timeout <= MAX_STRIKE_TIMEOUT {
timeout *= 10;
timeout += val as u64;
self.rules.strike_timeout = Some(timeout);
}
}
}
_ => {}
@@ -153,19 +180,29 @@ impl GameRulesConfigurationScreen {
}
fn ui<B: Backend>(&mut self, f: &mut Frame<B>) {
let area = centered_rect_size(50, 20, &f.size());
let (w, h) = (50, 23);
let block = Block::default().title("Game rules").borders(Borders::ALL);
if f.size().width < w || f.size().height < h {
show_screen_too_small_popup(f);
return;
}
let area = centered_rect_size(w, h, &f.size());
let block = Block::default()
.title("📓 Game rules")
.borders(Borders::ALL);
f.render_widget(block, area);
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(3),
Constraint::Length(3),
Constraint::Length(3),
Constraint::Length(1),
Constraint::Length(1),
Constraint::Length(3), // Map width
Constraint::Length(3), // Map height
Constraint::Length(3), // Boats list
Constraint::Length(3), // Strike timeout
Constraint::Length(1), // Boats can touch
Constraint::Length(1), // Player continue on hit
Constraint::Length(3), // Bot type
Constraint::Length(1), // Margin
Constraint::Length(1), // Buttons
@@ -203,6 +240,13 @@ impl GameRulesConfigurationScreen {
);
f.render_widget(editor, chunks[EditingField::BoatsList as usize]);
let editor = TextEditorWidget::new(
"Strike timeout (0 to disable)",
&self.rules.strike_timeout.unwrap_or(0).to_string(),
self.curr_field == EditingField::StrikeTimeout,
);
f.render_widget(editor, chunks[EditingField::StrikeTimeout as usize]);
let editor = CheckboxWidget::new(
"Boats can touch",
self.rules.boats_can_touch,
@@ -239,10 +283,10 @@ impl GameRulesConfigurationScreen {
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)])
.split(chunks[EditingField::OK as usize]);
let button = ButtonWidget::new("Cancel", self.curr_field == EditingField::Cancel);
let button = ButtonWidget::cancel(self.curr_field == EditingField::Cancel);
f.render_widget(button, buttons_chunk[0]);
let button = ButtonWidget::new("OK", self.curr_field == EditingField::OK)
let button = ButtonWidget::ok(self.curr_field == EditingField::OK)
.set_disabled(!self.rules.is_valid());
f.render_widget(button, buttons_chunk[1]);

View File

@@ -9,7 +9,7 @@ use tui::text::*;
use tui::widgets::*;
use tui::{Frame, Terminal};
use crate::constants::*;
use crate::consts::*;
use crate::ui_screens::utils::centered_rect_size;
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::button_widget::ButtonWidget;
@@ -18,6 +18,7 @@ use crate::ui_widgets::button_widget::ButtonWidget;
pub fn confirm<B: Backend>(terminal: &mut Terminal<B>, msg: &str) -> bool {
matches!(
ConfirmDialogScreen::new(msg)
.set_can_escape(true)
.show(terminal)
.unwrap_or(ScreenResult::Canceled),
ScreenResult::Ok(true)
@@ -28,19 +29,24 @@ pub struct ConfirmDialogScreen<'a> {
title: &'a str,
msg: &'a str,
is_confirm: bool,
can_cancel: bool,
can_escape: bool,
}
impl<'a> ConfirmDialogScreen<'a> {
pub fn new(msg: &'a str) -> Self {
Self {
title: "Confirmation Request",
title: "Confirmation Request",
msg,
is_confirm: true,
can_cancel: false,
can_escape: false,
}
}
pub fn set_can_escape(mut self, v: bool) -> Self {
self.can_escape = v;
self
}
pub fn show<B: Backend>(
mut self,
terminal: &mut Terminal<B>,
@@ -56,7 +62,7 @@ impl<'a> ConfirmDialogScreen<'a> {
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Esc | KeyCode::Char('q') if self.can_cancel => {
KeyCode::Esc | KeyCode::Char('q') if self.can_escape => {
return Ok(ScreenResult::Canceled)
}
@@ -117,10 +123,10 @@ impl<'a> ConfirmDialogScreen<'a> {
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
.split(chunks[1]);
let cancel_button = ButtonWidget::new("Cancel", true).set_disabled(self.is_confirm);
let cancel_button = ButtonWidget::cancel(true).set_disabled(self.is_confirm);
f.render_widget(cancel_button, buttons_area[0]);
let ok_button = ButtonWidget::new("Confirm", true).set_disabled(!self.is_confirm);
let ok_button = ButtonWidget::new("Confirm", true).set_disabled(!self.is_confirm);
f.render_widget(ok_button, buttons_area[1]);
}
}

View File

@@ -0,0 +1,620 @@
use std::cmp::max;
use std::collections::HashMap;
use std::time::{Duration, Instant};
use crossterm::event;
use crossterm::event::{Event, KeyCode, MouseButton, MouseEventKind};
use tui::backend::Backend;
use tui::layout::{Constraint, Direction, Layout};
use tui::style::Color;
use tui::widgets::Paragraph;
use tui::{Frame, Terminal};
use sea_battle_backend::data::{Coordinates, CurrentGameMapStatus, CurrentGameStatus};
use sea_battle_backend::human_player_ws::{ClientMessage, ServerMessage};
use sea_battle_backend::utils::res_utils::Res;
use sea_battle_backend::utils::time_utils::time;
use crate::client::Client;
use crate::consts::*;
use crate::ui_screens::confirm_dialog_screen::confirm;
use crate::ui_screens::popup_screen::{show_screen_too_small_popup, PopupScreen};
use crate::ui_screens::set_boats_layout_screen::SetBoatsLayoutScreen;
use crate::ui_screens::utils::{
centered_rect_size, centered_rect_size_horizontally, centered_text,
};
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::button_widget::ButtonWidget;
use crate::ui_widgets::game_map_widget::{ColoredCells, GameMapWidget};
type CoordinatesMapper = HashMap<Coordinates, Coordinates>;
#[derive(Eq, PartialEq, Ord, PartialOrd)]
enum GameStatus {
Connecting,
WaitingForAnotherPlayer,
OpponentConnected,
WaitingForOpponentBoatsConfig,
OpponentReady,
Starting,
MustFire,
OpponentMustFire,
WonGame,
LostGame,
RematchRequestedByOpponent,
RematchRequestedByPlayer,
RematchAccepted,
RematchRejected,
OpponentLeftGame,
}
impl GameStatus {
pub fn can_show_game_maps(&self) -> bool {
self > &GameStatus::Starting
}
pub fn status_text(&self) -> &str {
match self {
GameStatus::Connecting => "🔌 Connecting...",
GameStatus::WaitingForAnotherPlayer => "🕑 Waiting for another player...",
GameStatus::OpponentConnected => "✅ Opponent connected!",
GameStatus::WaitingForOpponentBoatsConfig => "🕑 Waiting for ### boats configuration",
GameStatus::OpponentReady => "✅ ### is ready!",
GameStatus::Starting => "🕑 Game is starting...",
GameStatus::MustFire => "🚨 You must fire!",
GameStatus::OpponentMustFire => "💣 ### must fire!",
GameStatus::WonGame => "🎉 You win the game!",
GameStatus::LostGame => "😿 ### wins the game. You loose.",
GameStatus::RematchRequestedByOpponent => "❓ Rematch requested by ###",
GameStatus::RematchRequestedByPlayer => "❓ Rematch requested by you",
GameStatus::RematchAccepted => "✅ Rematch accepted!",
GameStatus::RematchRejected => "❌ Rematch rejected!",
GameStatus::OpponentLeftGame => "⛔ Opponent left game!",
}
}
}
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
enum Buttons {
RequestRematch,
AcceptRematch,
RejectRematch,
QuitGame,
}
impl Buttons {
pub fn text(&self) -> &str {
match self {
Buttons::RequestRematch => "❓ Request rematch",
Buttons::AcceptRematch => "✅ Accept rematch",
Buttons::RejectRematch => "❌ Reject rematch",
Buttons::QuitGame => "❌ Quit game",
}
}
}
pub struct GameScreen {
client: Client,
invite_code: Option<String>,
status: GameStatus,
opponent_name: Option<String>,
game_last_update: u64,
game: CurrentGameStatus,
curr_shoot_position: Coordinates,
last_opponent_fire_position: Coordinates,
curr_button: usize,
}
impl GameScreen {
pub fn new(client: Client) -> Self {
Self {
client,
invite_code: None,
status: GameStatus::Connecting,
opponent_name: None,
game_last_update: 0,
game: Default::default(),
curr_shoot_position: Coordinates::new(0, 0),
last_opponent_fire_position: Coordinates::invalid(),
curr_button: 0,
}
}
pub async fn show<B: Backend>(mut self, terminal: &mut Terminal<B>) -> Res<ScreenResult> {
let mut last_tick = Instant::now();
let mut coordinates_mapper = CoordinatesMapper::new();
loop {
if !self.visible_buttons().is_empty() {
self.curr_button %= self.visible_buttons().len();
}
// Update UI
terminal.draw(|f| coordinates_mapper = self.ui(f))?;
let timeout = TICK_RATE
.checked_sub(last_tick.elapsed())
.unwrap_or_else(|| Duration::from_secs(0));
// Handle terminal events
if event::poll(timeout)? {
let event = event::read()?;
// Keyboard event
if let Event::Key(key) = &event {
let mut new_shoot_pos = self.curr_shoot_position;
match key.code {
// Leave game
KeyCode::Char('q') | KeyCode::Esc
if confirm(terminal, "Do you really want to leave game?") =>
{
self.client.close_connection().await;
return Ok(ScreenResult::Canceled);
}
// Move shoot cursor
KeyCode::Left if self.can_fire() => new_shoot_pos = new_shoot_pos.add_x(-1),
KeyCode::Right if self.can_fire() => new_shoot_pos = new_shoot_pos.add_x(1),
KeyCode::Up if self.can_fire() => new_shoot_pos = new_shoot_pos.add_y(-1),
KeyCode::Down if self.can_fire() => new_shoot_pos = new_shoot_pos.add_y(1),
// Shoot
KeyCode::Enter if self.can_fire() => {
if self.game.can_fire_at_location(self.curr_shoot_position) {
self.client
.send_message(&ClientMessage::Fire {
location: self.curr_shoot_position,
})
.await?;
}
}
// Change buttons
KeyCode::Left if self.game_over() => {
self.curr_button += self.visible_buttons().len() - 1
}
KeyCode::Right if self.game_over() => self.curr_button += 1,
KeyCode::Tab if self.game_over() => self.curr_button += 1,
// Submit button
KeyCode::Enter if self.game_over() => match self.curr_button() {
Buttons::RequestRematch => {
self.client
.send_message(&ClientMessage::RequestRematch)
.await?;
self.status = GameStatus::RematchRequestedByPlayer;
}
Buttons::AcceptRematch => {
self.client
.send_message(&ClientMessage::AcceptRematch)
.await?;
self.status = GameStatus::RematchAccepted;
}
Buttons::RejectRematch => {
self.client
.send_message(&ClientMessage::RejectRematch)
.await?;
self.status = GameStatus::RematchRejected;
}
Buttons::QuitGame => {
self.client.close_connection().await;
return Ok(ScreenResult::Ok(()));
}
},
_ => {}
}
if new_shoot_pos.is_valid(&self.game.rules) {
self.curr_shoot_position = new_shoot_pos;
}
}
// Mouse event
if let Event::Mouse(mouse) = event {
if mouse.kind == MouseEventKind::Up(MouseButton::Left) {
if let Some(c) =
coordinates_mapper.get(&Coordinates::new(mouse.column, mouse.row))
{
self.curr_shoot_position = *c;
if self.can_fire()
&& self.game.can_fire_at_location(self.curr_shoot_position)
{
self.client
.send_message(&ClientMessage::Fire {
location: self.curr_shoot_position,
})
.await?;
}
}
}
}
}
// Handle incoming messages
while let Some(msg) = self.client.try_recv_next_message().await? {
match msg {
ServerMessage::SetInviteCode { code } => {
self.status = GameStatus::WaitingForAnotherPlayer;
self.invite_code = Some(code);
}
ServerMessage::InvalidInviteCode => {
PopupScreen::new("❌ Invalid invite code!").show(terminal)?;
return Ok(ScreenResult::Ok(()));
}
ServerMessage::WaitingForAnotherPlayer => {
self.status = GameStatus::WaitingForAnotherPlayer;
}
ServerMessage::OpponentConnected => {
self.status = GameStatus::OpponentConnected;
}
ServerMessage::SetOpponentName { name } => self.opponent_name = Some(name),
ServerMessage::QueryBoatsLayout { rules } => {
match SetBoatsLayoutScreen::new(&rules)
.set_confirm_on_cancel(true)
.show(terminal)?
{
ScreenResult::Ok(layout) => {
self.client
.send_message(&ClientMessage::BoatsLayout { layout })
.await?
}
ScreenResult::Canceled => {
self.client.close_connection().await;
return Ok(ScreenResult::Canceled);
}
};
}
ServerMessage::RejectedBoatsLayout { .. } => {
PopupScreen::new("Server rejected boats layout!! (is your version of SeaBattle up to date?)")
.show(terminal)?;
}
ServerMessage::WaitingForOtherPlayerConfiguration => {
self.status = GameStatus::WaitingForOpponentBoatsConfig;
}
ServerMessage::OpponentReady => {
self.status = GameStatus::OpponentReady;
}
ServerMessage::GameStarting => {
self.status = GameStatus::Starting;
}
ServerMessage::OpponentMustFire { status } => {
self.status = GameStatus::OpponentMustFire;
self.game_last_update = time();
self.game = status;
}
ServerMessage::RequestFire { status } => {
self.status = GameStatus::MustFire;
self.game_last_update = time();
self.game = status;
}
ServerMessage::FireResult { .. } => { /* not used */ }
ServerMessage::OpponentFireResult { pos, .. } => {
self.last_opponent_fire_position = pos;
}
ServerMessage::LostGame { status } => {
self.game_last_update = time();
self.game = status;
self.status = GameStatus::LostGame;
}
ServerMessage::WonGame { status } => {
self.game_last_update = time();
self.game = status;
self.status = GameStatus::WonGame;
}
ServerMessage::OpponentRequestedRematch => {
self.status = GameStatus::RematchRequestedByOpponent;
}
ServerMessage::OpponentAcceptedRematch => {
self.status = GameStatus::RematchAccepted;
}
ServerMessage::OpponentRejectedRematch => {
self.status = GameStatus::RematchRejected;
}
ServerMessage::OpponentLeftGame => {
self.status = GameStatus::OpponentLeftGame;
}
ServerMessage::OpponentReplacedByBot => {
PopupScreen::new("Opponent was replaced by a bot.").show(terminal)?;
}
}
}
if last_tick.elapsed() >= TICK_RATE {
last_tick = Instant::now();
}
}
}
fn can_fire(&self) -> bool {
matches!(self.status, GameStatus::MustFire)
}
fn game_over(&self) -> bool {
self.game.is_game_over()
}
fn visible_buttons(&self) -> Vec<Buttons> {
let mut buttons = vec![];
if self.game_over() && self.status != GameStatus::RematchAccepted {
// Respond to rematch request / quit
if self.status == GameStatus::RematchRequestedByOpponent {
buttons.push(Buttons::AcceptRematch);
buttons.push(Buttons::RejectRematch);
} else if self.status != GameStatus::OpponentLeftGame
&& self.status != GameStatus::RematchRejected
&& self.status != GameStatus::RematchRequestedByPlayer
{
buttons.push(Buttons::RequestRematch);
}
buttons.push(Buttons::QuitGame);
}
buttons
}
fn opponent_name(&self) -> &str {
self.opponent_name.as_deref().unwrap_or("opponent")
}
fn curr_button(&self) -> Buttons {
self.visible_buttons()[self.curr_button]
}
fn player_map(&self, map: &CurrentGameMapStatus, opponent_map: bool) -> GameMapWidget {
let mut map_widget = GameMapWidget::new(&self.game.rules).set_default_empty_char(' ');
// Current shoot position
if opponent_map {
map_widget = map_widget.add_colored_cells(ColoredCells {
color: match (
self.game.can_fire_at_location(self.curr_shoot_position),
self.game
.opponent_map
.successful_strikes
.contains(&self.curr_shoot_position),
) {
(true, _) => Color::Green,
(false, false) => Color::LightYellow,
(false, true) => Color::LightRed,
},
cells: vec![self.curr_shoot_position],
});
} else {
map_widget = map_widget.add_colored_cells(ColoredCells {
color: Color::Green,
cells: vec![self.last_opponent_fire_position],
});
}
// Sunk boats
for b in &map.sunk_boats {
for c in b.all_coordinates() {
map_widget =
map_widget.set_char(c, b.len.to_string().chars().next().unwrap_or('9'));
}
}
let sunk_boats = ColoredCells {
color: Color::LightRed,
cells: map
.sunk_boats
.iter()
.flat_map(|b| b.all_coordinates())
.collect::<Vec<_>>(),
};
// Touched boats
for b in &map.successful_strikes {
map_widget = map_widget.set_char_no_overwrite(*b, 'T');
}
let touched_areas = ColoredCells {
color: Color::Red,
cells: map.successful_strikes.clone(),
};
// Failed strikes
for b in &map.failed_strikes {
map_widget = map_widget.set_char_no_overwrite(*b, '.');
}
let failed_strikes = ColoredCells {
color: Color::Black,
cells: map.failed_strikes.clone(),
};
// Boats
for b in &map.boats.0 {
for c in b.all_coordinates() {
map_widget = map_widget.set_char_no_overwrite(c, 'B');
}
}
let boats = ColoredCells {
color: Color::Blue,
cells: map
.boats
.0
.iter()
.flat_map(|b| b.all_coordinates())
.collect::<Vec<_>>(),
};
map_widget
.add_colored_cells(sunk_boats)
.add_colored_cells(touched_areas)
.add_colored_cells(failed_strikes)
.add_colored_cells(boats)
}
fn ui<B: Backend>(&mut self, f: &mut Frame<B>) -> CoordinatesMapper {
let mut status_text = self
.status
.status_text()
.replace("###", self.opponent_name());
// If the game is in a state where game maps can not be shown
if !self.status.can_show_game_maps() {
if self.status == GameStatus::WaitingForAnotherPlayer {
if let Some(code) = &self.invite_code {
status_text.push_str(&format!("\n\n🎫 Invite code: {}", code));
}
}
PopupScreen::new(&status_text).show_in_frame(f);
return HashMap::default();
}
// Add timeout (if required)
let mut timeout_str = String::new();
if self.status == GameStatus::MustFire || self.status == GameStatus::OpponentMustFire {
if let Some(remaining) = self.game.remaining_time_for_strike {
let timeout = self.game_last_update + remaining;
if time() < timeout {
timeout_str = format!(" {} seconds left", timeout - time());
}
}
}
// Draw main ui (default play UI)
let player_map = self
.player_map(&self.game.your_map, false)
.set_title("YOUR map");
let mut coordinates_mapper = HashMap::new();
let mut opponent_map = self
.player_map(&self.game.opponent_map, true)
.set_title(self.opponent_name())
.set_yield_func(|c, r| {
for i in 0..r.width {
for j in 0..r.height {
coordinates_mapper.insert(Coordinates::new(r.x + i, r.y + j), c);
}
}
});
if self.can_fire() {
opponent_map = opponent_map
.set_legend("Use arrows + Enter\nor click on the place\nwhere you want\nto shoot");
}
// Prepare buttons
let buttons = self
.visible_buttons()
.iter()
.map(|b| ButtonWidget::new(b.text(), self.curr_button() == *b))
.collect::<Vec<_>>();
// Show both maps if there is enough room on the screen
let player_map_size = player_map.estimated_size();
let opponent_map_size = opponent_map.estimated_size();
let both_maps_width = player_map_size.0 + opponent_map_size.0 + 3;
let show_both_maps = both_maps_width <= f.size().width;
let maps_height = max(player_map_size.1, opponent_map_size.1);
let maps_width = match show_both_maps {
true => both_maps_width,
false => max(player_map_size.0, opponent_map_size.0),
};
let buttons_width = buttons.iter().fold(0, |a, b| a + b.estimated_size().0 + 4);
let max_width = max(maps_width, status_text.len() as u16)
.max(buttons_width)
.max(timeout_str.len() as u16);
let total_height = 3 + 1 + maps_height + 3;
// Check if frame is too small
if max_width > f.size().width || total_height > f.size().height {
show_screen_too_small_popup(f);
return HashMap::default();
}
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(2),
Constraint::Length(2),
Constraint::Length(maps_height),
Constraint::Length(3),
])
.split(centered_rect_size(max_width, total_height, &f.size()));
// Render status
let paragraph = Paragraph::new(status_text.as_str());
f.render_widget(paragraph, centered_text(&status_text, &chunks[0]));
// Render timeout
let paragraph = Paragraph::new(timeout_str.as_str());
f.render_widget(paragraph, centered_text(&timeout_str, &chunks[1]));
// Render maps
if show_both_maps {
let maps_chunks = Layout::default()
.direction(Direction::Horizontal)
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)])
.split(chunks[2]);
f.render_widget(
player_map,
centered_rect_size_horizontally(player_map_size.0, &maps_chunks[0]),
);
f.render_widget(
opponent_map,
centered_rect_size_horizontally(opponent_map_size.0, &maps_chunks[1]),
);
} else {
// Render a single map
if self.can_fire() {
f.render_widget(opponent_map, chunks[2]);
} else {
f.render_widget(player_map, chunks[2]);
drop(opponent_map);
}
}
// Render buttons
if !buttons.is_empty() {
let buttons_area = Layout::default()
.direction(Direction::Horizontal)
.constraints(
(0..buttons.len())
.map(|_| Constraint::Percentage(100 / buttons.len() as u16))
.collect::<Vec<_>>(),
)
.split(chunks[3]);
for (idx, b) in buttons.into_iter().enumerate() {
let target = centered_rect_size(
b.estimated_size().0,
b.estimated_size().1,
&buttons_area[idx],
);
f.render_widget(b, target);
}
}
coordinates_mapper
}
}

View File

@@ -1,3 +1,4 @@
use std::fmt::Display;
use std::io;
use std::time::{Duration, Instant};
use tui::style::*;
@@ -9,7 +10,7 @@ use tui::layout::*;
use tui::widgets::*;
use tui::{Frame, Terminal};
use crate::constants::*;
use crate::consts::*;
use crate::ui_screens::utils::*;
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::button_widget::ButtonWidget;
@@ -49,6 +50,21 @@ impl<'a> InputScreen<'a> {
self
}
pub fn set_value<D: Display>(mut self, value: D) -> Self {
self.value = value.to_string();
self
}
pub fn set_min_length(mut self, v: usize) -> Self {
self.min_len = v;
self
}
pub fn set_max_length(mut self, v: usize) -> Self {
self.max_len = v;
self
}
/// Get error contained in input
fn error(&self) -> Option<&'static str> {
if self.value.len() > self.max_len {
@@ -109,7 +125,7 @@ impl<'a> InputScreen<'a> {
fn ui<B: Backend>(&mut self, f: &mut Frame<B>) {
let area = centered_rect_size(
(self.msg.len() + 4).max(self.max_len + 4) as u16,
(self.msg.len() + 4).max(self.max_len + 4).max(25) as u16,
7,
&f.size(),
);
@@ -147,12 +163,12 @@ impl<'a> InputScreen<'a> {
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
.split(*chunks.last().unwrap());
let cancel_button = ButtonWidget::new("Cancel", self.is_cancel_hovered)
let cancel_button = ButtonWidget::cancel(self.is_cancel_hovered)
.set_disabled(!self.can_cancel)
.set_min_width(8);
f.render_widget(cancel_button, buttons_area[0]);
let ok_button = ButtonWidget::new("OK", !self.is_cancel_hovered)
let ok_button = ButtonWidget::ok(!self.is_cancel_hovered)
.set_min_width(8)
.set_disabled(error.is_some());
f.render_widget(ok_button, buttons_area[1]);

View File

@@ -17,6 +17,13 @@ pub enum ScreenResult<E = ()> {
}
impl<E: Debug> ScreenResult<E> {
pub fn value(self) -> Option<E> {
match self {
ScreenResult::Ok(v) => Some(v),
ScreenResult::Canceled => None,
}
}
pub fn as_string(&self) -> String {
format!("{:#?}", self)
}

View File

@@ -9,11 +9,17 @@ use tui::text::*;
use tui::widgets::*;
use tui::{Frame, Terminal};
use crate::constants::*;
use crate::consts::*;
use crate::ui_screens::utils::centered_rect_size;
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::button_widget::ButtonWidget;
/// Convenience function to inform user that his terminal window is too small to display the current
/// screen
pub fn show_screen_too_small_popup<B: Backend>(f: &mut Frame<B>) {
PopupScreen::new("🖵 Screen too small!").show_in_frame(f)
}
pub struct PopupScreen<'a> {
title: &'a str,
msg: &'a str,
@@ -46,7 +52,7 @@ impl<'a> PopupScreen<'a> {
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Char('q') => return Ok(ScreenResult::Canceled),
KeyCode::Char('q') | KeyCode::Esc => return Ok(ScreenResult::Canceled),
KeyCode::Enter => {
return Ok(ScreenResult::Ok(()));
}

View File

@@ -11,7 +11,7 @@ use tui::{Frame, Terminal};
use sea_battle_backend::data::{BotDescription, BotType, PlayConfiguration};
use crate::constants::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::consts::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::ui_screens::utils::centered_rect_size;
use crate::ui_screens::ScreenResult;
@@ -49,7 +49,7 @@ impl SelectBotTypeScreen {
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Char('q') => return Ok(ScreenResult::Canceled),
KeyCode::Char('q') | KeyCode::Esc => return Ok(ScreenResult::Canceled),
KeyCode::Enter => {
return Ok(ScreenResult::Ok(self.types[self.curr_selection].r#type));
}

View File

@@ -1,7 +1,7 @@
use std::io;
use std::time::{Duration, Instant};
use crate::constants::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::consts::{HIGHLIGHT_COLOR, TICK_RATE};
use crate::ui_screens::utils::centered_rect_size;
use crate::ui_screens::ScreenResult;
use crossterm::event;
@@ -17,26 +17,54 @@ pub enum SelectPlayModeResult {
#[default]
PlayAgainstBot,
PlayRandom,
CreateInvite,
AcceptInvite,
Exit,
}
impl SelectPlayModeResult {
/// Specify whether a selected play mode requires a user name or not
pub fn need_player_name(&self) -> bool {
self != &SelectPlayModeResult::PlayAgainstBot && self != &SelectPlayModeResult::Exit
}
/// Specify whether a selected play mode requires a the user to specify its own game rules or
/// not
pub fn need_custom_rules(&self) -> bool {
self == &SelectPlayModeResult::PlayAgainstBot || self == &SelectPlayModeResult::CreateInvite
}
/// Specify whether a play mode is to be played online or not
pub fn is_online_play_mode(&self) -> bool {
self != &SelectPlayModeResult::PlayAgainstBot && self != &SelectPlayModeResult::Exit
}
}
#[derive(Debug, Clone)]
struct PlayModeDescription {
name: &'static str,
value: SelectPlayModeResult,
}
const AVAILABLE_PLAY_MODES: [PlayModeDescription; 3] = [
const AVAILABLE_PLAY_MODES: [PlayModeDescription; 5] = [
PlayModeDescription {
name: "Play against bot (offline)",
name: "🤖 Play against bot (offline)",
value: SelectPlayModeResult::PlayAgainstBot,
},
PlayModeDescription {
name: "Play against random player (online)",
name: "🎲 Play against random player (online)",
value: SelectPlayModeResult::PlayRandom,
},
PlayModeDescription {
name: "Exit app",
name: " Create play invite (online)",
value: SelectPlayModeResult::CreateInvite,
},
PlayModeDescription {
name: "🎫 Accept play invite (online)",
value: SelectPlayModeResult::AcceptInvite,
},
PlayModeDescription {
name: "❌ Exit app",
value: SelectPlayModeResult::Exit,
},
];
@@ -64,7 +92,7 @@ impl SelectPlayModeScreen {
if crossterm::event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Char('q') => return Ok(ScreenResult::Canceled),
KeyCode::Char('q') | KeyCode::Esc => return Ok(ScreenResult::Canceled),
KeyCode::Enter => {
return Ok(ScreenResult::Ok(
AVAILABLE_PLAY_MODES[self.curr_selection].value,
@@ -85,7 +113,7 @@ impl SelectPlayModeScreen {
}
fn ui<B: Backend>(&mut self, f: &mut Frame<B>) {
let area = centered_rect_size(50, 5, &f.size());
let area = centered_rect_size(50, 2 + AVAILABLE_PLAY_MODES.len() as u16, &f.size());
// Create a List from all list items and highlight the currently selected one
let items = AVAILABLE_PLAY_MODES

View File

@@ -12,8 +12,9 @@ use tui::{Frame, Terminal};
use sea_battle_backend::data::*;
use crate::constants::*;
use crate::consts::*;
use crate::ui_screens::confirm_dialog_screen::confirm;
use crate::ui_screens::popup_screen::show_screen_too_small_popup;
use crate::ui_screens::utils::{centered_rect_size, centered_text};
use crate::ui_screens::ScreenResult;
use crate::ui_widgets::game_map_widget::{ColoredCells, GameMapWidget};
@@ -65,7 +66,7 @@ impl<'a> SetBoatsLayoutScreen<'a> {
let event = event::read()?;
if let Event::Key(key) = &event {
match key.code {
KeyCode::Char('q') => {
KeyCode::Char('q') | KeyCode::Esc => {
if !self.confirm_on_cancel
|| confirm(terminal, "Do you really want to quit?")
{
@@ -201,7 +202,7 @@ impl<'a> SetBoatsLayoutScreen<'a> {
.add_colored_cells(current_boat)
.add_colored_cells(invalid_boats)
.add_colored_cells(other_boats)
.set_title("Choose your boat layout")
.set_title("🛥 Set your boats layout")
.set_yield_func(|c, r| {
for i in 0..r.width {
for j in 0..r.height {
@@ -227,6 +228,14 @@ impl<'a> SetBoatsLayoutScreen<'a> {
}
let (w, h) = game_map_widget.estimated_size();
if f.size().width < w || f.size().height < h + 3 {
// +3 = for errors
show_screen_too_small_popup(f);
drop(game_map_widget);
return coordinates_mapper;
}
let area = centered_rect_size(w, h, &f.size());
f.render_widget(game_map_widget, area);

View File

@@ -46,6 +46,25 @@ pub fn centered_rect_size(width: u16, height: u16, parent: &Rect) -> Rect {
}
}
/// helper function to create a centered rect using up certain container size, only horizontally
pub fn centered_rect_size_horizontally(width: u16, parent: &Rect) -> Rect {
if parent.width < width {
return Rect {
x: parent.x,
y: parent.y,
width: parent.width,
height: parent.height,
};
}
Rect {
x: parent.x + (parent.width - width) / 2,
y: parent.y,
width,
height: parent.height,
}
}
/// Get coordinates to render centered text
pub fn centered_text(text: &str, container: &Rect) -> Rect {
if text.len() > container.width as usize {

View File

@@ -1,6 +1,6 @@
use std::fmt::Display;
use crate::constants::HIGHLIGHT_COLOR;
use crate::consts::HIGHLIGHT_COLOR;
use tui::buffer::Buffer;
use tui::layout::Rect;
use tui::style::{Color, Style};
@@ -13,6 +13,7 @@ pub struct ButtonWidget {
label: String,
disabled: bool,
min_width: usize,
hover_bg_color: Color,
}
impl ButtonWidget {
@@ -22,9 +23,18 @@ impl ButtonWidget {
is_hovered,
disabled: false,
min_width: 0,
hover_bg_color: HIGHLIGHT_COLOR,
}
}
pub fn cancel(is_hovered: bool) -> Self {
Self::new("❌ Cancel", is_hovered).set_hover_bg_color(Color::Red)
}
pub fn ok(is_hovered: bool) -> Self {
Self::new("✅ OK", is_hovered)
}
pub fn set_disabled(mut self, disabled: bool) -> Self {
self.disabled = disabled;
self
@@ -34,14 +44,23 @@ impl ButtonWidget {
self.min_width = min_width;
self
}
pub fn set_hover_bg_color(mut self, v: Color) -> Self {
self.hover_bg_color = v;
self
}
pub fn estimated_size(&self) -> (u16, u16) {
((self.label.len() + 2).max(self.min_width) as u16, 1)
}
}
impl Widget for ButtonWidget {
fn render(self, area: Rect, buf: &mut Buffer) {
let expected_len = (self.label.len() + 2).max(self.min_width);
let expected_len = self.estimated_size().0;
let mut label = self.label.clone();
while label.len() < expected_len {
while label.len() < expected_len as usize {
label.insert(0, ' ');
label.push(' ');
}
@@ -51,7 +70,7 @@ impl Widget for ButtonWidget {
let input = Paragraph::new(label.as_ref()).style(match (self.disabled, self.is_hovered) {
(true, _) => Style::default(),
(_, false) => Style::default().bg(Color::DarkGray),
(_, true) => Style::default().fg(Color::White).bg(HIGHLIGHT_COLOR),
(_, true) => Style::default().fg(Color::White).bg(self.hover_bg_color),
});
input.render(area, buf);

View File

@@ -1,4 +1,4 @@
use crate::constants::HIGHLIGHT_COLOR;
use crate::consts::HIGHLIGHT_COLOR;
use std::fmt::Display;
use tui::buffer::Buffer;
use tui::layout::Rect;

View File

@@ -1,3 +1,4 @@
use std::collections::HashMap;
use std::fmt::Display;
use tui::buffer::Buffer;
@@ -21,6 +22,7 @@ pub struct GameMapWidget<'a> {
title: Option<String>,
legend: Option<String>,
yield_coordinates: Option<Box<dyn 'a + FnMut(Coordinates, Rect)>>,
chars: HashMap<Coordinates, char>,
}
impl<'a> GameMapWidget<'a> {
@@ -32,6 +34,7 @@ impl<'a> GameMapWidget<'a> {
title: None,
legend: None,
yield_coordinates: None,
chars: Default::default(),
}
}
@@ -63,9 +66,19 @@ impl<'a> GameMapWidget<'a> {
self
}
pub fn set_char(mut self, coordinates: Coordinates, c: char) -> Self {
self.chars.insert(coordinates, c);
self
}
pub fn set_char_no_overwrite(mut self, coordinates: Coordinates, c: char) -> Self {
self.chars.entry(coordinates).or_insert(c);
self
}
pub fn grid_size(&self) -> (u16, u16) {
let w = self.rules.map_width as u16 * 2 + 1;
let h = self.rules.map_height as u16 * 2 + 1;
let w = (self.rules.map_width as u16 * 2) + 2;
let h = (self.rules.map_height as u16 * 2) + 2;
(w, h)
}
@@ -85,7 +98,7 @@ impl<'a> GameMapWidget<'a> {
}
}
impl<'a> Widget for GameMapWidget<'a> {
impl Widget for GameMapWidget<'_> {
fn render(mut self, area: Rect, buf: &mut Buffer) {
let alphabet = PlayConfiguration::default().ordinate_alphabet;
@@ -157,9 +170,12 @@ impl<'a> Widget for GameMapWidget<'a> {
}
if x < self.rules.map_width && y < self.rules.map_height {
let cell = buf
.get_mut(o_x + 1, o_y + 1)
.set_char(self.default_empty_character);
let cell = buf.get_mut(o_x + 1, o_y + 1).set_char(
*self
.chars
.get(&coordinates)
.unwrap_or(&self.default_empty_character),
);
if let Some(c) = color {
cell.set_bg(c.color);

View File

@@ -1,6 +1,6 @@
use std::fmt::Display;
use crate::constants::HIGHLIGHT_COLOR;
use crate::consts::HIGHLIGHT_COLOR;
use tui::buffer::Buffer;
use tui::layout::Rect;
use tui::style::*;