Giter VIP home page Giter VIP logo

tarkov's Issues

Is this still relevant

Hi i wondering will this stiill interact with the api i have attempted sniffing the game itself but it uses updated tls encryption now. Does this library still work?

profile is locked

just wondering if you've encountered this error from RagFairBuyOffer?

{
  error: {
    err: 228,
    errmsg: '228 - ItemsMoving: profile [my pmc's profile id here] is locked',
    data: []
  }
}

You added an error 228 from f3f3190 and I was wondering if it's the same error and you added a more descriptive reason.

note: not using your library (reimplemented it in TS). logged back into the game and everything functions normally.

Fetch all flea market pages

Hi again, is there a way to fetch all flea market pages at the same time, or choose how many offers there are per page?

Got "UnknownAPIError(232)"

Finally I've grab token+hardware id from EFT Launcher.
Now, when I'm trying to auth with this I'm getting "UnknownAPIError(232)".
I used "from_access_token" from "auth_basic" example
Looks like developer changed api?

JSON Error - Invalid Type Integer

I'm getting this error whenever I try to buy items from the flea market

Error: Json(Error("invalid type: integer `6932509`, expected a string", line: 1, column: 91))

I'm thinking maybe an endpoint has changed? I'm not too sure, I've been messing with it for a few hours and haven't been able to figure out whats wrong.

This happens when following the flea market buying example.

Restructure and clean up structs

  • Structs are all over the place and the module system I setup is not turning out very clean.
  • I want to try to reuse structs if I can but importing them from an unrelated module is confusing.
  • There are too many duplicate and similar struct names. Too confusing.

'multiple rmeta candidates for tarkov...' 'cant find crate for tarkov'

I'm sorry to make this question because I know it's probably a really easy fix but I can't figure out what it means. I've never used rust before. Why am I getting these errors when I run the 'test-api.rs' file? and will this actually affect me at all, or should I ignore it and begin to use the api otherwise...

thanks

Replace `actix_web`

Unfortunate timing but actix_web is dead. Not sure what the best alternative is yet but it should be updated. Maybe hyper.rs

Possibility of a ban?

How "safe" would you assume this is, I know BSG hates people doing stuff that they don't enjoy. Would it be considered moderately safe if you're of course so spamming the buy and sell on ragfair?

Error: LoginError(BadTwoFactorCode)

Hey, I'm trying to authenticate using login_with_2fa, but keep running into

Error: LoginError(BadTwoFactorCode).

I've added io:stdin().read_line so that I can input the 2FA manually.
I'm unable to figure out why this fails.. Do you have any suggestions?

Sorry if an issue isn't the the best place to ask this, but Google hasn't been kind to me on this one..

main.rs:

use tarkov::auth::LoginError;
use tarkov::hwid::generate_hwid;
use tarkov::{Error, Tarkov};
use std::io;

#[tokio::main]
async fn main() -> Result<(), Error> {
    std::env::set_var("RUST_LOG", "tarkov=info");

    let email = "<email>";
    let password = "<pw>";
    let hwid = generate_hwid();

    let t = match Tarkov::login(email, password, &hwid).await {
        Ok(t) => Ok(t),
        Err(Error::LoginError(e)) => match e {
            // 2FA required!
            LoginError::TwoFactorRequired => {
                // Get 2FA from email (or generate TOTP) then continue...
				let mut code = String::new();
				println!("Hardware ID: {}", &hwid);
				println!("Input 2FA:");
				io::stdin().read_line(&mut code).expect("Failed to read input");
				println!("{}", &code);
                Tarkov::login_with_2fa(email, password, &code, &hwid).await
            }
            _ => Err(e)?,
        },
        Err(e) => Err(e),
    }?;

    println!("{}", t.session);

    Ok(())
}

Cargo.toml:

[package]
name = "eft_market"
description = "Idk yet"
version = "0.1.0"
authors = ["Dan Kyung <[email protected]>"]
edition = "2018"

[dependencies]
md5 = "0.7"
err-derive = "0.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
rand = "0.7"
log = "0.4"
serde_repr = "0.1"
hyper = "0.13"
hyper-tls = "0.4"
http = "0.2"
tarkov = { path = "./tarkov-master" }
tokio = { version = "0.2.6", features = ["full"] }

rustc version: 1.41.0

failed to resolve: could not find `___rt` in quote

I created a new project to use this library. I set a new dependency in cargo.toml as tarkov = "0.1" and then in my main.rs file I only have a basic println function.

When I run this, no matter what I put in that file, it will work fine without the tarkov dependency but break as soon as I put it back. I get back this error:

C:/Users/Aiden/.cargo/bin/cargo.exe run --color=always --package tarkovbot --bin tarkovbot
   Compiling err-derive v0.2.2
error[E0433]: failed to resolve: could not find `__rt` in `quote`
   --> C:\Users\Aiden\.cargo\registry\src\github.com-1ecc6299db9ec823\err-derive-0.2.2\src\lib.rs:203:56
    |
