work
This commit is contained in:
116
Cargo.lock
generated
116
Cargo.lock
generated
@@ -68,7 +68,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046"
|
checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android-properties",
|
"android-properties",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"cc",
|
"cc",
|
||||||
"cesu8",
|
"cesu8",
|
||||||
"jni",
|
"jni",
|
||||||
@@ -386,9 +386,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.10.0"
|
version = "2.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
|
checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
@@ -497,7 +497,7 @@ version = "0.13.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
|
checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"log",
|
"log",
|
||||||
"polling",
|
"polling",
|
||||||
"rustix 0.38.44",
|
"rustix 0.38.44",
|
||||||
@@ -721,7 +721,7 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
|
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"core-foundation 0.10.1",
|
"core-foundation 0.10.1",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -750,7 +750,7 @@ version = "0.16.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4cadaea21e24c49c0c82116f2b465ae6a49d63c90e428b0f8d9ae1f638ac91f"
|
checksum = "c4cadaea21e24c49c0c82116f2b465ae6a49d63c90e428b0f8d9ae1f638ac91f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"fontdb",
|
"fontdb",
|
||||||
"harfrust",
|
"harfrust",
|
||||||
"linebender_resource_handle",
|
"linebender_resource_handle",
|
||||||
@@ -997,7 +997,7 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
|
checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1461,7 +1461,7 @@ version = "0.6.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
|
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"gpu-alloc-types",
|
"gpu-alloc-types",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1471,7 +1471,7 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
|
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1506,7 +1506,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca"
|
checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"gpu-descriptor-types",
|
"gpu-descriptor-types",
|
||||||
"hashbrown 0.15.5",
|
"hashbrown 0.15.5",
|
||||||
]
|
]
|
||||||
@@ -1517,7 +1517,7 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
|
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1538,7 +1538,7 @@ version = "0.4.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0caaee032384c10dd597af4579c67dee16650d862a9ccbe1233ff1a379abc07"
|
checksum = "e0caaee032384c10dd597af4579c67dee16650d862a9ccbe1233ff1a379abc07"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"core_maths",
|
"core_maths",
|
||||||
"read-fonts 0.36.0",
|
"read-fonts 0.36.0",
|
||||||
@@ -1891,7 +1891,7 @@ version = "0.1.12"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
|
checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall 0.7.0",
|
"redox_syscall 0.7.0",
|
||||||
]
|
]
|
||||||
@@ -2021,7 +2021,7 @@ version = "0.32.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605"
|
checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block",
|
"block",
|
||||||
"core-graphics-types 0.2.0",
|
"core-graphics-types 0.2.0",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
@@ -2036,7 +2036,7 @@ version = "0.33.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15"
|
checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block",
|
"block",
|
||||||
"core-graphics-types 0.2.0",
|
"core-graphics-types 0.2.0",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
@@ -2090,7 +2090,7 @@ checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
@@ -2116,7 +2116,7 @@ checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
@@ -2140,7 +2140,7 @@ version = "0.9.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
|
checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"jni-sys",
|
"jni-sys",
|
||||||
"log",
|
"log",
|
||||||
"ndk-sys",
|
"ndk-sys",
|
||||||
@@ -2323,7 +2323,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
|
checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"libc",
|
"libc",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
@@ -2339,7 +2339,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
|
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-core-graphics",
|
"objc2-core-graphics",
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
@@ -2351,7 +2351,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
|
checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-core-location",
|
"objc2-core-location",
|
||||||
@@ -2375,7 +2375,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
|
checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-foundation 0.2.2",
|
"objc2-foundation 0.2.2",
|
||||||
@@ -2387,7 +2387,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
|
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"dispatch2",
|
"dispatch2",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
]
|
]
|
||||||
@@ -2398,7 +2398,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
|
checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"dispatch2",
|
"dispatch2",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
@@ -2441,7 +2441,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
|
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"dispatch",
|
"dispatch",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -2454,7 +2454,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
|
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
]
|
]
|
||||||
@@ -2465,7 +2465,7 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
|
checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
]
|
]
|
||||||
@@ -2488,7 +2488,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"
|
checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-foundation 0.2.2",
|
"objc2-foundation 0.2.2",
|
||||||
@@ -2500,7 +2500,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"
|
checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-foundation 0.2.2",
|
"objc2-foundation 0.2.2",
|
||||||
@@ -2523,7 +2523,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f"
|
checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-cloud-kit",
|
"objc2-cloud-kit",
|
||||||
@@ -2555,7 +2555,7 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
|
checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"objc2 0.5.2",
|
"objc2 0.5.2",
|
||||||
"objc2-core-location",
|
"objc2-core-location",
|
||||||
@@ -2781,7 +2781,7 @@ version = "0.18.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0"
|
checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"fdeflate",
|
"fdeflate",
|
||||||
"flate2",
|
"flate2",
|
||||||
@@ -3199,7 +3199,7 @@ version = "0.5.18"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3208,7 +3208,7 @@ version = "0.7.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27"
|
checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3254,7 +3254,7 @@ version = "0.12.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd490c5b18261893f14449cbd28cb9c0b637aebf161cd77900bfdedaff21ec32"
|
checksum = "fd490c5b18261893f14449cbd28cb9c0b637aebf161cd77900bfdedaff21ec32"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
@@ -3304,7 +3304,7 @@ version = "0.38.44"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
|
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys 0.4.15",
|
"linux-raw-sys 0.4.15",
|
||||||
@@ -3317,7 +3317,7 @@ version = "1.1.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
|
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys 0.11.0",
|
"linux-raw-sys 0.11.0",
|
||||||
@@ -3474,7 +3474,7 @@ version = "2.11.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
|
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"core-foundation 0.9.4",
|
"core-foundation 0.9.4",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -3487,7 +3487,7 @@ version = "3.5.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
|
checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"core-foundation 0.10.1",
|
"core-foundation 0.10.1",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -3682,7 +3682,7 @@ version = "0.19.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
|
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"calloop",
|
"calloop",
|
||||||
"calloop-wayland-source",
|
"calloop-wayland-source",
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
@@ -3735,7 +3735,7 @@ version = "0.3.0+sdk-1.3.268.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
|
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4285,7 +4285,7 @@ version = "0.241.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8"
|
checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"hashbrown 0.15.5",
|
"hashbrown 0.15.5",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"semver",
|
"semver",
|
||||||
@@ -4311,7 +4311,7 @@ version = "0.31.12"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
|
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.3",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
@@ -4323,7 +4323,7 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
|
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
]
|
]
|
||||||
@@ -4345,7 +4345,7 @@ version = "0.32.10"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3"
|
checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
@@ -4357,7 +4357,7 @@ version = "0.3.10"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b"
|
checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols",
|
||||||
@@ -4370,7 +4370,7 @@ version = "0.3.10"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3"
|
checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols",
|
||||||
@@ -4442,7 +4442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77"
|
checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"document-features",
|
"document-features",
|
||||||
@@ -4471,7 +4471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f"
|
checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
@@ -4503,7 +4503,7 @@ dependencies = [
|
|||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bit-vec",
|
"bit-vec",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"document-features",
|
"document-features",
|
||||||
@@ -4535,7 +4535,7 @@ dependencies = [
|
|||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bit-vec",
|
"bit-vec",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"document-features",
|
"document-features",
|
||||||
@@ -4622,7 +4622,7 @@ dependencies = [
|
|||||||
"arrayvec",
|
"arrayvec",
|
||||||
"ash",
|
"ash",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block",
|
"block",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@@ -4671,7 +4671,7 @@ dependencies = [
|
|||||||
"arrayvec",
|
"arrayvec",
|
||||||
"ash",
|
"ash",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block",
|
"block",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@@ -4715,7 +4715,7 @@ version = "27.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb"
|
checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
@@ -4729,7 +4729,7 @@ version = "28.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c"
|
checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
@@ -5181,7 +5181,7 @@ dependencies = [
|
|||||||
"ahash",
|
"ahash",
|
||||||
"android-activity",
|
"android-activity",
|
||||||
"atomic-waker",
|
"atomic-waker",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"block2",
|
"block2",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"calloop",
|
"calloop",
|
||||||
@@ -5297,7 +5297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241"
|
checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -5407,7 +5407,7 @@ version = "0.4.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
|
checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.11.0",
|
||||||
"dlib",
|
"dlib",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use crate::ClientEvent;
|
use crate::ClientEvent;
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use openworm::net::{
|
use openworm::net::{
|
||||||
AccountCreated, ClientMsg, ClientMsgInst, ClientRequestMsg, CreateAccount, RecvHandler,
|
ClientMsg, ClientRequestMsg, CreateAccount, CreateAccountResp, RecvHandler, RequestId,
|
||||||
RequestId, SERVER_NAME, ServerMsg, ServerRespMsg, SkipServerVerification, recv_uni, send_uni,
|
SERVER_NAME, ServerMsg, ServerRespMsg, SkipServerVerification, recv_uni, send_uni,
|
||||||
};
|
};
|
||||||
use quinn::{
|
use quinn::{
|
||||||
ClientConfig, Connection, Endpoint, IdleTimeout, TransportConfig,
|
ClientConfig, Connection, Endpoint, IdleTimeout, TransportConfig,
|
||||||
@@ -79,10 +79,10 @@ pub trait RequestMsg: Into<ClientMsg> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RequestMsg for CreateAccount {
|
impl RequestMsg for CreateAccount {
|
||||||
type Result = AccountCreated;
|
type Result = CreateAccountResp;
|
||||||
|
|
||||||
fn result(msg: ServerMsg) -> Option<Self::Result> {
|
fn result(msg: ServerMsg) -> Option<Self::Result> {
|
||||||
if let ServerMsg::AccountCreated(res) = msg {
|
if let ServerMsg::CreateAccount(res) = msg {
|
||||||
Some(res)
|
Some(res)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use openworm::net::CreateAccount;
|
use openworm::net::{CreateAccount, CreateAccountResp};
|
||||||
|
|
||||||
use crate::net::{self, ConnectInfo};
|
use crate::net::{self, ConnectInfo};
|
||||||
|
|
||||||
@@ -81,6 +81,15 @@ pub fn create_account(rsc: &mut Rsc) -> WeakWidget {
|
|||||||
else {
|
else {
|
||||||
return fail("failed to create account");
|
return fail("failed to create account");
|
||||||
};
|
};
|
||||||
|
let id = match resp {
|
||||||
|
CreateAccountResp::Ok { id } => id,
|
||||||
|
CreateAccountResp::UsernameExists => {
|
||||||
|
return fail("username already exists");
|
||||||
|
}
|
||||||
|
CreateAccountResp::InvalidToken => {
|
||||||
|
return fail("invalid account token");
|
||||||
|
}
|
||||||
|
};
|
||||||
println!("account created!!!!");
|
println!("account created!!!!");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ pub const DB_VERSION: u64 = 0;
|
|||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Db {
|
pub struct Db {
|
||||||
db: Database,
|
db: Database,
|
||||||
|
pub account_tokens: DbMap<String, ServerPerms>,
|
||||||
pub msgs: DbMap<MsgId, Msg>,
|
pub msgs: DbMap<MsgId, Msg>,
|
||||||
pub users: DbMap<UserId, User>,
|
pub users: DbMap<UserId, User>,
|
||||||
pub usernames: DbMap<String, UserId>,
|
pub usernames: DbMap<String, UserId>,
|
||||||
@@ -23,6 +24,7 @@ pub type ImageId = ImageIdV0;
|
|||||||
pub type User = UserV0;
|
pub type User = UserV0;
|
||||||
pub type Msg = MsgV0;
|
pub type Msg = MsgV0;
|
||||||
pub type ChannelInfo = ChannelV0;
|
pub type ChannelInfo = ChannelV0;
|
||||||
|
pub type ServerPerms = ServerPermsV0;
|
||||||
|
|
||||||
impl Db {
|
impl Db {
|
||||||
pub fn open(path: impl AsRef<Path>) -> Db {
|
pub fn open(path: impl AsRef<Path>) -> Db {
|
||||||
@@ -34,10 +36,11 @@ impl Db {
|
|||||||
panic!("non matching db version! (auto update in the future)");
|
panic!("non matching db version! (auto update in the future)");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("no previous db found, creating new");
|
println!("no previous db found, creating new version {DB_VERSION}");
|
||||||
info.insert("version", &DB_VERSION);
|
info.insert("version", &DB_VERSION);
|
||||||
}
|
}
|
||||||
Db {
|
Db {
|
||||||
|
account_tokens: DbMap::open("account_token", &db),
|
||||||
msgs: DbMap::open("msg", &db),
|
msgs: DbMap::open("msg", &db),
|
||||||
users: DbMap::open("user", &db),
|
users: DbMap::open("user", &db),
|
||||||
usernames: DbMap::open("username", &db),
|
usernames: DbMap::open("username", &db),
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ impl<K: Key<Output = K>, V: Encode + DecodeOwned> DbMap<K, V> {
|
|||||||
Some(bitcode::decode(&v).unwrap())
|
Some(bitcode::decode(&v).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn len(&self) -> usize {
|
||||||
|
self.keyspace.approximate_len()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
self.len() == 0
|
||||||
|
}
|
||||||
|
|
||||||
pub fn iter(&self) -> impl Iterator<Item = (K, V)> {
|
pub fn iter(&self) -> impl Iterator<Item = (K, V)> {
|
||||||
self.db.read_tx().iter(self)
|
self.db.read_tx().iter(self)
|
||||||
}
|
}
|
||||||
@@ -129,6 +137,12 @@ impl WriteTx {
|
|||||||
self.0.get(&map.keyspace, k).unwrap().is_some()
|
self.0.get(&map.keyspace, k).unwrap().is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn remove<K: Key<Output = K>, V: DecodeOwned>(&mut self, map: &DbMap<K, V>, k: K) -> Option<V> {
|
||||||
|
let k = Slice::new(k.to_bytes().as_ref());
|
||||||
|
let v = self.0.take(&map.keyspace, k).unwrap()?;
|
||||||
|
Some(bitcode::decode(&v).unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: K2 IS NOT A SAFE ABSTRACTION!! need to have KeyLike which has key assoc type
|
// TODO: K2 IS NOT A SAFE ABSTRACTION!! need to have KeyLike which has key assoc type
|
||||||
pub fn insert<K: Key<Output = K>, K2: Key<Output = K> + ?Sized, V: Encode>(
|
pub fn insert<K: Key<Output = K>, K2: Key<Output = K> + ?Sized, V: Encode>(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|||||||
@@ -3,12 +3,20 @@ pub type MsgIdV0 = i128;
|
|||||||
pub type ChannelIdV0 = u64;
|
pub type ChannelIdV0 = u64;
|
||||||
pub type ImageIdV0 = u64;
|
pub type ImageIdV0 = u64;
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, bitcode::Encode, bitcode::Decode)]
|
||||||
|
pub struct ServerPermsV0(u32);
|
||||||
|
impl ServerPermsV0 {
|
||||||
|
pub const NONE: Self = Self(0);
|
||||||
|
pub const ACCOUNT_TOKENS: Self = Self(1 << 0);
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(bitcode::Encode, bitcode::Decode)]
|
#[derive(bitcode::Encode, bitcode::Decode)]
|
||||||
pub struct UserV0 {
|
pub struct UserV0 {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password_hash: String,
|
pub password_hash: String,
|
||||||
pub pfp: Option<ImageIdV0>,
|
pub pfp: Option<ImageIdV0>,
|
||||||
pub bio: String,
|
pub bio: String,
|
||||||
|
pub server_perms: ServerPermsV0,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(bitcode::Encode, bitcode::Decode)]
|
#[derive(bitcode::Encode, bitcode::Decode)]
|
||||||
@@ -21,3 +29,9 @@ pub struct ChannelV0 {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
pub desc: String,
|
pub desc: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ServerPermsV0 {
|
||||||
|
pub fn contains(&self, other: Self) -> bool {
|
||||||
|
(self.0 & other.0) == other.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
mod db;
|
mod db;
|
||||||
mod net;
|
mod net;
|
||||||
|
|
||||||
use crate::db::{Db, Msg, User};
|
use crate::db::{Db, Msg, ServerPerms, User};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use net::{ClientSender, ConAccepter, listen};
|
use net::{ClientSender, ConAccepter, listen};
|
||||||
use openworm::{
|
use openworm::{
|
||||||
net::{
|
net::{
|
||||||
AccountCreated, ClientMsg, ClientRequestMsg, CreateAccount, DisconnectReason, LoadMsg,
|
ClientMsg, ClientRequestMsg, CreateAccount, CreateAccountResp, DisconnectReason, LoadMsg,
|
||||||
RecvHandler, ServerError, ServerMsg, install_crypto_provider,
|
RecvHandler, ServerError, ServerMsg, install_crypto_provider,
|
||||||
},
|
},
|
||||||
rsc::DataDir,
|
rsc::DataDir,
|
||||||
};
|
};
|
||||||
|
use rand::distr::{Alphanumeric, SampleString};
|
||||||
use scrypt::{
|
use scrypt::{
|
||||||
Scrypt,
|
Scrypt,
|
||||||
password_hash::{PasswordHasher, SaltString, rand_core::OsRng},
|
password_hash::{PasswordHasher, SaltString, rand_core::OsRng},
|
||||||
@@ -48,6 +49,10 @@ pub async fn run_server(port: u16) {
|
|||||||
count: 0.into(),
|
count: 0.into(),
|
||||||
db: db.clone(),
|
db: db.clone(),
|
||||||
};
|
};
|
||||||
|
if db.users.is_empty() {
|
||||||
|
let token = account_token(&db, ServerPerms::ACCOUNT_TOKENS);
|
||||||
|
println!("no users found, token for admin: {token}");
|
||||||
|
}
|
||||||
let (endpoint, handle) = listen(port, path, handler);
|
let (endpoint, handle) = listen(port, path, handler);
|
||||||
let _ = ctrl_c().await;
|
let _ = ctrl_c().await;
|
||||||
println!("stopping server");
|
println!("stopping server");
|
||||||
@@ -57,6 +62,12 @@ pub async fn run_server(port: u16) {
|
|||||||
endpoint.wait_idle().await;
|
endpoint.wait_idle().await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn account_token(db: &Db, perms: ServerPerms) -> String {
|
||||||
|
let token = Alphanumeric.sample_string(&mut rand::rng(), 16);
|
||||||
|
db.account_tokens.insert(&token, &perms);
|
||||||
|
token
|
||||||
|
}
|
||||||
|
|
||||||
type ClientId = u64;
|
type ClientId = u64;
|
||||||
|
|
||||||
struct ServerListener {
|
struct ServerListener {
|
||||||
@@ -94,9 +105,7 @@ struct ClientHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
||||||
async fn connect(&self) -> () {
|
async fn connect(&self) -> () {}
|
||||||
println!("connected: {:?}", self.send.remote().ip());
|
|
||||||
}
|
|
||||||
async fn msg(&self, req: ClientRequestMsg) {
|
async fn msg(&self, req: ClientRequestMsg) {
|
||||||
let msg = ClientMsg::from(req.msg);
|
let msg = ClientMsg::from(req.msg);
|
||||||
let replier = self.send.replier(req.id);
|
let replier = self.send.replier(req.id);
|
||||||
@@ -173,8 +182,13 @@ impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
|||||||
let mut id;
|
let mut id;
|
||||||
loop {
|
loop {
|
||||||
let mut tx = self.db.write_tx();
|
let mut tx = self.db.write_tx();
|
||||||
|
let Some(perms) = tx.remove(&self.db.account_tokens, token.to_string()) else {
|
||||||
|
let _ = replier.send(CreateAccountResp::InvalidToken).await;
|
||||||
|
println!("invalid token: {:?}", self.send.remote());
|
||||||
|
return;
|
||||||
|
};
|
||||||
if tx.has_key(&self.db.usernames, username.clone()) {
|
if tx.has_key(&self.db.usernames, username.clone()) {
|
||||||
let _ = replier.send(ServerError::UsernameTaken).await;
|
let _ = replier.send(CreateAccountResp::UsernameExists).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
id = rand::random();
|
id = rand::random();
|
||||||
@@ -189,6 +203,7 @@ impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
|||||||
password_hash: hash.clone(),
|
password_hash: hash.clone(),
|
||||||
bio: String::new(),
|
bio: String::new(),
|
||||||
pfp: None,
|
pfp: None,
|
||||||
|
server_perms: perms,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
tx.insert(&self.db.usernames, username, &id);
|
tx.insert(&self.db.usernames, username, &id);
|
||||||
@@ -198,7 +213,7 @@ impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
|||||||
}
|
}
|
||||||
println!("account created: \"{username}\"");
|
println!("account created: \"{username}\"");
|
||||||
*self.state.write().await = ClientState::Authed(id);
|
*self.state.write().await = ClientState::Authed(id);
|
||||||
let _ = replier.send(AccountCreated {}).await;
|
let _ = replier.send(CreateAccountResp::Ok { id }).await;
|
||||||
} // ClientMsgType::Login { username, password } => {
|
} // ClientMsgType::Login { username, password } => {
|
||||||
// let Some(id) = self.db.usernames.get(&username) else {
|
// let Some(id) = self.db.usernames.get(&username) else {
|
||||||
// let _ = self.send.send(ServerError::UnknownUsername).await;
|
// let _ = self.send.send(ServerError::UnknownUsername).await;
|
||||||
@@ -221,7 +236,6 @@ impl RecvHandler<ClientRequestMsg> for ClientHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn disconnect(&self, reason: DisconnectReason) -> () {
|
async fn disconnect(&self, reason: DisconnectReason) -> () {
|
||||||
println!("disconnected: {:?}", self.send.remote().ip());
|
|
||||||
match reason {
|
match reason {
|
||||||
DisconnectReason::Closed | DisconnectReason::Timeout => (),
|
DisconnectReason::Closed | DisconnectReason::Timeout => (),
|
||||||
DisconnectReason::Other(e) => println!("connection issue: {e}"),
|
DisconnectReason::Other(e) => println!("connection issue: {e}"),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ impl From<ClientMsgInst> for ClientMsg {
|
|||||||
impl From<ServerMsg> for ServerMsgInst {
|
impl From<ServerMsg> for ServerMsgInst {
|
||||||
fn from(value: ServerMsg) -> Self {
|
fn from(value: ServerMsg) -> Self {
|
||||||
match value {
|
match value {
|
||||||
ServerMsg::AccountCreated(v) => Self::AccountCreatedV0(v),
|
ServerMsg::CreateAccount(v) => Self::CreateAccountV0(v),
|
||||||
ServerMsg::LoadMsg(v) => Self::LoadMsgV0(v),
|
ServerMsg::LoadMsg(v) => Self::LoadMsgV0(v),
|
||||||
ServerMsg::LoadMsgs(v) => Self::LoadMsgsV0(v),
|
ServerMsg::LoadMsgs(v) => Self::LoadMsgsV0(v),
|
||||||
ServerMsg::ServerError(v) => Self::ServerErrorV0(v),
|
ServerMsg::ServerError(v) => Self::ServerErrorV0(v),
|
||||||
@@ -37,7 +37,7 @@ impl From<ServerMsg> for ServerMsgInst {
|
|||||||
impl From<ServerMsgInst> for ServerMsg {
|
impl From<ServerMsgInst> for ServerMsg {
|
||||||
fn from(value: ServerMsgInst) -> Self {
|
fn from(value: ServerMsgInst) -> Self {
|
||||||
match value {
|
match value {
|
||||||
ServerMsgInst::AccountCreatedV0(v) => Self::AccountCreated(v),
|
ServerMsgInst::CreateAccountV0(v) => Self::CreateAccount(v),
|
||||||
ServerMsgInst::LoadMsgV0(v) => Self::LoadMsg(v),
|
ServerMsgInst::LoadMsgV0(v) => Self::LoadMsg(v),
|
||||||
ServerMsgInst::LoadMsgsV0(v) => Self::LoadMsgs(v),
|
ServerMsgInst::LoadMsgsV0(v) => Self::LoadMsgs(v),
|
||||||
ServerMsgInst::ServerErrorV0(v) => Self::ServerError(v),
|
ServerMsgInst::ServerErrorV0(v) => Self::ServerError(v),
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pub enum ClientMsgInst {
|
|||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
||||||
pub enum ServerMsgInst {
|
pub enum ServerMsgInst {
|
||||||
AccountCreatedV0(AccountCreatedV0) = 0,
|
CreateAccountV0(CreateAccountRespV0) = 0,
|
||||||
LoadMsgV0(LoadMsgV0) = 1,
|
LoadMsgV0(LoadMsgV0) = 1,
|
||||||
LoadMsgsV0(Vec<LoadMsgV0>) = 2,
|
LoadMsgsV0(Vec<LoadMsgV0>) = 2,
|
||||||
ServerErrorV0(ServerErrorV0) = 3,
|
ServerErrorV0(ServerErrorV0) = 3,
|
||||||
@@ -28,7 +28,11 @@ pub struct CreateAccountV0 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
||||||
pub struct AccountCreatedV0 {}
|
pub enum CreateAccountRespV0 {
|
||||||
|
Ok { id: UserIdV0 },
|
||||||
|
UsernameExists,
|
||||||
|
InvalidToken,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
||||||
pub struct LoginKeyV0(Vec<u8>);
|
pub struct LoginKeyV0(Vec<u8>);
|
||||||
@@ -64,7 +68,4 @@ pub struct LoadMsgV0 {
|
|||||||
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
#[derive(Debug, bitcode::Encode, bitcode::Decode)]
|
||||||
pub enum ServerErrorV0 {
|
pub enum ServerErrorV0 {
|
||||||
NotLoggedIn,
|
NotLoggedIn,
|
||||||
UnknownUsername,
|
|
||||||
InvalidPassword,
|
|
||||||
UsernameTaken,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pub enum ClientMsg {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ServerMsg {
|
pub enum ServerMsg {
|
||||||
AccountCreated(AccountCreated),
|
CreateAccount(CreateAccountResp),
|
||||||
LoadMsg(LoadMsg),
|
LoadMsg(LoadMsg),
|
||||||
LoadMsgs(Vec<LoadMsg>),
|
LoadMsgs(Vec<LoadMsg>),
|
||||||
ServerError(ServerError),
|
ServerError(ServerError),
|
||||||
@@ -20,7 +20,7 @@ pub type SendMsg = SendMsgV0;
|
|||||||
pub type LoadMsg = LoadMsgV0;
|
pub type LoadMsg = LoadMsgV0;
|
||||||
pub type ServerError = ServerErrorV0;
|
pub type ServerError = ServerErrorV0;
|
||||||
pub type CreateAccount = CreateAccountV0;
|
pub type CreateAccount = CreateAccountV0;
|
||||||
pub type AccountCreated = AccountCreatedV0;
|
pub type CreateAccountResp = CreateAccountRespV0;
|
||||||
pub type UserId = UserIdV0;
|
pub type UserId = UserIdV0;
|
||||||
|
|
||||||
impl From<CreateAccount> for ClientMsg {
|
impl From<CreateAccount> for ClientMsg {
|
||||||
@@ -41,8 +41,8 @@ impl From<LoadMsg> for ServerMsg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<AccountCreated> for ServerMsg {
|
impl From<CreateAccountResp> for ServerMsg {
|
||||||
fn from(value: AccountCreated) -> Self {
|
fn from(value: CreateAccountResp) -> Self {
|
||||||
Self::AccountCreated(value)
|
Self::CreateAccount(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user