DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

37439492a26c900dafdd6cadc057be136dd22d7b — Jonni Liljamo 1 year, 5 months ago 1cda49d
feat(client): functional login and register
M Cargo.lock => Cargo.lock +621 -14
@@ 218,6 218,19 @@ dependencies = [
]

[[package]]
name = "async-compression"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a"
dependencies = [
 "flate2",
 "futures-core",
 "memchr",
 "pin-project-lite",
 "tokio",
]

[[package]]
name = "async-executor"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 280,6 293,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"

[[package]]
name = "base64"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"

[[package]]
name = "bevy"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1385,6 1404,15 @@ dependencies = [
]

[[package]]
name = "encoding_rs"
version = "0.8.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
dependencies = [
 "cfg-if",
]

[[package]]
name = "epaint"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1410,6 1438,27 @@ dependencies = [
]

[[package]]
name = "errno"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
dependencies = [
 "errno-dragonfly",
 "libc",
 "windows-sys 0.48.0",
]

[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
 "cc",
 "libc",
]

[[package]]
name = "error-code"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1469,6 1518,12 @@ dependencies = [
]

[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"

[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1493,6 1548,15 @@ dependencies = [
]

[[package]]
name = "futures-channel"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
dependencies = [
 "futures-core",
]

[[package]]
name = "futures-core"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1520,6 1584,33 @@ dependencies = [
]

[[package]]
name = "futures-sink"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"

[[package]]
name = "futures-task"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"

[[package]]
name = "futures-util"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
dependencies = [
 "futures-core",
 "futures-io",
 "futures-task",
 "memchr",
 "pin-project-lite",
 "pin-utils",
 "slab",
]

[[package]]
name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1659,6 1750,25 @@ dependencies = [
]

[[package]]
name = "h2"
version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
dependencies = [
 "bytes",
 "fnv",
 "futures-core",
 "futures-sink",
 "futures-util",
 "http",
 "indexmap",
 "slab",
 "tokio",
 "tokio-util",
 "tracing",
]

[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1684,6 1794,21 @@ dependencies = [
]

[[package]]
name = "hermit-abi"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
dependencies = [
 "libc",
]

[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"

[[package]]
name = "hexasphere"
version = "8.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1700,6 1825,77 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"

[[package]]
name = "http"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
 "bytes",
 "fnv",
 "itoa",
]

[[package]]
name = "http-body"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
 "bytes",
 "http",
 "pin-project-lite",
]

[[package]]
name = "httparse"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"

[[package]]
name = "httpdate"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"

[[package]]
name = "hyper"
version = "0.14.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
dependencies = [
 "bytes",
 "futures-channel",
 "futures-core",
 "futures-util",
 "h2",
 "http",
 "http-body",
 "httparse",
 "httpdate",
 "itoa",
 "pin-project-lite",
 "socket2",
 "tokio",
 "tower-service",
 "tracing",
 "want",
]

[[package]]
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
 "bytes",
 "hyper",
 "native-tls",
 "tokio",
 "tokio-native-tls",
]

[[package]]
name = "idna"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1747,6 1943,29 @@ dependencies = [
]

[[package]]
name = "io-lifetimes"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
dependencies = [
 "hermit-abi 0.3.1",
 "libc",
 "windows-sys 0.48.0",
]

[[package]]
name = "ipnet"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"

[[package]]
name = "itoa"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"

[[package]]
name = "jni"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1759,7 1978,7 @@ dependencies = [
 "log",
 "thiserror",
 "walkdir",
 "windows-sys",
 "windows-sys 0.45.0",
]

[[package]]


@@ 1810,6 2029,9 @@ dependencies = [
 "bevy",
 "bevy_editor_pls",
 "bevy_egui",
 "futures-lite",
 "reqwest",
 "serde",
]

[[package]]


@@ 1835,6 2057,12 @@ dependencies = [
]

[[package]]
name = "linux-raw-sys"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f508063cc7bb32987c71511216bd5a32be15bccb6a80b52df8b9d7f01fc3aa2"

[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1901,6 2129,12 @@ dependencies = [
]

[[package]]
name = "mime"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"

[[package]]
name = "miniz_oxide"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1928,7 2162,7 @@ dependencies = [
 "libc",
 "log",
 "wasi",
 "windows-sys",
 "windows-sys 0.45.0",
]

[[package]]


@@ 1954,6 2188,24 @@ dependencies = [
]

[[package]]
name = "native-tls"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
dependencies = [
 "lazy_static",
 "libc",
 "log",
 "openssl",
 "openssl-probe",
 "openssl-sys",
 "schannel",
 "security-framework",
 "security-framework-sys",
 "tempfile",
]

[[package]]
name = "ndk"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2050,6 2302,16 @@ dependencies = [
]

[[package]]
name = "num_cpus"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [
 "hermit-abi 0.2.6",
 "libc",
]

[[package]]
name = "num_enum"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2161,6 2423,50 @@ dependencies = [
]

[[package]]
name = "openssl"
version = "0.10.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1"
dependencies = [
 "bitflags",
 "cfg-if",
 "foreign-types",
 "libc",
 "once_cell",
 "openssl-macros",
 "openssl-sys",
]

[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.15",
]

[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"

[[package]]
name = "openssl-sys"
version = "0.9.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0"
dependencies = [
 "cc",
 "libc",
 "pkg-config",
 "vcpkg",
]

[[package]]
name = "orbclient"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2213,7 2519,7 @@ dependencies = [
 "libc",
 "redox_syscall 0.2.16",
 "smallvec",
 "windows-sys",
 "windows-sys 0.45.0",
]

[[package]]


@@ 2245,6 2551,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"

[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"

[[package]]
name = "pkg-config"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2398,12 2710,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157"

[[package]]
name = "reqwest"
version = "0.11.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254"
dependencies = [
 "async-compression",
 "base64 0.21.0",
 "bytes",
 "encoding_rs",
 "futures-core",
 "futures-util",
 "h2",
 "http",
 "http-body",
 "hyper",
 "hyper-tls",
 "ipnet",
 "js-sys",
 "log",
 "mime",
 "native-tls",
 "once_cell",
 "percent-encoding",
 "pin-project-lite",
 "serde",
 "serde_json",
 "serde_urlencoded",
 "tokio",
 "tokio-native-tls",
 "tokio-util",
 "tower-service",
 "url",
 "wasm-bindgen",
 "wasm-bindgen-futures",
 "web-sys",
 "winreg",
]

[[package]]
name = "ron"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff"
dependencies = [
 "base64",
 "base64 0.13.1",
 "bitflags",
 "serde",
]


@@ 2421,6 2772,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustix"
version = "0.37.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "722529a737f5a942fdbac3a46cee213053196737c5eaa3386d52e85b786f2659"
dependencies = [
 "bitflags",
 "errno",
 "io-lifetimes",
 "libc",
 "linux-raw-sys",
 "windows-sys 0.48.0",
]

[[package]]
name = "ryu"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"

[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2430,12 2801,44 @@ dependencies = [
]

[[package]]
name = "schannel"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
 "windows-sys 0.42.0",
]

[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"

[[package]]
name = "security-framework"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
dependencies = [
 "bitflags",
 "core-foundation",
 "core-foundation-sys",
 "libc",
 "security-framework-sys",
]

[[package]]
name = "security-framework-sys"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
dependencies = [
 "core-foundation-sys",
 "libc",
]

[[package]]
name = "serde"
version = "1.0.160"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2456,6 2859,29 @@ dependencies = [
]

[[package]]
name = "serde_json"
version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
dependencies = [
 "itoa",
 "ryu",
 "serde",
]

[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
 "form_urlencoded",
 "itoa",
 "ryu",
 "serde",
]

[[package]]
name = "sharded-slab"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2498,6 2924,16 @@ dependencies = [
]

[[package]]
name = "socket2"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
dependencies = [
 "libc",
 "winapi",
]

[[package]]
name = "spin_sleep"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2583,6 3019,19 @@ dependencies = [
]

[[package]]
name = "tempfile"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998"
dependencies = [
 "cfg-if",
 "fastrand",
 "redox_syscall 0.3.5",
 "rustix",
 "windows-sys 0.45.0",
]

[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2648,6 3097,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"

[[package]]
name = "tokio"
version = "1.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001"
dependencies = [
 "autocfg",
 "bytes",
 "libc",
 "mio",
 "num_cpus",
 "pin-project-lite",
 "socket2",
 "windows-sys 0.45.0",
]

[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
 "native-tls",
 "tokio",
]

[[package]]
name = "tokio-util"
version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2"
dependencies = [
 "bytes",
 "futures-core",
 "futures-sink",
 "pin-project-lite",
 "tokio",
 "tracing",
]

[[package]]
name = "toml_datetime"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2665,6 3154,12 @@ dependencies = [
]

[[package]]
name = "tower-service"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"

[[package]]
name = "tracing"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2738,6 3233,12 @@ dependencies = [
]

[[package]]
name = "try-lock"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"

[[package]]
name = "ttf-parser"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2804,6 3305,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"

[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"

[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 2826,6 3333,16 @@ dependencies = [
]

[[package]]
name = "want"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
dependencies = [
 "log",
 "try-lock",
]

[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 3095,7 3612,7 @@ checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
dependencies = [
 "windows-implement",
 "windows-interface",
 "windows-targets",
 "windows-targets 0.42.2",
]

[[package]]


@@ 3122,11 3639,35 @@ dependencies = [

[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
 "windows_aarch64_gnullvm 0.42.2",
 "windows_aarch64_msvc 0.42.2",
 "windows_i686_gnu 0.42.2",
 "windows_i686_msvc 0.42.2",
 "windows_x86_64_gnu 0.42.2",
 "windows_x86_64_gnullvm 0.42.2",
 "windows_x86_64_msvc 0.42.2",
]

[[package]]
name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
 "windows-targets",
 "windows-targets 0.42.2",
]

[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
 "windows-targets 0.48.0",
]

[[package]]


@@ 3135,13 3676,28 @@ version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
 "windows_aarch64_gnullvm",
 "windows_aarch64_msvc",
 "windows_i686_gnu",
 "windows_i686_msvc",
 "windows_x86_64_gnu",
 "windows_x86_64_gnullvm",
 "windows_x86_64_msvc",
 "windows_aarch64_gnullvm 0.42.2",
 "windows_aarch64_msvc 0.42.2",
 "windows_i686_gnu 0.42.2",
 "windows_i686_msvc 0.42.2",
 "windows_x86_64_gnu 0.42.2",
 "windows_x86_64_gnullvm 0.42.2",
 "windows_x86_64_msvc 0.42.2",
]

[[package]]
name = "windows-targets"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
dependencies = [
 "windows_aarch64_gnullvm 0.48.0",
 "windows_aarch64_msvc 0.48.0",
 "windows_i686_gnu 0.48.0",
 "windows_i686_msvc 0.48.0",
 "windows_x86_64_gnu 0.48.0",
 "windows_x86_64_gnullvm 0.48.0",
 "windows_x86_64_msvc 0.48.0",
]

[[package]]


@@ 3151,42 3707,84 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"

[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"

[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"

[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"

[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"

[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"

[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"

[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"

[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"

[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"

[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"

[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"

[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"

[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"

[[package]]
name = "winit"
version = "0.28.3"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 3212,7 3810,7 @@ dependencies = [
 "wasm-bindgen",
 "wayland-scanner",
 "web-sys",
 "windows-sys",
 "windows-sys 0.45.0",
 "x11-dl",
]



@@ 3226,6 3824,15 @@ dependencies = [
]

[[package]]
name = "winreg"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
dependencies = [
 "winapi",
]

[[package]]
name = "x11-dl"
version = "2.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

M client/Cargo.toml => client/Cargo.toml +11 -0
@@ 11,6 11,17 @@ license = "GPL-3.0-only"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
futures-lite = "1.13.0"

reqwest = { version = "0.11.16", features = [ "blocking", "json", "gzip" ] }

[dependencies.serde]
version = "1.0.160"
default-features = false
features = [
    "std",
    "derive"
]

[dependencies.bevy]
version = "0.10.1"

A client/src/api/mod.rs => client/src/api/mod.rs +9 -0
@@ 0,0 1,9 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

pub mod user;

A client/src/api/user/login.rs => client/src/api/user/login.rs +58 -0
@@ 0,0 1,58 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use serde::{Deserialize, Serialize};

use crate::NetworkingOptions;

use super::User;

#[derive(Deserialize)]
struct LoginResponseJson {
    id: String,
    created_at: String,
    updated_at: String,
    username: String,
    token: String,
}

impl LoginResponseJson {
    fn to_user(&self) -> User {
        User {
            id: self.id.clone(),
            created_at: self.created_at.clone(),
            updated_at: self.updated_at.clone(),
            username: self.username.clone(),
        }
    }
}

pub type LoginResponse = Result<User, ()>;

#[derive(Serialize)]
struct LoginPost {
    email: String,
    password: String,
}

pub fn login(no: &mut NetworkingOptions, email: &str, password: &str) -> LoginResponse {
    let res = no.req
        .post(&format!("{}/user/token", &no.api_address))
        .json(&LoginPost {
            email: email.to_string(),
            password: password.to_string(),
        })
        .send()
        .unwrap();

    let tmp: LoginResponseJson = res.json().unwrap();

    no.user_token = tmp.token.clone();

    Ok(tmp.to_user())
}

A client/src/api/user/mod.rs => client/src/api/user/mod.rs +23 -0
@@ 0,0 1,23 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use serde::Deserialize;

mod login;
pub use login::*;

mod register;
pub use register::*;

#[derive(Deserialize)]
pub struct User {
    pub id: String,
    pub created_at: String,
    pub updated_at: String,
    pub username: String,
}

A client/src/api/user/register.rs => client/src/api/user/register.rs +41 -0
@@ 0,0 1,41 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use serde::Serialize;

use crate::NetworkingOptions;

use super::User;

pub type RegisterResponse = Result<User, ()>;

#[derive(Serialize)]
struct RegisterPost {
    username: String,
    email: String,
    password: String,
}

pub fn register(
    no: &NetworkingOptions,
    username: &str,
    email: &str,
    password: &str,
) -> RegisterResponse {
    let res = no.req
        .post(&format!("{}/user", &no.api_address))
        .json(&RegisterPost {
            username: username.to_string(),
            email: email.to_string(),
            password: password.to_string(),
        })
        .send()
        .unwrap();

    Ok(res.json().unwrap())
}

A client/src/macros/async_task.rs => client/src/macros/async_task.rs +91 -0
@@ 0,0 1,91 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

#[macro_export]
macro_rules! async_task_start_call {
    ($call_event_type:ty, $call_type:expr, |$ev:ident| $func:expr) => {
        pub fn start_call(
            mut commands: Commands,
            mut start_ev_r: EventReader<$call_event_type>,
        ) {
            for ev in start_ev_r.iter() {
                let thread_pool = AsyncComputeTaskPool::get();
                let $ev = ev.clone();
                let task = thread_pool.spawn(async move {
                    $func
                });
                commands.spawn($call_type(task));
            }
        }
    };

    ($call_event_type:ty, $call_type:expr, |$ev:ident, $no:ident| $func:expr) => {
        pub fn start_call(
            mut commands: Commands,
            mut start_ev_r: EventReader<$call_event_type>,
            no: Res<NetworkingOptions>
        ) {
            for ev in start_ev_r.iter() {
                let thread_pool = AsyncComputeTaskPool::get();
                let $ev = ev.clone();
                let mut $no = no.clone();
                let task = thread_pool.spawn(async move {
                    $func
                });
                commands.spawn($call_type(task));
            }
        }
    };
}

#[macro_export]
macro_rules! async_task_handle_call {
    ($call_type:ty, |$response:ident| $handler_func:expr) => {
        pub fn handle_call(
            mut commands: Commands,
            mut tasks: Query<(Entity, &mut $call_type)>,
        ) {
            match tasks.get_single_mut() {
                Ok((entity, mut task)) => {
                    if let Some($response) = future::block_on(future::poll_once(&mut task.0)) {
                        $handler_func;

                        // remove the task
                        commands.entity(entity).remove::<$call_type>();
                        commands.entity(entity).despawn_recursive();
                    }
                }
                // NOTE: don't do anything if the wanted thingy doesn't exist
                _ => {}
            }
        }
    };

    ($call_type:ty, |$response:ident, $menu_data:ident| $handler_func:expr) => {
        pub fn handle_call(
            mut commands: Commands,
            mut tasks: Query<(Entity, &mut $call_type)>,
            mut $menu_data: ResMut<MenuData>,
        ) {
            match tasks.get_single_mut() {
                Ok((entity, mut task)) => {
                    if let Some($response) = future::block_on(future::poll_once(&mut task.0)) {
                        $handler_func;

                        // remove the task
                        commands.entity(entity).remove::<$call_type>();
                        commands.entity(entity).despawn_recursive();
                    }
                }
                // NOTE: don't do anything if the wanted thingy doesn't exist
                _ => {}
            }
        }
    };

}

A client/src/macros/mod.rs => client/src/macros/mod.rs +31 -0
@@ 0,0 1,31 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

mod async_task;

/*
use crate::{async_task_start_call, async_task_handle_call};

use bevy::{prelude::*, tasks::{Task, AsyncComputeTaskPool}};
use futures_lite::future;

struct SomeResponse {}

#[derive(Component)]
struct SomeCall(Task<SomeResponse>);

struct SomeCallEvent;

async_task_start_call!(SomeCallEvent, SomeCall, {
    SomeResponse {}
});

async_task_handle_call!(SomeCall, {

});
*/

M client/src/main.rs => client/src/main.rs +23 -0
@@ 10,6 10,8 @@ use bevy::prelude::*;
use bevy_editor_pls::EditorPlugin;
use bevy_egui::EguiPlugin;

mod api;
mod macros;
mod util;

mod plugins;


@@ 47,6 49,16 @@ fn main() {
    // add the top level app state
    app.add_state::<AppState>();

    // holds networking options and a request agent
    app.insert_resource(NetworkingOptions {
        api_address: "http://localhost:8080/api".to_string(),
        req: reqwest::blocking::Client::new(),
        user_token: "".to_string(),
    });

    // has handlers for all async tasks
    app.add_plugin(plugins::AsyncTasksPlugin);

    app.add_plugin(plugins::MenuPlugin);

    app.add_startup_system(setup);


@@ 59,3 71,14 @@ fn setup(mut commands: Commands) {
    let camera_bundle = Camera3dBundle::default();
    commands.spawn(camera_bundle);
}

#[derive(Clone, Resource)]
pub struct NetworkingOptions {
    /// api address with no trailing slash
    api_address: String,
    /// reqwest agent
    /// NOTE: mainly for the future, because it can hold cookies
    req: reqwest::blocking::Client,
    /// feels wrong storing this here but "it's temporary"
    user_token: String,
}

A client/src/plugins/async_tasks/mod.rs => client/src/plugins/async_tasks/mod.rs +33 -0
@@ 0,0 1,33 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;

mod req_login;
pub use req_login::LoginCallEvent;

mod req_register;
pub use req_register::RegisterCallEvent;

pub struct AsyncTasksPlugin;

impl Plugin for AsyncTasksPlugin {
    fn build(&self, app: &mut App) {
        app
            .add_event::<LoginCallEvent>()
            .add_event::<RegisterCallEvent>()
            .add_systems(
            (
                req_login::start_call,
                req_login::handle_call,
                req_register::start_call,
                req_register::handle_call,
            ).chain()
        );
    }
}

A client/src/plugins/async_tasks/req_login.rs => client/src/plugins/async_tasks/req_login.rs +41 -0
@@ 0,0 1,41 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use crate::{
    async_task_start_call, async_task_handle_call,
    api::{self, user::LoginResponse}, NetworkingOptions,
    plugins::{menu::MenuData, MenuUIState},
};

use bevy::{prelude::*, tasks::{Task, AsyncComputeTaskPool}};
use futures_lite::future;

#[derive(Component)]
pub struct LoginCall(Task<LoginResponse>);

#[derive(Clone)]
pub struct LoginCallEvent {
    pub email: String,
    pub password: String,
}

async_task_start_call!(LoginCallEvent, LoginCall, |ev, no| {
    let res = api::user::login(&mut no, &ev.email, &ev.password);

    res
});

async_task_handle_call!(LoginCall, |response, menu_data| {
    match response {
        Err(_err) => panic!("login failed, handle me"),
        Ok(resp) => {
            info!("logged in {}", resp.username);
            menu_data.ui_state = MenuUIState::Main;
        }
    }
});

A client/src/plugins/async_tasks/req_register.rs => client/src/plugins/async_tasks/req_register.rs +42 -0
@@ 0,0 1,42 @@
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use crate::{
    async_task_start_call, async_task_handle_call,
    api::{self, user::RegisterResponse}, NetworkingOptions,
    plugins::{menu::MenuData, MenuUIState},
};

use bevy::{prelude::*, tasks::{Task, AsyncComputeTaskPool}};
use futures_lite::future;

#[derive(Component)]
pub struct RegisterCall(Task<RegisterResponse>);

#[derive(Clone)]
pub struct RegisterCallEvent {
    pub username: String,
    pub email: String,
    pub password: String,
}

async_task_start_call!(RegisterCallEvent, RegisterCall, |ev, no| {
    let res = api::user::register(&mut no, &ev.username, &ev.email, &ev.password);

    res
});

async_task_handle_call!(RegisterCall, |response, menu_data| {
    match response {
        Err(_err) => panic!("register failed, handle me"),
        Ok(resp) => {
            info!("registered {}", resp.username);
            menu_data.ui_state = MenuUIState::Main;
        }
    }
});

M client/src/plugins/menu/mod.rs => client/src/plugins/menu/mod.rs +2 -1
@@ 32,7 32,7 @@ enum MenuState {

#[derive(Resource)]
pub struct MenuData {
    ui_state: MenuUIState,
    pub ui_state: MenuUIState,

    error: String,



@@ 68,6 68,7 @@ pub enum MenuUIState {
    Loading, // for waiting for requests to finish
    Login,
    Register,
    Main,

}


M client/src/plugins/menu/ui/login.rs => client/src/plugins/menu/ui/login.rs +11 -3
@@ 6,13 6,18 @@
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;
use bevy_egui::egui;

use crate::util::egui::password;
use crate::{util::egui::password, plugins::LoginCallEvent};

use super::{MenuData, MenuUIState};

pub fn view(ui: &mut egui::Ui, data: &mut MenuData) {
pub fn view(
    ui: &mut egui::Ui,
    data: &mut MenuData,
    login_ev_w: &mut EventWriter<LoginCallEvent>,
) {
    ui.horizontal(|ui| {
        ui.label("Email:");
        ui.text_edit_singleline(&mut data.login_email)


@@ 31,7 36,10 @@ pub fn view(ui: &mut egui::Ui, data: &mut MenuData) {
            data.error.clear();
            data.ui_state = MenuUIState::Loading;

            // use dem fields to do stuff
            login_ev_w.send(LoginCallEvent {
                email: data.login_email.clone(),
                password: data.login_password.clone(),
            });
        }
    });


M client/src/plugins/menu/ui/mod.rs => client/src/plugins/menu/ui/mod.rs +12 -5
@@ 9,12 9,19 @@
use bevy::prelude::*;
use bevy_egui::{EguiContexts, egui};

use crate::plugins::{LoginCallEvent, RegisterCallEvent};

pub use super::{MenuData, MenuUIState};

mod login;
mod register;

pub fn ui(mut contexts: EguiContexts, mut data: ResMut<MenuData>) {
pub fn ui(
    mut contexts: EguiContexts,
    mut data: ResMut<MenuData>,
    mut login_ev_w: EventWriter<LoginCallEvent>,
    mut register_ev_w: EventWriter<RegisterCallEvent>,
) {
    egui::Window::new(format!("{:?}", data.ui_state))
        .collapsible(false)
        .resizable(false)


@@ 27,10 34,10 @@ pub fn ui(mut contexts: EguiContexts, mut data: ResMut<MenuData>) {
                    ui.label("something may or may not be happening");
                });
            }
            MenuUIState::Login => login::view(ui, &mut data),
            MenuUIState::Register => register::view(ui, &mut data),
            _ => {
                ui.spinner();
            MenuUIState::Login => login::view(ui, &mut data, &mut login_ev_w),
            MenuUIState::Register => register::view(ui, &mut data, &mut register_ev_w),
            MenuUIState::Main => {
                ui.label("main menu");
            }
        }
    });

M client/src/plugins/menu/ui/register.rs => client/src/plugins/menu/ui/register.rs +12 -3
@@ 6,13 6,18 @@
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;
use bevy_egui::egui;

use crate::util::egui::password;
use crate::{util::egui::password, plugins::RegisterCallEvent};

use super::{MenuData, MenuUIState};

pub fn view(ui: &mut egui::Ui, data: &mut MenuData) {
pub fn view(
    ui: &mut egui::Ui,
    data: &mut MenuData,
    register_ev_w: &mut EventWriter<RegisterCallEvent>,
) {
    ui.horizontal(|ui| {
        ui.label("Username:");
        ui.text_edit_singleline(&mut data.register_username)


@@ 40,7 45,11 @@ pub fn view(ui: &mut egui::Ui, data: &mut MenuData) {
                data.error.clear();
                data.ui_state = MenuUIState::Loading;

                // do stuff with fields
                register_ev_w.send(RegisterCallEvent {
                    username: data.register_username.clone(),
                    email: data.register_email.clone(),
                    password: data.register_password.clone(),
                });
            }
        });
    });

M client/src/plugins/mod.rs => client/src/plugins/mod.rs +2 -0
@@ 9,3 9,5 @@
mod menu;
pub use menu::*;

mod async_tasks;
pub use async_tasks::*;