mirror of
https://github.com/gopher64/gopher64.git
synced 2026-11-12 09:09:01 +01:00
more
This commit is contained in:
1 parent
9aa6b3a58c
commit
1e337b8540
2 files changed
+5
-10
No files matched your search
+3
-5
@@ -219,7 +219,7 @@ pub fn run(args: Args, arg_count: usize) -> std::io::Result<()> {
|
||||
ra_config.leaderboard,
|
||||
);
|
||||
|
||||
let (tx, rx) = tokio::sync::oneshot::channel::<bool>();
|
||||
let (tx, mut rx) = tokio::sync::oneshot::channel::<bool>();
|
||||
if let Some(password) = args.ra_password {
|
||||
retroachievements::login_user(username, password, tx);
|
||||
} else if !ra_config.token.is_empty() {
|
||||
@@ -228,10 +228,8 @@ pub fn run(args: Args, arg_count: usize) -> std::io::Result<()> {
|
||||
tx.send(false).unwrap();
|
||||
}
|
||||
|
||||
let join_handle = tokio::spawn(async move { rx.await.unwrap() });
|
||||
tokio::runtime::Handle::current()
|
||||
.block_on(join_handle)
|
||||
.unwrap();
|
||||
while rx.try_recv().is_err() {}
|
||||
|
||||
ra_config
|
||||
} else {
|
||||
retroachievements::RAConfig::default()
|
||||
|
||||
@@ -145,15 +145,12 @@ pub fn load_game(
|
||||
Option<tokio::sync::watch::Sender<()>>,
|
||||
Option<tokio::task::JoinHandle<()>>,
|
||||
) {
|
||||
let (tx, rx) = tokio::sync::oneshot::channel::<bool>();
|
||||
let (tx, mut rx) = tokio::sync::oneshot::channel::<bool>();
|
||||
unsafe {
|
||||
let tx_ptr = Box::into_raw(Box::new(tx)) as *mut std::ffi::c_void;
|
||||
ra_load_game(rom.as_ptr(), rom_size, tx_ptr);
|
||||
};
|
||||
let join_handle = tokio::spawn(async move { rx.await.unwrap() });
|
||||
tokio::runtime::Handle::current()
|
||||
.block_on(join_handle)
|
||||
.unwrap();
|
||||
while rx.try_recv().is_err() {}
|
||||
|
||||
let mut c_title = std::ptr::null();
|
||||
let mut c_image_url = std::ptr::null();
|
||||
|
||||
Reference in new issue
Block a user