203 | fn display_body(s: &synstructure::Structure) -> quote::__rt::TokenStream {
    |                                                        ^^^^ could not find `__rt` in `quote`

error: aborting due to previous error

How did you create this API?

Hi, can you briefly describe the procedure for writing an unofficial API, please? Did you sniff and decrypt packets or decompile the game to see what requests were being sent?
I'm new and would really like to know this, thx)

`async fn` is not permitted in the 2015 edition

Installed everything on WSL, cargo build executes no problem, running rustc auth_basic.rs throws

error[E0670]: async fn is not permitted in the 2015 edition
--> auth_basic.rs:5:1
|
5 | async fn main() -> Result<(), Error> {
| ^^^^^

error[E0433]: failed to resolve: maybe a missing crate tarkov?
--> auth_basic.rs:1:5
|
1 | use tarkov::hwid::generate_hwid;
| ^^^^^^ maybe a missing crate tarkov?

error[E0432]: unresolved import tarkov
--> auth_basic.rs:2:5
|
2 | use tarkov::{Error, Tarkov};
| ^^^^^^ maybe a missing crate tarkov?

error[E0433]: failed to resolve: use of undeclared type or module actix_rt
--> auth_basic.rs:4:3
|
4 | #[actix_rt::main]
| ^^^^^^^^ use of undeclared type or module actix_rt

error[E0433]: failed to resolve: use of undeclared type or module env_logger
--> auth_basic.rs:7:5
|
7 | env_logger::init();
| ^^^^^^^^^^ use of undeclared type or module env_logger

error[E0425]: cannot find function generate_hwid in this scope
--> auth_basic.rs:9:57
|
9 | let t = Tarkov::login("[email protected]", "password", generate_hwid().as_str()).await?;
| ^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function generate_hwid in this scope
--> auth_basic.rs:14:9
|
14 | generate_hwid().as_str(),
| ^^^^^^^^^^^^^ not found in this scope

error[E0277]: main has invalid return type impl std::future::Future
--> auth_basic.rs:5:20
|
5 | async fn main() -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^ main can only return types that implement std::process::Termination
|
= help: consider using (), or a Result

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0277, E0425, E0432, E0433, E0670.
For more information about an error, try rustc --explain E0277.

Automatically Receiving All?

It seems that you reply really fast, my apologies for yet another issue.

What would be the best way to automatically receive all items from a trader?

Best way to Sniff the Cookie

what is the best way to sniff the PHPSESSID cookie. idk how to find it. I tried wireshark but with no success.
I'm sorry if this annoys you.

Logs

Log debug stuff behind flag, especially raw json data

Have a way to inspect attachments on items in ragfair?

Hey,

Browsed the code, and even though I do not use Rust, it's super clean! Do you plan on adding a way to inspect the mods and attachment for a weapon (or generally any item) ?

It would seem that this line covers it in your Item struct but the Upd struct does not seem to reflect that

Thanks !

get_items() with #[no_mangle] causes cargo build to hang

So I have a pub extern function that uses #[no_mangle]

This pub function calls an async function that attempts to call get_items(), but when get_items() is used cargo build just hangs, no matter how long I leave it for.

Changing this call to any other call (like get_item_prices()) or getting rid of #[no_mangle] on the pub function fixes the issue.

Is there a reason for this happening that I'm not aware of?

Fix missing and invalid fields

EFT devs are very inconsistent with their JSON outputs, therefore I was forced to comment a few invalid or unknown fields.

error[E0277]: the trait bound `tarkov::constant::Item: serde::ser::Serialize` is not satisfied

First off, thank you so much for replying to these issues.

I want to write the items result to a file. I try doing this with serde, however it doesn't seem like it is particularly fond of tarkov::constant::Item .

Is there a way around this?

Full error message:

error[E0277]: the trait bound `tarkov::constant::Item: serde::ser::Serialize` is not satisfied
    --> src\main.rs:61:36
     |
61   |     serde_json::to_writer(file_items, &items)?;
     |                                       ^^^^^^ the trait `serde::ser::Serialize` is not implemented for `tarkov::constant::Item`
     |
    ::: C:\Users\einarw\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.46\src\ser.rs:2167:8
     |
2167 |     T: Serialize,
     |        --------- required by this bound in `serde_json::ser::to_writer`
     |
     = note: required because of the requirements on the impl of `serde::ser::Serialize` for `std::collections::HashMap<std::string::String, tarkov::constant::Item>`

Cargo version
1.41.0

Cargo.toml

[package]
name = "test_package"
version = "0.1.0"
authors = ["me"]
edition = "2018"

[dependencies]
serde_json = "1.0"
tarkov = "0.1.1"
tokio = { version = "0.2", features = ["macros"] }

Main.rs

use tarkov::auth::LoginError;
use tarkov::hwid::generate_hwid;
use tarkov::{Error, Tarkov};
use std::io;
//use std::time::{SystemTime, UNIX_EPOCH};
//use tarkov::market_filter::{Currency, MarketFilter, Owner};
use tarkov::profile::Side;
use std::fs::File;
use serde_json;

#[tokio::main]
async fn main() -> Result<(), Error> {
    std::env::set_var("RUST_LOG", "tarkov=info");

    let email = "<email@email>";
    let password = "<pw>;
    let hwid = "<hwid>";
	
    // Create a new hwid, will require 2fa
    //let hwid = generate_hwid();
    //let mut file_hwid = File::create("hwid.txt")?;
    //let byte_hwid = hwid.as_bytes();
    //file_hwid.write_all(byte_hwid)?;

    let t = match Tarkov::login(email, password, &hwid).await {
        Ok(t) => Ok(t),
        Err(Error::LoginError(e)) => match e {
            // 2FA required!
            LoginError::TwoFactorRequired => {
                // Get 2FA from email (or generate TOTP) then continue...
		let mut code = String::new();
		println!("Input 2FA:");
		io::stdin().read_line(&mut code).expect("Failed to read input");
		let len = code.trim_end_matches(&['\r', '\n'][..]).len();
		code.truncate(len);
		println!("{}", &code);
                Tarkov::login_with_2fa(email, password, &code, &hwid).await
            }
            _ => Err(e)?,
        },
        Err(e) => Err(e),
    }?;

    println!("{}", t.session);
	
    let sess = Tarkov::from_session(&t.session);

    // Find and select PMC profile to complete login.
    let profiles = sess.get_profiles().await?;
    let profile = profiles
        .into_iter()
        .find(|p| p.info.side != Side::Savage)
        .unwrap();
    sess.select_profile(&profile.id).await?;

    // Fetch the translation table for market categories.
    let locale = sess.get_i18n("en").await?;



    // Fetch items and write to file	
    let items = sess.get_items().await?;
    let file_items = File::create("items.txt")?;
    serde_json::to_writer(file_items, &items)?;
    Ok(())
}

Own offers list?

How to get own offers list? In game we have separate tab with own offers, so looks like we can add some parameter to our filter in search request?

How to get session from EFT launcher?

I can't auth. I've tried to sniffing traffic from EFT client, but it's HTTPS with cerificate verification. When I'm trying to use Charles for example - I got error in EFT client (Certificate invalid).

.

.

Deserialize `data` after checking error code

EFT devs are bad at using JSON properly and sometimes the data type may differ a lot

[2020-01-21T00:02:06Z DEBUG tarkov::auth] Response: {"err":214,"errmsg":"214 - Enter captcha","data":{"captchaRequired":true}}
Error: Json(Error("missing field `aid`", line: 1, column: 73))

Fix this by not deserializing data unless err is 0.

Grab session from EFT launcher.

Sorry for perseverance. Few days I'm trying to grab this session from EFT launcher.

  1. I've tried to use "undetected version" of Cheat Engine, but I can't scan EFT memory(secuity feature?)
  2. I've tried to scan some CEFsharp files. I opened few SQL files, but got nothing

Do you have any tips, how to grab it? Please, it's very important.
Thank you.

No connections available error

I got this error when try to launch example of auth_basic.
Error: SendRequestError(Connect(Resolver(ResolveError { inner: ProtoError { inner: No connections available } proto error })))

Best way to count roubles?

Just found this project, have been poking around it for a bit, what's the best way to count total roubles balance in a profile?

Character level restrictions

Hello everyone!
In the current version of the game, I cannot get access to the flea marketplace until I reach 10 lvl.
I wondering is it possible to buy the standard game edition with 1 lvl character and use this tool to collect item prices on the flea market with 1 lvl game account? In this way, I am trying to prevent ban of my primary account.

More enums

There's a few types that can be converted to enums. Investigate further and use enums > strings.

  • AllowSpawnOnLocations
  • Currency

Can't get_profiles

let t = Tarkov::login("working email", "working password", "some generated hwid").await?;
    println!("{}", t.session);

    // Find and select PMC profile to complete login.
    let profiles = t.get_profiles().await?;


results in

SOME SESSION ID (showing that it can log in)
Error: Json(Error("invalid type: floating point `1.15`, expected u64", line: 1, column: 436688))

Help with certificate pinning?

Hey there, interested in reverse engineering more of the API and extending off of this repo but Iโ€™m kind of a beginner in this realm, any pointers in how to get around the certificate pinning so I can sniff the in game traffic? How were you able to determine the in game endpoints and payloads to send (with the ragfair and market for example)

handshake failed

Hi!
I realy like this project.
when i try to run your example i get this message:

cargo run --example auth_2fa
Finished dev [unoptimized + debuginfo] target(s) in 0.14s
Running `target\debug\examples\auth_2fa.exe`
Error: SendRequestError(Connect(Io(Custom { kind: Other, error: "the handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed:.\\ssl\\s3_clnt.c:1269:: unable to get local issuer certificate" })))
error: process didn't exit successfully: `target\debug\examples\auth_2fa.exe` (exit code: 1)```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.