Crates.io | neweden |
lib.rs | neweden |
version | 0.3.3 |
source | src |
created_at | 2019-12-28 07:15:56.396965 |
updated_at | 2023-07-11 09:21:23.176427 |
description | Library for system inforamtion, wayfinding and range queries in Eve Online |
homepage | |
repository | https://github.com/dsp/neweden |
max_upload_size | |
id | 192900 |
size | 64,352 |
neweden is a rust library for system information, wayfinding and range queries for the MMORPG Eve Online from CCP Games.
use neweden::source::sqlite::DatabaseBuilder;
use neweden::Navigatable;
let universe = DatabaseBuilder::new("./sqlite-latest.sqlite").build().unwrap();
let system_id = 30000142.into(); // returns a SystemId
println!("{:?}", universe.get_system(&system_id).unwrap().name); // Jita
use neweden::source::sqlite::DatabaseBuilder;
use neweden::Navigatable;
use neweden::navigation::PathBuilder;
let universe = DatabaseBuilder::new("./sqlite-latest.sqlite").build().unwrap();
let jita = 30000142;
let camal = 30000049;
let path = PathBuilder::new(&universe)
.waypoint(&universe.get_system(&jita.into()).unwrap())
.waypoint(&universe.get_system(&camal.into()).unwrap())
.build();
for system in path {
println!("Waypoint: {}", system.name)
}
The library is under development and in early alpha stages. API's will change and your code will break. It also means that the build and test mechanism are slightly awkward and will improve over time.
The library uses features
to define the backends for retrieving system
and connection information. By default the library builds without any features
and you are only able to create a universe by creating universes using your own data loaders.
There are build int dataloaders for CCPs static dump. You can enable the Postgres database backend
by using the postgres
feature or SQLite by using the sqlite
feature.
The rpc
feature is only for internal use and depends on a crate that is not open source.
To build the repository:
git clone https://github.com/dsp/neweden
cd neweden
cargo build --features sqlite
To run tests or benchmarks you must use the nightly. If you build with the
database
flags you are required to provide a database connection using
the env variable DATABASE_URL
.
git clone https://github.com/dsp/neweden
cd neweden
export SQLITE_URI="/path/to/sde/dump"
cargo +nightly test --features sqlite