Compare commits

..

No commits in common. "b05a87cc9c3b71a480c5c4c9bd8a0024caa79b4e" and "f121e3fd5509ecebedb7267b0d515cfa75e45b9b" have entirely different histories.

8 changed files with 6 additions and 50 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "vendored/directories"]
path = vendored/directories
url = git@github.com:ReactorScram/directories-rs.git

2
Cargo.lock generated
View File

@ -35,6 +35,8 @@ checksum = "06821ea598337a8412cf47c5b71c3bc694a7f0aed188ac28b836fab164a2c202"
[[package]]
name = "directories"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210"
dependencies = [
"dirs-sys",
]

View File

@ -13,7 +13,7 @@ version = "0.1.6"
[dependencies]
configparser = "3.0.0"
directories = { path = "vendored/directories" }
directories = "4.0.1"
mac_address = "1.1.2"
rand = "0.8.4"
thiserror = "1.0.30"

View File

@ -1,40 +0,0 @@
type Mac = [u8; 6];
pub fn debug () {
for input in [
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 1],
] {
assert_eq! (unmix (mix (input)), input);
}
println! ("Passed");
}
// NOT intended for any cryptography or security. This is TRIVIALLY reversible.
// It's just to make it easier for humans to tell apart MACs where only a couple
// numbers differ.
fn mix (i: Mac) -> Mac {
[
i [0] ^ i [5],
i [1] ^ i [4],
i [2] ^ i [3],
i [3],
i [4],
i [5],
]
}
fn unmix (i: Mac) -> Mac {
[
i [0] ^ i [5],
i [1] ^ i [4],
i [2] ^ i [3],
i [3],
i [4],
i [5],
]
}

View File

@ -165,7 +165,7 @@ fn load_config_file () -> ConfigFile {
if let Some (proj_dirs) = find_project_dirs () {
let mut ini = Ini::new_cs ();
let path = proj_dirs.config_local_dir ().join ("client.ini");
let path = proj_dirs.config_dir ().join ("client.ini");
if ini.load (&path).is_ok () {
let map_ref = ini.get_map_ref ();
if let Some (x) = map_ref.get ("nicknames") {

View File

@ -1,7 +1,6 @@
use prelude::*;
pub mod app_common;
mod avalanche;
mod client;
mod ip;
pub mod message;
@ -32,7 +31,6 @@ async fn async_main () -> Result <(), AppError> {
Some ("--version") => println! ("lookaround v{}", LOOKAROUND_VERSION),
Some ("client") => client::client (args).await?,
Some ("config") => config (),
Some ("debug-avalanche") => avalanche::debug (),
Some ("find-nick") => client::find_nick (args).await?,
Some ("my-ips") => my_ips ()?,
Some ("server") => server::server (args).await?,
@ -44,7 +42,7 @@ async fn async_main () -> Result <(), AppError> {
fn config () {
if let Some (proj_dirs) = ProjectDirs::from ("", "ReactorScram", "LookAround") {
println! ("Using config dir {:?}", proj_dirs.config_local_dir ());
println! ("Using config dir {:?}", proj_dirs.config_dir ());
}
else {
println! ("Can't detect config dir.");

View File

@ -41,7 +41,7 @@ fn configure <I: Iterator <Item=String>> (mut args: I) -> Result <Params, AppErr
if let Some (proj_dirs) = find_project_dirs () {
let mut ini = Ini::new_cs ();
let path = proj_dirs.config_local_dir ().join ("server.ini");
let path = proj_dirs.config_dir ().join ("server.ini");
if ini.load (&path).is_ok () {
if let Some (x) = ini.get ("server", "nickname") {
nickname = x;

@ -1 +0,0 @@
Subproject commit 6b95e6319cb69933c07dba98e6af26d7145e0bd9