debug logging
All checks were successful
Build and Test / wii-sports-club (push) Successful in 3m48s
Build and Test / minecraft-wiiu (push) Successful in 3m55s
Build and Test / splatoon (push) Successful in 4m4s
Build and Test / mario-tennis (push) Successful in 4m5s
Build and Test / sonic-transformed (push) Successful in 4m6s
Build and Test / friends (push) Successful in 4m5s
Build and Test / fast-racing-neo (push) Successful in 4m6s
Build and Test / puyopuyo (push) Successful in 4m6s
Build and Test / splatoon-testfire (push) Successful in 4m21s
Build and Test / wii-u-chat (push) Successful in 4m21s
Build and Test / super-mario-maker (push) Successful in 5m6s

This commit is contained in:
Maple Nebel 2026-06-22 14:55:43 +02:00
commit 09f8d33e0c

View file

@ -1,15 +1,15 @@
use crate::grpc::account::Error::SomethingHappened; use crate::grpc::account::Error::SomethingHappened;
use json::{JsonValue, object}; use json::{JsonValue, object};
use nex_account::grpc::Pid;
use nex_account::grpc::nex_account_service_client::NexAccountServiceClient;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use rnex_core::PID; use rnex_core::PID;
use std::array::TryFromSliceError; use std::array::TryFromSliceError;
use std::ops::Deref; use std::ops::Deref;
use std::{env, result};
use std::sync::LazyLock; use std::sync::LazyLock;
use std::{env, result};
use thiserror::Error; use thiserror::Error;
use tokio::task::{JoinError, spawn_blocking}; use tokio::task::{JoinError, spawn_blocking};
use nex_account::grpc::nex_account_service_client::NexAccountServiceClient;
use nex_account::grpc::Pid;
use tonic::transport::Channel; use tonic::transport::Channel;
static API_KEY: Lazy<String> = Lazy::new(|| { static API_KEY: Lazy<String> = Lazy::new(|| {
@ -52,15 +52,19 @@ pub struct Client(NexAccountServiceClient<Channel>); //(reqwest::Client);
impl Client { impl Client {
pub async fn new() -> Result<Self> { pub async fn new() -> Result<Self> {
let client = NexAccountServiceClient::connect(NEX_ACCOUNT_URL.as_str()) let client = NexAccountServiceClient::connect(NEX_ACCOUNT_URL.as_str()).await?;
.await?;
Ok(Self(client)) Ok(Self(client))
} }
pub async fn get_nex_key(&mut self, pid: PID) -> Result<[u8; 16]> { pub async fn get_nex_key(&mut self, pid: PID) -> Result<[u8; 16]> {
let prekey = self.0.get_nex_key_by_pid(Pid{pid}).await?.into_inner(); let prekey = self.0.get_nex_key_by_pid(Pid { pid }).await?.into_inner();
let nexkey: [u8; 16] = prekey.key.try_into().map_err(|_| Error::SomethingHappened)?; println!("{:?}", prekey);
let nexkey: [u8; 16] = prekey
.key
.try_into()
.map_err(|_| Error::SomethingHappened)?;
Ok(nexkey) Ok(nexkey)
} }