neweden

Crates.ioneweden
lib.rsneweden
version0.3.3
sourcesrc
created_at2019-12-28 07:15:56.396965
updated_at2023-07-11 09:21:23.176427
descriptionLibrary for system inforamtion, wayfinding and range queries in Eve Online
homepage
repositoryhttps://github.com/dsp/neweden
max_upload_size
id192900
size64,352
David Soria Parra (dsp)

documentation

README

neweden: a wayfinding library for Eve Online

neweden is a rust library for system information, wayfinding and range queries for the MMORPG Eve Online from CCP Games.

Docs Crates.io License

Example

Get information about a system

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

Find a route

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)
}

Development status

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.

Building

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

Running tests

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
Commit count: 67

cargo fmt