From fe3b47655663077694ffdce307dc7100bfb081cd Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 15 Jan 2024 11:42:12 -0700 Subject: [PATCH] Initial commit --- .gitignore | 1 + Cargo.lock | 899 ++++++++++++++++++++++++++++++++++++++ Cargo.toml | 15 + build.rs | 5 + proto/announcement.proto | 15 + proto/award.proto | 113 +++++ proto/display.proto | 100 +++++ proto/division.proto | 32 ++ proto/elim.proto | 79 ++++ proto/event.proto | 128 ++++++ proto/fieldhw.proto | 121 +++++ proto/game.proto | 146 +++++++ proto/match.proto | 145 ++++++ proto/mobile.proto | 34 ++ proto/netcomm.proto | 93 ++++ proto/notice.proto | 123 ++++++ proto/publish.proto | 40 ++ proto/rankings.proto | 35 ++ proto/schedule.proto | 23 + proto/sidechallenge.proto | 31 ++ proto/team.proto | 63 +++ proto/textmessage.proto | 25 ++ src/main.rs | 100 +++++ 23 files changed, 2366 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 build.rs create mode 100644 proto/announcement.proto create mode 100644 proto/award.proto create mode 100644 proto/display.proto create mode 100644 proto/division.proto create mode 100644 proto/elim.proto create mode 100644 proto/event.proto create mode 100644 proto/fieldhw.proto create mode 100644 proto/game.proto create mode 100644 proto/match.proto create mode 100644 proto/mobile.proto create mode 100644 proto/netcomm.proto create mode 100644 proto/notice.proto create mode 100644 proto/publish.proto create mode 100644 proto/rankings.proto create mode 100644 proto/schedule.proto create mode 100644 proto/sidechallenge.proto create mode 100644 proto/team.proto create mode 100644 proto/textmessage.proto create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..90eb33d --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,899 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "protoc" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" +dependencies = [ + "log", + "which", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "rumqttc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8941c6791801b667d52bfe9ff4fc7c968d4f3f9ae8ae7abdaaa1c966feafc8" +dependencies = [ + "bytes", + "flume", + "futures-util", + "log", + "rustls-native-certs", + "rustls-pemfile", + "rustls-webpki", + "thiserror", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "vex_mqtt_rust" +version = "0.1.0" +dependencies = [ + "prost", + "prost-build", + "prost-types", + "protoc", + "rumqttc", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..024db45 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "vex_mqtt_rust" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[build-dependencies] +protoc = "2.28.0" +prost-build = "0.12.3" + +[dependencies] +prost = "0.12.3" +prost-types = "0.12.3" +rumqttc = "0.23.0" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..30e9637 --- /dev/null +++ b/build.rs @@ -0,0 +1,5 @@ +extern crate prost_build; + +fn main() { + prost_build::compile_protos(&["proto/notice.proto"], &["proto/"]).unwrap(); +} diff --git a/proto/announcement.proto b/proto/announcement.proto new file mode 100644 index 0000000..ecceee7 --- /dev/null +++ b/proto/announcement.proto @@ -0,0 +1,15 @@ +syntax = "proto2"; + +package tm; + +import "division.proto"; +message Announcement { + optional string msg = 1; + optional .Division.DivisionId divId = 2 [default = ALL]; + optional uint32 endTime = 3 [default = 0]; + optional uint32 group = 4 [default = 0]; +} + +message AnnouncementList { + repeated tm.Announcement announcements = 1; +} diff --git a/proto/award.proto b/proto/award.proto new file mode 100644 index 0000000..53b404f --- /dev/null +++ b/proto/award.proto @@ -0,0 +1,113 @@ +syntax = "proto2"; + +package tm; + +import "team.proto"; +import "division.proto"; +message DivisionAward { + optional tm.Division division = 1; + optional bool givenAtEvent = 2 [default = true]; + optional tm.TeamInfo team = 3; + optional string recipient = 4; + optional string description = 5; +} + +message Award { + enum AwardType { + TEAM = 1; + INDIVIDUAL = 2; + NONE = 3; + CLUB = 4; + } + optional int32 id = 1; + optional tm.Award.AwardType type = 2 [default = NONE]; + optional string name = 3; + optional bool isUserDefined = 4 [default = false]; + optional uint32 sortOrder = 5 [default = 0]; + repeated tm.DivisionAward divAwards = 6; + optional int32 robotEventsId = 7 [default = 0]; +} + +message AwardList { + repeated tm.Award awards = 1; +} + +message AwardReference { + optional int32 awardId = 1; + optional int32 divisionId = 2; +} + +message DisplaySlide { + message Alliance { + enum AllianceEnum { + NO_ALLIANCE = 0; + WINNER = 1; + FINALIST1 = 2; + FINALIST2 = 3; + RUNNER_UP = 4; + SEED_1 = 5; + SEED_2 = 6; + SEED_3 = 7; + SEED_4 = 8; + SEED_5 = 9; + SEED_6 = 10; + SEED_7 = 11; + SEED_8 = 12; + SEED_9 = 13; + SEED_10 = 14; + } + optional string name = 1; + optional tm.DisplaySlide.Alliance.AllianceEnum id = 2; + optional int32 divisionId = 3; + } + message Speaker { + optional string name = 1; + optional string title = 2; + optional string org = 3; + } + message Custom { + optional string OBSOLETE_line1 = 1; + optional string OBSOLETE_line2 = 2; + repeated string data = 3; + } + enum SlideType { + NONE = 0; + INTRO = 1; + SINGLE_AWARD = 2; + SINGLE_AWARD_MULTIPLE_DIVISIONS = 3; + MULTIPLE_AWARDS = 4; + ELIM_ALLIANCE = 5; + SPEAKER = 6; + MULTIPLE_SPEAKERS = 7; + IMAGE = 8; + SEPARATOR = 9; + CUSTOM_SINGLE_AWARD = 10; + CUSTOM_MULTIPLE_AWARDS = 11; + } + enum LogoSelectMode { + LOGO_MODE_AUTO = 0; + LOGO_MODE_VRC = 1; + LOGO_MODE_VIQ = 2; + LOGO_MODE_WORLDS = 3; + LOGO_MODE_VEXU = 4; + LOGO_MODE_RADC = 5; + LOGO_MODE_BELL = 6; + } + optional int32 id = 1; + optional uint32 sortOrder = 2 [default = 0]; + optional tm.DisplaySlide.SlideType type = 3 [default = NONE]; + optional string title = 4; + optional bool overlay = 5 [default = true]; + repeated tm.AwardReference awards = 6; + optional tm.DisplaySlide.Alliance alliance = 7; + repeated tm.DisplaySlide.Speaker speakers = 8; + optional bytes image = 9; + optional int32 winnerId = 10; + repeated tm.DisplaySlide.Custom customInfo = 11; + optional bool useCustomSlideTitle = 12 [default = false]; + optional tm.DisplaySlide.LogoSelectMode logoSelectMode = 13 [default = LOGO_MODE_AUTO]; +} + +message DisplaySlideList { + repeated tm.DisplaySlide slides = 1; +} diff --git a/proto/display.proto b/proto/display.proto new file mode 100644 index 0000000..e130f87 --- /dev/null +++ b/proto/display.proto @@ -0,0 +1,100 @@ +syntax = "proto2"; + +package tm; + +import "fieldhw.proto"; +import "division.proto"; +message PitDisplay { + optional string name = 1; + optional int32 id = 2 [default = -1]; + optional tm.Division division = 3; + optional tm.DisplayState.ScreenType defaultScreen = 4 [default = RANKINGS]; +} + +message PitDisplayList { + repeated tm.PitDisplay displays = 1; +} + +message DisplayState { + enum DisplayType { + AUDIENCE = 1; + PIT = 2; + FIELD = 3; + } + enum ScreenType { + BLANK = 1; + INTRO = 2; + IN_MATCH = 3; + RESULTS = 4; + RANKINGS = 5; + LOGO = 6; + ALLIANCE_SELECTION = 7; + BRACKET = 8; + SC_RANKINGS = 9; + SC_RESULTS = 10; + FIELD_QUEUE = 11; + AWARD = 12; + SCHEDULE = 13; + ALLIANCE_SELECTION_16 = 14; + INSPECTION = 15; + ROUND_ROBIN_RANKINGS = 16; + OBSOLETE_DRIVER_SKILLS_RANKINGS = 17; + OBSOLETE_PROG_SKILLS_RANKINGS = 18; + PIT_QUEUE = 19; + IQ_WILDCARD = 20; + IQ_COMBINED_FINALS_RANKINGS = 21; + VEX_LOGO = 22; + DIV_RANKINGS = 23; + } + enum BracketOptions { + TOP8 = 1; + TOP16 = 2; + BOT16 = 3; + R32_1 = 4; + R32_2 = 5; + R32_3 = 6; + R32_4 = 7; + R64_1 = 8; + R64_2 = 9; + R64_3 = 10; + R64_4 = 11; + R64_5 = 12; + R64_6 = 13; + R64_7 = 14; + R64_8 = 15; + R128_1 = 16; + R128_2 = 17; + R128_3 = 18; + R128_4 = 19; + R128_5 = 20; + R128_6 = 21; + R128_7 = 22; + R128_8 = 23; + R128_9 = 24; + R128_10 = 25; + R128_11 = 26; + R128_12 = 27; + R128_13 = 28; + R128_14 = 29; + R128_15 = 30; + R128_16 = 31; + } + enum AutoWinnerOptions { + NO_AUTO_WINNER = 1; + RED = 2; + BLUE = 3; + } + enum SkillsRankingsMode { + SKILLS_RANK_STANDARD = 1; + SKILLS_RANK_FINALS = 2; + } + required tm.DisplayState.DisplayType displayType = 1; + optional tm.DisplayState.ScreenType screen = 2 [default = BLANK]; + optional tm.Division division = 3; + optional tm.Field field = 4; + optional int32 pitDisplayId = 5; + optional tm.DisplayState.BracketOptions bracketOpt = 10 [default = TOP8]; + optional tm.DisplayState.AutoWinnerOptions obsolete_winner = 11 [default = NO_AUTO_WINNER]; + optional tm.DisplayState.SkillsRankingsMode skillsRankingsMode = 12 [default = SKILLS_RANK_STANDARD]; + optional bool triggerUpdate = 13 [default = false]; +} diff --git a/proto/division.proto b/proto/division.proto new file mode 100644 index 0000000..8ebe5fa --- /dev/null +++ b/proto/division.proto @@ -0,0 +1,32 @@ +syntax = "proto2"; + +package tm; + +message Division { + enum DivisionId { + ALL = 0; + DIV1 = 1; + DIV2 = 2; + DIV3 = 3; + DIV4 = 4; + DIV5 = 5; + DIV6 = 6; + DIV7 = 7; + DIV8 = 8; + ELIM = 100; + DEFAULT = 200; + } + enum DivisionMatchType { + QUAL_RANDOM = 1; + QUAL_ROUND_ROBIN = 2; + ELIMINATION = 3; + } + optional string name = 1; + optional bool enabled = 2; + optional uint32 id = 3; + optional tm.Division.DivisionMatchType matchType = 5 [default = QUAL_RANDOM]; +} + +message DivisionList { + repeated tm.Division divisions = 1; +} diff --git a/proto/elim.proto b/proto/elim.proto new file mode 100644 index 0000000..88e64a7 --- /dev/null +++ b/proto/elim.proto @@ -0,0 +1,79 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +import "fieldhw.proto"; +enum UnavailableReason { + UNAVAIL_DECLINED = 1; + UNAVAIL_INELIGIBLE = 2; +} + +message ElimTeam { + optional string teamNum = 1; + optional int32 position = 2; + optional int32 id = 3; +} + +message ElimAlliance { + optional int32 allianceId = 1; + optional int32 division = 2; + repeated tm.ElimTeam teams = 3; + optional int32 wins = 4; + optional tm.MatchRound round = 5; + optional int32 instance = 6; + optional string name = 7; +} + +message ElimAllianceList { + repeated tm.ElimAlliance alliances = 1; +} + +message UnavailableTeam { + optional string teamNum = 1; + optional tm.UnavailableReason reason = 2; +} + +message UnavailableTeams { + repeated tm.UnavailableTeam teams = 1; + optional int32 division = 2; +} + +message ElimBracketNodeAlliance { + optional int32 seed = 1; + optional int32 wins = 2; + optional int32 childInstance = 3; +} + +message ElimBracketNodeData { + optional tm.MatchTuple matchTuple = 1; + repeated tm.ElimBracketNodeAlliance alliances = 2; + optional int32 matchesPlayed = 3; +} + +message ElimAllianceSelectionMode { + enum SelectionMode { + NORMAL = 1; + SERPENTINE = 2; + MANUAL = 3; + } + optional tm.ElimAllianceSelectionMode.SelectionMode mode = 1; +} + +message ElimAllianceUnbalancedMode { + enum UnbalancedMode { + OFF = 1; + LOW_SEED = 2; + HIGH_SEED = 3; + } + optional tm.ElimAllianceUnbalancedMode.UnbalancedMode mode = 1 [default = OFF]; +} + +message ElimQueueItem { + optional tm.MatchTuple matchTuple = 1; + optional tm.Field field = 2; +} + +message ElimQueueList { + repeated tm.ElimQueueItem items = 1; +} diff --git a/proto/event.proto b/proto/event.proto new file mode 100644 index 0000000..6915bd4 --- /dev/null +++ b/proto/event.proto @@ -0,0 +1,128 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +message EventConfig { + enum TournamentType { + SINGLE_ELIMINATION = 1; + DOUBLE_ELIMINATION = 2; + } + enum EventState { + UNCONFIGURED = 0; + QUALIFICATION = 1; + ALLIANCE_SELECTION = 2; + ELIMINATION = 3; + TOP_N_FINALS = 4; + } + enum AvailTeamSortOrder { + RANK = 1; + TEAM_NUMBER = 2; + } + enum WizardMode { + WIZARD_MODE_MINI = 1; + WIZARD_MODE_SMALL = 2; + WIZARD_MODE_MEDIUM = 3; + WIZARD_MODE_LARGE = 4; + WIZARD_MODE_SCHEDULE = 5; + } + optional string eventName = 1; + optional uint32 teamsPerAlliance = 2; + optional uint32 alliancesPerMatch = 3; + optional uint32 numElimAlliances = 4; + optional uint32 numElimTeams = 5; + optional uint32 elimWinsToAdvance = 6; + optional tm.EventConfig.TournamentType tournamentType = 7; + optional tm.EventConfig.EventState eventState = 8; + optional bool configured = 9; + optional tm.EventConfig.AvailTeamSortOrder availTeamSortOrder = 10 [default = RANK]; + optional uint32 qualMatchesPerTeamToCount = 11; + optional string backendVer = 12; + optional string password = 13; + optional string uuid = 14; + optional bool leagueMode = 15 [default = false]; + optional uint32 leaguePctMatches = 16; + optional uint32 numTopNAlliances = 17; + optional string judgePassword = 18; + optional tm.EventConfig.WizardMode wizardMode = 19; + optional int32 maxNumSkillsScores = 20; + optional bool excludeMissingTeamsFromSchedule = 21 [default = false]; + optional string inspectorPassword = 22; + optional string scorekeeperPassword = 23; +} + +message GameSound { + optional string state = 1; + optional string cause = 2; + optional string fileName = 3; +} + +message ScoringConfig { + optional string xmlInterfaceData = 1; + optional string allianceScoreFormula = 2; + optional string gameName = 4 [default = "Unknown"]; + optional uint32 version = 5 [default = 0]; + repeated string constraints = 6; + repeated tm.GameSound sounds = 7; + repeated string skillsRankSorts = 8; + optional string skillsScoreFormula = 9; + repeated string qualRankSorts = 10; + optional bytes tmg2Data = 11; +} + +message SponsorLogo { + optional uint32 id = 1; + required string name = 2; + required bytes data = 3; + optional int32 width = 4 [default = -1]; + optional int32 height = 5 [default = -1]; +} + +message SponsorLogos { + enum LogoType { + LARGE = 1; + SMALL = 2; + } + repeated tm.SponsorLogo logos = 1; + repeated tm.SponsorLogo smallLogos = 2; +} + +message Session { + optional uint32 id = 1; + optional string uuid = 2; + optional string name = 3; + optional uint32 startDate = 4; + optional uint32 endDate = 5; +} + +message SessionList { + repeated tm.Session sessions = 1; +} + +message OfficialEventConfig { + optional bool officialEvent = 1; + optional string robotEventsCode = 2; + optional string tmCode = 3; + optional bool tmCodeValidated = 4; + optional bool textMessagingEnabled = 5; +} + +message ElimWinsToAdvance { + optional int32 division = 1; + optional tm.MatchRound round = 2; + optional uint32 numWins = 3; +} + +message ElimWinsToAdvanceList { + repeated tm.ElimWinsToAdvance elimWinsToAdvance = 1; +} + +message CustomElimBracket { + optional int32 division = 1; + optional uint32 seed = 2; + optional tm.MatchRound round = 3; +} + +message CustomElimBracketList { + repeated tm.CustomElimBracket customElimBracket = 1; +} diff --git a/proto/fieldhw.proto b/proto/fieldhw.proto new file mode 100644 index 0000000..fdba858 --- /dev/null +++ b/proto/fieldhw.proto @@ -0,0 +1,121 @@ +syntax = "proto2"; + +package tm; + +import "division.proto"; +message FieldHwState { + enum FieldState { + DISABLED = 0; + ENABLED = 1; + AUTO = 2; + DRIVER = 3; + TIMEOUT = 4; + } + enum FieldCause { + NONE = 0; + MATCH_STARTED = 1; + MATCH_ENDED = 2; + MATCH_PAUSED = 3; + MATCH_RESUMED = 4; + MATCH_ENDED_EARLY = 5; + MATCH_ABORTED = 6; + TRANSITIONED = 7; + } + optional tm.Field field = 1; + optional tm.FieldHwState.FieldState state = 2 [default = DISABLED]; + optional tm.FieldHwState.FieldCause cause = 3 [default = NONE]; +} + +message Field { + optional string name = 1; + optional int32 id = 2; + optional int32 fieldSetId = 3; +} + +message FieldSet { + enum FieldSetType { + USER_DEFINED = 1; + SIDE_CHALLENGE = 2; + } + optional string name = 1; + repeated tm.Field fields = 3; + optional int32 id = 4; + optional tm.FieldSet.FieldSetType type = 5 [default = USER_DEFINED]; +} + +message FieldSetList { + repeated tm.FieldSet fieldSets = 1; +} + +message MatchTimeSchedEntry { + enum BlockType { + TIMER_ONLY = 1; + AUTONOMOUS = 2; + DRIVER_CTRL = 3; + PAUSE = 4; + } + optional int32 seconds = 1; + optional tm.MatchTimeSchedEntry.BlockType type = 2; + optional string name = 3; +} + +message MatchTimeSchedList { + enum MatchType { + NORMAL = 1; + AUTO_CHALLENGE = 2; + DRIVER_CHALLENGE = 3; + } + repeated tm.MatchTimeSchedEntry entries = 1; + optional tm.MatchTimeSchedList.MatchType matchType = 2; +} + +message FieldTime { + optional tm.Field field = 1; + optional tm.MatchTimeSchedList blockList = 2; + optional int32 currentBlock = 3; + optional double currentBlockStart = 4; + optional double currentBlockEnd = 5; +} + +message AssignedObjectType { + enum AssignedObjectEnum { + MATCH = 1; + SC = 2; + TIME_OUT = 3; + } +} + +message FieldControlTeamStatus { + enum State { + READY = 1; + ERROR = 2; + NO_CONNECTION = 3; + } + enum ErrorCondition { + NO_FIELD_CONNECTION = 1; + PARTNER_CONNECTED = 2; + BAD_RADIO_TYPE = 3; + NO_RADIO_LINK = 4; + BAD_CONTROLLER_FW = 5; + BAD_BRAIN_FW = 6; + BAD_CONTROLLER_RADIO_FW = 7; + BAD_BRAIN_RADIO_FW = 8; + USER_PGM_NOT_RUNNING = 9; + NOT_COMP_CHANNEL = 10; + NOT_SMARTFIELD = 11; + } + optional tm.FieldControlTeamStatus.State state = 1; + optional tm.FieldControlTeamStatus.ErrorCondition err = 2; + optional string details = 3; + optional string teamNum = 4; +} + +message FieldControlStatus { + enum State { + INVALID = 0; + INACTIVE = 1; + ACTIVE = 2; + } + optional tm.FieldControlStatus.State state = 1; + repeated tm.FieldControlTeamStatus teams = 2; +} diff --git a/proto/game.proto b/proto/game.proto new file mode 100644 index 0000000..40881bc --- /dev/null +++ b/proto/game.proto @@ -0,0 +1,146 @@ +syntax = "proto2"; + +package tm; + +message GameWrapper { + optional bytes data = 1; + optional bytes auth = 2; +} + +message TournamentRound { + enum RoundType { + RANDOM_MATCHES = 1; + SINGLE_ELIM_WIN_2 = 2; + ROUND_ROBIN = 3; + TOP_N = 4; + } + enum RankingType { + NO_RANKINGS = 1; + WP_SP = 2; + WIN_PCT_WP_SP = 3; + TOTAL_PTS_3_OF_4 = 4; + TOTAL_PTS_PREV_ROUND = 5; + WP_HEADTOHEAD_TOT_PTS = 6; + AVG_SCORE_HIGH_SCORES = 7; + AVG_PTS_3_OF_4 = 8; + WP_AP_SP = 9; + WIN_PCT_WP_AP_SP = 10; + TOTAL_PTS_WP = 11; + AVG_WP_AP_SP = 12; + AVG_WP_AVG_SCORE_HIGH_SCORES = 13; + } + optional tm.TournamentRound.RoundType type = 1; + optional uint32 numTeams = 2; + optional string displayName = 3; + optional uint32 roundNum = 4; + optional uint32 teamsPerAlliance = 5 [default = 2]; + optional uint32 alliancesPerMatch = 6 [default = 2]; + optional tm.Game.Scoring scoring = 7; + optional tm.TournamentRound.RankingType rankings = 8 [default = NO_RANKINGS]; + repeated tm.Game.MatchTimeEntry matchTimes = 9; + repeated tm.Game.MatchSound sounds = 10; + optional tm.TournamentRound.RankingType leagueRankings = 11 [default = NO_RANKINGS]; +} + +message Game { + message Scoring { + optional string matchScoreFormula = 1; + optional string allianceScoreFormula = 2; + optional string teamScoreFormula = 3; + repeated string scoringConstraints = 4; + optional string apFormula = 10; + optional string wpFormula = 11; + optional string spFormula = 12; + optional string awpFormula = 13; + } + message MatchTimeEntry { + enum BlockType { + TIMER_ONLY = 1; + AUTONOMOUS = 2; + DRIVER_CTRL = 3; + PAUSE = 4; + } + optional int32 seconds = 1; + optional tm.Game.MatchTimeEntry.BlockType type = 2; + optional string name = 3; + } + message MatchSound { + optional string state = 1; + optional string cause = 2; + optional string fileName = 3; + optional uint32 timeLeft = 4; + } + message ScoreObject { + required string name = 1; + required int32 val = 2; + } + message Skills { + message Ranking { + enum Type { + HIGH_SCORES = 1; + HIGH_SCORE_FORMULA = 2; + TOTAL_POINTS_RECURSIVE = 3; + } + optional tm.Game.Skills.Ranking.Type type = 1; + optional string formula = 2; + } + enum SkillsType { + PROGRAMMING = 1; + DRIVER = 2; + } + optional uint32 obsolete_robotSkillsDuration = 1 [default = 60]; + optional uint32 obsolete_progSkillsDuration = 2 [default = 60]; + optional tm.Game.Scoring scoring = 3; + repeated tm.Game.Skills.Ranking rankings = 4; + optional string name = 5; + repeated tm.Game.MatchTimeEntry skillsTimes = 9; + repeated tm.Game.MatchSound sounds = 10; + optional tm.Game.Skills.SkillsType skillsType = 11; + } + message SkillsRanking { + enum RankingType { + COMBINED_HIGH_SCORES = 1; + ALTERNATING_HIGH_SCORES = 2; + HIGH_SCORE_FORMULA = 3; + ALTERNATING_HIGH_SCORES_LIMIT_2 = 4; + STOP_TIME_SUM_FROM_HIGH_SCORE_MATCHES = 5; + STOP_TIME_FROM_HIGH_SCORE_MATCH = 6; + ALTERNATING_HIGH_SCORES_THIRD = 7; + STOP_TIME_SUM_FROM_SECOND_HIGHEST_SCORE_MATCHES = 8; + STOP_TIME_SUM_FROM_THIRD_HIGHEST_SCORE_MATCHES = 9; + SUM_THREE_DRIVER_ONE_PROGRAMMING = 10; + } + enum SkillsType { + PROGRAMMING = 1; + DRIVER = 2; + } + optional tm.Game.SkillsRanking.RankingType rankingType = 1; + optional tm.Game.SkillsRanking.SkillsType skillsType = 2; + optional string formula = 3; + } + enum VexProgram { + VRC = 10; + VEXU = 20; + VEXIQ = 30; + VEXAI = 40; + RADC = 50; + BELL = 60; + TSA = 100; + } + optional uint32 apiVersion = 1 [default = 1]; + optional string uuid = 2; + optional uint32 version = 3; + optional tm.Game.VexProgram program = 4; + optional string name = 5; + optional string season = 6; + repeated tm.Game.MatchSound defaultSounds = 7; + optional tm.Game.Scoring defaultScoring = 8; + repeated tm.Game.MatchTimeEntry defaultMatchTimes = 9; + repeated tm.TournamentRound rounds = 10; + repeated tm.Game.Skills skills = 11; + optional bytes interfaceXml = 12; + repeated tm.Game.SkillsRanking skillsRankings = 13; + repeated tm.Game.ScoreObject skillsInitialObjectStates = 14; +} + + diff --git a/proto/match.proto b/proto/match.proto new file mode 100644 index 0000000..545e133 --- /dev/null +++ b/proto/match.proto @@ -0,0 +1,145 @@ +syntax = "proto2"; + +package tm; + +import "fieldhw.proto"; +enum MatchRound { + NONE = 0; + PRACTICE = 1; + QUAL = 2; + QF = 3; + SF = 4; + F = 5; + R16 = 6; + R32 = 7; + R64 = 8; + R128 = 9; + TOP_N = 15; + ROUND_ROBIN = 16; + PRE_ELIM = 20; + ELIM = 21; +} + +enum MatchState { + UNPLAYED = 0; + QUEUED = 1; + ON_DECK = 2; + ACTIVE = 3; + SCORED = 4; + SUBMITTED = 5; +} + +message MatchTuple { + optional int32 division = 1; + optional tm.MatchRound round = 2; + optional int32 instance = 3; + optional int32 match = 4; + optional int32 session = 5 [default = 0]; +} + +message AllianceTeamInfo { + enum RoleEnum { + NORMAL = 1; + SURROGATE = 2; + CAPTAIN = 3; + PICK = 4; + } + optional string number = 1; + optional tm.AllianceTeamInfo.RoleEnum role = 2 [default = NORMAL]; + optional string name = 3; + optional string location = 4; + optional int32 round = 5 [default = 0]; + optional int32 id = 6; +} + +message AllianceInfo { + repeated tm.AllianceTeamInfo teams = 1; + optional string name = 2; +} + +message MatchInfo { + optional tm.MatchTuple matchTuple = 1; + repeated tm.AllianceInfo alliances = 2; + optional uint32 timeScheduled = 3; + optional tm.Field assignedField = 4; + optional tm.MatchState state = 5; + optional uint32 timeStarted = 6; + optional uint32 timeResumed = 7; + optional uint32 elimOrder = 8; +} + +message MatchSchedule { + optional int32 division = 1; + optional tm.MatchRound round = 2; + repeated tm.MatchInfo matches = 3; +} + +message MatchList { + optional int32 division = 1; + repeated tm.MatchTuple matches = 2; +} + +message ScoreObject { + required string name = 1; + required int32 val = 2; +} + +message TeamScore { + optional int32 id = 1; + optional bool dq = 2; + optional bool noShow = 3; + optional bool sitting = 4; + optional string teamNum = 5; + repeated tm.ScoreObject scoreTypes = 6; +} + +message AllianceScore { + optional int32 id = 1; + repeated tm.TeamScore teams = 3; + optional int32 place = 4; + repeated tm.ScoreObject scoreTypes = 5; + optional string name = 6; +} + +message MatchScore { + optional tm.MatchTuple matchTuple = 1; + repeated tm.AllianceScore alliances = 2; + optional tm.MatchState state = 3 [default = UNPLAYED]; + repeated tm.ScoreObject scoreTypes = 4; + optional string gameUuid = 5; + optional int32 timeSaved = 6; +} + +message MatchScoreList { + repeated tm.MatchScore scores = 1; +} + +message RescoreStatus { + enum RescoreStatusEnum { + ALLOWED = 1; + DISALLOWED = 2; + } + optional tm.RescoreStatus.RescoreStatusEnum status = 1; +} + +message OnFieldMatch { + optional tm.MatchTuple matchTuple = 1; + optional tm.Field field = 2; + optional tm.AssignedObjectType.AssignedObjectEnum assignedType = 3 [default = MATCH]; + optional uint32 duration = 4; + optional uint32 scId = 5; +} + +message SavedMatch { + optional tm.MatchTuple matchTuple = 1; + optional tm.Field field = 2; +} + +message AssignedMatch { + optional tm.MatchTuple matchTuple = 1; + optional tm.Field field = 2; +} + +message AssignedMatchList { + repeated tm.AssignedMatch match = 1; +} diff --git a/proto/mobile.proto b/proto/mobile.proto new file mode 100644 index 0000000..27ee215 --- /dev/null +++ b/proto/mobile.proto @@ -0,0 +1,34 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +message MobileDevice { + enum DeviceRole { + MATCH_SCORING = 0; + SKILLS_SCORING = 1; + FIELD_CONTROL = 2; + INSPECTION = 3; + ANNOUNCER = 4; + } + optional string devId = 1; + optional string name = 2; + optional bool enabled = 3; + optional uint32 expires = 4; + optional bool activated = 5 [default = false]; + optional string devKey = 6; + repeated tm.MobileDevice.DeviceRole roles = 7; +} + +message MobileDeviceList { + repeated tm.MobileDevice devices = 1; +} + +message MobileDeviceMatchLock { + optional string devId = 1; + optional tm.MatchTuple matchTuple = 2; +} + +message MobileDeviceMatchLockList { + repeated tm.MobileDeviceMatchLock devices = 1; +} diff --git a/proto/netcomm.proto b/proto/netcomm.proto new file mode 100644 index 0000000..1b43988 --- /dev/null +++ b/proto/netcomm.proto @@ -0,0 +1,93 @@ +syntax = "proto2"; + +package tm; + +import "division.proto"; +import "elim.proto"; +import "event.proto"; +import "fieldhw.proto"; +import "match.proto"; +import "notice.proto"; +import "rankings.proto"; +import "schedule.proto"; +import "sidechallenge.proto"; +import "team.proto"; +import "publish.proto"; +import "award.proto"; +import "announcement.proto"; +import "textmessage.proto"; +import "display.proto"; +import "mobile.proto"; +message Backup { + optional bytes data = 1; +} + +message BackendMessageData { + optional tm.Division division = 2; + optional tm.DivisionList divisionList = 3; + optional tm.ElimTeam elimTeam = 4; + optional tm.ElimAlliance elimAlliance = 5; + optional tm.ElimAllianceList elimAllianceList = 6; + optional tm.UnavailableTeam unavailableTeam = 7; + optional tm.UnavailableTeams unavailableTeams = 8; + optional tm.ElimBracketNodeAlliance elimBracketNodeAlliance = 9; + optional tm.ElimBracketNodeData elimBracketNodeData = 10; + optional tm.ElimAllianceSelectionMode elimAllianceSelectionMode = 11; + optional tm.EventConfig eventConfig = 12; + optional tm.FieldHwState fieldHwState = 14; + optional tm.FieldTime fieldTime = 15; + optional tm.Field field = 16; + optional tm.FieldSet fieldSet = 17; + optional tm.FieldSetList fieldSetList = 18; + optional tm.PitDisplay pitDisplay = 19; + optional tm.PitDisplayList pitDisplayList = 20; + optional tm.MatchTimeSchedEntry matchTimeSchedEntry = 21; + optional tm.MatchTimeSchedList matchTimeSchedList = 22; + optional tm.DisplayState displayState = 23; + optional tm.AssignedObjectType assignedObjectType = 25; + optional tm.MatchTuple matchTuple = 26; + optional tm.AllianceTeamInfo allianceTeamInfo = 27; + optional tm.AllianceInfo allianceInfo = 28; + optional tm.MatchInfo matchInfo = 29; + optional tm.MatchSchedule matchSchedule = 30; + optional tm.MatchList matchList = 31; + optional tm.TeamScore teamScore = 32; + optional tm.AllianceScore allianceScore = 33; + optional tm.MatchScore matchScore = 34; + optional tm.RescoreStatus rescoreStatus = 35; + optional tm.OnFieldMatch onFieldMatch = 36; + optional tm.SavedMatch savedMatch = 37; + optional tm.Notice notice = 38; + optional tm.Rankings rankings = 40; + optional tm.ScheduleBlock scheduleBlock = 43; + optional tm.ScheduleList scheduleList = 44; + optional tm.SideChallenge sideChallenge = 45; + optional tm.SideChallengeList sideChallengeList = 46; + optional tm.SideChallengeScore sideChallengeScore = 47; + optional tm.SideChallengeScoreList sideChallengeScoreList = 48; + optional tm.TeamInfo teamInfo = 49; + optional tm.TeamList teamList = 50; + optional tm.Division defaultDivision = 51; + optional tm.PublishOptions publishOptions = 52; + optional tm.Backup backup = 53; + optional tm.Notice rankingsNotice = 55; + optional tm.ScoringConfig scoringConfig = 56; + optional tm.ElimAllianceUnbalancedMode elimAllianceUnbalancedMode = 57; + optional tm.AwardList awardList = 58; + optional tm.Award award = 59; + optional tm.SponsorLogos sponsorLogos = 60; + optional tm.TeamInspection teamInspection = 61; + optional tm.TeamInspectionList teamInspectionList = 62; + optional tm.AnnouncementList announcements = 63; + optional tm.ElimQueueList elimQueueList = 64; + optional tm.SessionList sessionList = 65; + optional tm.OfficialEventConfig officialEventConfig = 66; + optional tm.TextMessageConfig textMessageConfig = 67; + optional tm.DisplaySlide displaySlide = 68; + optional tm.DisplaySlideList displaySlideList = 69; + optional tm.MatchScoreList matchScoreList = 70; + optional tm.MobileDeviceList mobileDeviceList = 71; + optional tm.ElimWinsToAdvanceList elimWinsToAdvanceList = 72; + optional tm.CustomElimBracketList customElimBracketList = 73; + optional tm.TeamInspectionLog teamInspectionLog = 74; +} diff --git a/proto/notice.proto b/proto/notice.proto new file mode 100644 index 0000000..808c1f8 --- /dev/null +++ b/proto/notice.proto @@ -0,0 +1,123 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +import "elim.proto"; +import "sidechallenge.proto"; +import "event.proto"; +import "fieldhw.proto"; +import "publish.proto"; +import "division.proto"; +import "rankings.proto"; +import "award.proto"; +import "team.proto"; +import "textmessage.proto"; +import "display.proto"; +import "mobile.proto"; + +enum NoticeId { + NOTICE_INVALID = 0; + NOTICE_TEST = 1; + NOTICE_ALL = 2; + NOTICE_MATCH_SCORE_UPDATED = 3; + NOTICE_MATCH_LIST_UPDATED = 4; + NOTICE_TEAM_LIST_UPDATED = 5; + NOTICE_RANKINGS_UPDATED = 6; + NOTICE_DIVISION_LIST_UPDATED = 7; + NOTICE_ELIM_ALLIANCE_UPDATED = 8; + NOTICE_ELIM_UNAVAIL_TEAMS_UPDATED = 9; + NOTICE_ELIM_CLEARED = 10; + NOTICE_SIDE_CHALLENGE_LIST_UPDATED = 11; + NOTICE_SIDE_CHALLENGE_SCORE_UPDATED = 12; + NOTICE_EVENT_STATUS_UPDATED = 13; + NOTICE_ELIM_CONFIG_UPDATED = 14; + NOTICE_FIELD_TIMER_STARTED = 15; + NOTICE_FIELD_TIMER_STOPPED = 16; + NOTICE_FIELD_RESET_TIMER = 17; + NOTICE_FIELD_MATCH_ASSIGNED = 18; + NOTICE_SAVED_MATCH_ASSIGNED = 19; + NOTICE_MATCH_TIME_SCHED_UPDATED = 20; + NOTICE_FIELD_SET_LIST_UPDATED = 21; + NOTICE_PIT_DISPLAY_LIST_UPDATED = 22; + NOTICE_DISPLAY_STATE_UPDATED = 23; + NOTICE_PUBLISH_OPTIONS_UPDATED = 25; + NOTICE_AVAIL_TEAM_SORT_ORDER_UPDATED = 26; + NOTICE_SCORING_CONFIG_UPDATED = 27; + NOTICE_AWARD_LIST_UPDATED = 28; + NOTICE_AWARD_WINNER_UPDATED = 29; + NOTICE_SLIDE_ASSIGNED = 30; + NOTICE_SHUTDOWN = 32; + NOTICE_TEAM_INSPECTION_UPDATED = 33; + NOTICE_REALTIME_SCORE_CHANGED = 34; + NOTICE_SPONSOR_LOGOS_UPDATED = 35; + NOTICE_ANNOUNCEMENTS_UPDATED = 36; + NOTICE_ELIM_QUEUE_LIST_UPDATED = 37; + NOTICE_ELIM_BRACKET_DONE = 38; + NOTICE_FIELD_STATE_REQUESTED = 39; + NOTICE_LEAGUE_MODE_UPDATED = 40; + NOTICE_OFFICIAL_EVENT_CONFIG_UPDATED = 41; + NOTICE_EVENT_PASSWORD_CHANGED = 42; + NOTICE_TEXT_MESSAGE_CONFIG_CHANGED = 43; + NOTICE_TEXT_MESSAGE_STATUS = 44; + NOTICE_QUAL_MATCHES_TO_COUNT_CHANGED = 45; + NOTICE_SLIDE_UPDATED = 46; + NOTICE_SLIDE_LIST_UPDATED = 47; + NOTICE_SLIDE_PREV_SUBSLIDE = 48; + NOTICE_SLIDE_NEXT_SUBSLIDE = 49; + NOTICE_FIELD_MATCH_SCHEDULED = 50; + NOTICE_MOBILE_DEVICE_LIST_UPDATED = 51; + NOTICE_MOBILE_DEVICE_MATCH_LOCKED = 52; + NOTICE_ELIM_WINS_TO_ADVANCE_CHANGED = 53; + NOTICE_MOBILE_DEVICE_TEMP_CODE_ACTIVATED = 54; + NOTICE_SKILLS_CHALLENGE_CONFIG_UPDATED = 55; + NOTICE_SIDE_CHALLENGE_SCORE_LIST_UPDATED = 56; + NOTICE_PUBLISH_STATUS = 57; + NOTICE_AWARD_WINNER_LIST_UPDATED = 58; + NOTICE_EVENT_NAME_UPDATED = 59; + NOTICE_ACTIVE_FIELD_CHANGED = 60; + NOTICE_FIELD_CONTROL_STATUS = 61; +} + +message Notice { + optional tm.NoticeId id = 1; + optional tm.MatchTuple affectedMatch = 2; + optional tm.ElimAlliance elimAlliance = 3; + optional tm.SideChallengeScore sideChallengeScore = 4; + optional tm.EventConfig eventConfig = 5; + optional tm.FieldHwState fieldState = 6; + optional tm.FieldTime fieldTime = 7; + optional tm.Field field = 8; + optional tm.MatchTimeSchedList matchTimeSchedList = 9; + optional tm.MatchTimeSchedList matchTimeSched = 10; + optional tm.FieldSetList fieldSetList = 11; + optional tm.PitDisplayList pitDisplayList = 12; + optional tm.DisplayState displayState = 13; + optional tm.AssignedObjectType.AssignedObjectEnum assignedType = 15; + optional tm.PublishOptions publishOptions = 16; + optional tm.Division division = 17; + optional tm.MatchScore matchScore = 18; + optional tm.Rankings rankings = 19; + optional tm.MatchRound affectedRound = 20; + optional tm.Award award = 21; + optional tm.FieldSet fieldSet = 22; + optional tm.TeamInfo teamInfo = 23; + optional double obsolete_serverTime = 24; + optional tm.TeamInspection teamInspection = 25; + optional int32 obsolete_serverTimeZoneInSecs = 27; + optional tm.ElimQueueList elimQueueList = 28; + optional tm.TextMessageNotice textMessage = 29; + optional string originatingClient = 30; + optional bool isLocal = 31; + optional tm.DisplaySlide displaySlide = 32; + optional tm.AssignedMatchList assignedMatchList = 33; + optional tm.MobileDeviceMatchLockList mobileMatchLocks = 34; + optional tm.ElimWinsToAdvanceList elimWinsToAdvanceList = 35; + optional string temporaryCode = 36; + optional tm.MatchScoreList matchScoreLog = 37; + optional tm.PublishStatus publishStatus = 38; + optional tm.MatchInfo matchInfo = 39; + optional tm.AwardList awardList = 40; + optional string eventName = 41; + optional tm.FieldControlStatus fieldControlStatus = 42; +} diff --git a/proto/publish.proto b/proto/publish.proto new file mode 100644 index 0000000..290b0eb --- /dev/null +++ b/proto/publish.proto @@ -0,0 +1,40 @@ +syntax = "proto2"; + +package tm; + +message RobotEventsOptions { + optional bool enabled = 1; + optional string types = 2; + optional int32 divisionToPublish = 3; + optional int32 mappedDivisionId = 4; +} + +message CustomUrlOption { + optional bool enabled = 1; + optional string url = 2; +} + +message TwitterOption { + optional bool enabled = 1; + optional string username = 2; + optional string accessKey = 3; + optional string accessSecret = 4; +} + +message PublishOptions { + enum PublishOptionId { + VEXSCORES = 1; + CUSTOM = 2; + TWITTER = 3; + ROBOTEVENTS = 4; + WORLDS = 1000; + } + optional tm.CustomUrlOption customUrl = 2; + optional tm.TwitterOption twitter = 3; + optional tm.RobotEventsOptions robotevents = 4; +} + +message PublishStatus { + required bool success = 1; + required string userMsg = 2; +} diff --git a/proto/rankings.proto b/proto/rankings.proto new file mode 100644 index 0000000..49edeb9 --- /dev/null +++ b/proto/rankings.proto @@ -0,0 +1,35 @@ +syntax = "proto2"; + +package tm; + +import "team.proto"; +message Rankings { + message RankTeam { + optional string number = 1; + optional string name = 2; + } + message RankAlliance { + repeated tm.Rankings.RankTeam teams = 1; + optional string name = 2; + } + message Rank { + optional string number = 1; + optional int32 divId = 2; + optional int32 rank = 3; + optional int32 wp = 4; + optional int32 sp = 5; + optional int32 wins = 6; + optional int32 losses = 7; + optional int32 ties = 8; + optional string name = 10; + optional float avgPoints = 11; + optional int32 numMatches = 12; + optional uint32 totalPoints = 13; + optional bool minNumMatches = 14; + optional uint32 highScore = 15; + optional int32 ap = 16; + optional bool tied = 17; + optional tm.Rankings.RankAlliance alliance = 18; + } + repeated tm.Rankings.Rank ranks = 1; +} diff --git a/proto/schedule.proto b/proto/schedule.proto new file mode 100644 index 0000000..7f12df4 --- /dev/null +++ b/proto/schedule.proto @@ -0,0 +1,23 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +import "fieldhw.proto"; +import "division.proto"; +message ScheduleFieldSetDivisionMap { + optional tm.FieldSet fieldSet = 1; + optional tm.Division division = 2; +} + +message ScheduleBlock { + optional tm.MatchRound type = 1; + optional uint32 cycleTime = 2; + optional uint32 startTime = 3; + optional uint32 stopTime = 4; + repeated tm.ScheduleFieldSetDivisionMap fieldSetDivMap = 5; +} + +message ScheduleList { + repeated tm.ScheduleBlock blocks = 1; +} diff --git a/proto/sidechallenge.proto b/proto/sidechallenge.proto new file mode 100644 index 0000000..3840246 --- /dev/null +++ b/proto/sidechallenge.proto @@ -0,0 +1,31 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +message SideChallenge { + optional int32 id = 1; + optional string name = 2; +} + +message SideChallengeList { + repeated tm.SideChallenge challenges = 1; +} + +message SideChallengeScore { + optional int32 id = 1; + optional int32 challengeId = 2; + optional string teamNum = 3; + optional uint32 timeScored = 4; + optional int32 score = 5; + optional string teamName = 6; + optional bool deleted = 7 [default = false]; + repeated tm.ScoreObject scoreTypes = 8; + optional int32 teamId = 9; + optional string uuid = 10; + optional uint32 session = 11 [default = 0]; +} + +message SideChallengeScoreList { + repeated tm.SideChallengeScore scores = 1; +} diff --git a/proto/team.proto b/proto/team.proto new file mode 100644 index 0000000..06182e4 --- /dev/null +++ b/proto/team.proto @@ -0,0 +1,63 @@ +syntax = "proto2"; + +package tm; + +message TeamInfo { + enum AgeGroup { + ELEMENTARY = 1; + MIDDLE_SCHOOL = 2; + HIGH_SCHOOL = 3; + COLLEGE = 4; + } + optional string number = 1; + optional string name = 2; + optional string city = 3; + optional string state = 4; + optional string country = 5; + optional string shortName = 6; + optional string school = 7; + optional string sponsors = 8; + optional int32 divId = 9; + optional int32 id = 10; + optional int32 tiebreaker = 11; + optional int32 rank = 12; + optional bool checkedIn = 13; + optional tm.TeamInfo.AgeGroup ageGroup = 14 [default = HIGH_SCHOOL]; +} + +message TeamList { + repeated tm.TeamInfo teams = 1; +} + +message TeamInspection { + enum Status { + NOT_STARTED = 1; + PARTIAL = 2; + PASSED = 3; + } + optional tm.TeamInfo info = 1; + optional tm.TeamInspection.Status status = 2 [default = NOT_STARTED]; + optional string comments = 3; + optional int32 numRobots = 4 [default = 1]; + repeated tm.TeamInspection.Status robotStatus = 5; + optional bytes details = 6; +} + +message TeamInspectionList { + repeated tm.TeamInspection teams = 1; +} + +message TeamInspectionLogEntry { + enum Status { + NOT_STARTED = 1; + PARTIAL = 2; + PASSED = 3; + } + optional string number = 1; + optional tm.TeamInspectionLogEntry.Status status = 2 [default = NOT_STARTED]; + optional string timestamp = 3; +} + +message TeamInspectionLog { + repeated tm.TeamInspectionLogEntry entries = 1; +} diff --git a/proto/textmessage.proto b/proto/textmessage.proto new file mode 100644 index 0000000..b651be0 --- /dev/null +++ b/proto/textmessage.proto @@ -0,0 +1,25 @@ +syntax = "proto2"; + +package tm; + +import "match.proto"; +message TextMessageConfig { + optional bool inUse = 1; + optional bool enabled = 2; + optional uint32 firstCallInSecs = 3 [default = 1200]; + optional uint32 secondCallInSecs = 4 [default = 600]; +} + +message TextMessageNotice { + enum MessageType { + MSG_SENT = 1; + MSG_FAILED = 2; + ERROR = 3; + } + required tm.TextMessageNotice.MessageType noticeType = 1; + repeated string teams = 2; + optional tm.MatchTuple match = 3; + optional uint32 timeSent = 4; + optional uint32 callNum = 5; + optional string errMsg = 6; +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..18dbd28 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,100 @@ +use rumqttc::{MqttOptions, Client, QoS}; +use std::time::Duration; +use std::thread; + +// TODO: +// 1) Represent state of division/fieldset/field/match(maybe save/load) +// 2) Create functions to update the states and publish to MQTT based on incoming 'notifications' +// 2) Create functions to update the state that map to NOTICE_IDs and take in the notice struct +// Notifications parsed last year: +// - NOTICE_REALTIME_SCORE_CHANGED +// - NOTICE_FIELD_TIMER_STARTED +// - NOTICE_FIELD_TIMER_STOPPED +// - NOTICE_FIELD_RESET_TIMER +// - NOTICE_FIELD_MATCH_ASSIGNED +// - NOTICE_ACTIVE_FIELD_CHANGED +// - NOTICE_RANKINGS_UPDATED +// - NOTICE_EVENT_STATUS_UPDATED +// - NOTICE_ELIM_ALLIANCE_UPDATED +// - NOTICE_ELIM_UNAVAIL_TEAMS_UPDATED +// - NOTICE_MATCH_LIST_UPDATED +// +// Notice protobuf: +// message Notice { +// optional .NoticeId id = 1; +// optional .MatchTuple affectedMatch = 2; +// optional .ElimAlliance elimAlliance = 3; +// optional .SideChallengeScore sideChallengeScore = 4; +// optional .EventConfig eventConfig = 5; +// optional .FieldHwState fieldState = 6; +// optional .FieldTime fieldTime = 7; +// optional .Field field = 8; +// optional .MatchTimeSchedList matchTimeSchedList = 9; +// optional .MatchTimeSchedList matchTimeSched = 10; +// optional .FieldSetList fieldSetList = 11; +// optional .PitDisplayList pitDisplayList = 12; +// optional .DisplayState displayState = 13; +// optional .AssignedObjectType.AssignedObjectEnum assignedType = 15; +// optional .PublishOptions publishOptions = 16; +// optional .Division division = 17; +// optional .MatchScore matchScore = 18; +// optional .Rankings rankings = 19; +// optional .MatchRound affectedRound = 20; +// optional .Award award = 21; +// optional .FieldSet fieldSet = 22; +// optional .TeamInfo teamInfo = 23; +// optional double obsolete_serverTime = 24; +// optional .TeamInspection teamInspection = 25; +// optional int32 obsolete_serverTimeZoneInSecs = 27; +// optional .ElimQueueList elimQueueList = 28; +// optional .TextMessageNotice textMessage = 29; +// optional string originatingClient = 30; +// optional bool isLocal = 31; +// optional .DisplaySlide displaySlide = 32; +// optional .AssignedMatchList assignedMatchList = 33; +// optional .MobileDeviceMatchLockList mobileMatchLocks = 34; +// optional .ElimWinsToAdvanceList elimWinsToAdvanceList = 35; +// optional string temporaryCode = 36; +// optional .MatchScoreList matchScoreLog = 37; +// optional .PublishStatus publishStatus = 38; +// optional .MatchInfo matchInfo = 39; +// optional .AwardList awardList = 40; +// optional string eventName = 41; +// optional .FieldControlStatus fieldControlStatus = 42; +// } + +use prost::Message; +use std::io::Cursor; + +pub mod tm_proto { + include!(concat!(env!("OUT_DIR"), "/tm.rs")); +} + +pub fn deserialize_notice(buf: &[u8]) -> Result { + tm_proto::Notice::decode(&mut Cursor::new(buf)) +} + +fn main() { + // Set client options + let mut mqttoptions = MqttOptions::new("rumqttc", "localhost", 1883); + mqttoptions.set_keep_alive(Duration::from_secs(5)); + + // Create a new client(10 is bounded channel capacity?) + let (mut client, mut connection) = Client::new(mqttoptions, 10); + client.subscribe("bridge", QoS::AtMostOnce).unwrap(); + + // Create a thread to own connection and handle it's incoming messages + let mqtt_thread = thread::spawn(move || + for (_, message) in connection.iter().enumerate() { + println!("Message = {:?}", message); + } + ); + + // Publish using the client + for _ in 0..10 { + client.publish("bridge/status", QoS::AtLeastOnce, false, "{\"status\": true}").unwrap(); + thread::sleep(Duration::from_millis(100)); + } + + mqtt_thread.join().expect("Failed to join mqtt thread"); +}