Skip to content

Commit

Permalink
fix integration with training mode plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Naxdy committed Feb 21, 2024
1 parent a3c392f commit 0bc3393
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 73 deletions.
20 changes: 9 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "latency-slider-de"
version = "0.2.0"
name = "zlatency-slider-de"
version = "0.2.1"
authors = []
edition = "2021"

Expand All @@ -14,8 +14,6 @@ crate-type = ["cdylib"]
ninput = { git = "https://github.com/blu-dev/ninput", version = "0.1.0" }
skyline_smash = { git = "https://github.com/jugeeya/skyline-smash.git", branch = "patch-2" }
skyline = { git = "https://github.com/ultimate-research/skyline-rs.git" }
paste = "1.0.14"
lazy_static = "1.4.0"

[profile.dev]
panic = "abort"
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ Nix will download and make available all the necessary dev tools for you to buil

If there are any Nix enjoyers out there who feel like packaging skyline's rust toolchain so we don't have to rely on `cargo-skyline` anymore and can introduce fully reproducible builds, feel free to submit a pull request! If there are any modding enjoyers out there who want to expand upon this plugin, feel free to do the same!

## FAQ

#### Am I allowed to modify / redistribute this software?
Yes, so long as you also publish the source code of your modification. View details in the [license](LICENSE).

#### Will this format my SD Card?
No. But don't take my word for it, the source is available for anyone to see. Feel free to analyze it yourself, or have someone you trust do it for you. Don't use my binary, but compile it yourself (or, again, have someone you trust do it for you). This is one of the benefits of open source, you don't *have* to trust, you can verify.

#### Will I get banned if I use this mod on qp / in arenas?
The short answer is "I don't know, but probably not". The slightly longer answer is that using any mod (online or offline) carries risks with it. However, I think that the biggest risk when using this mod is other people finding out you have it (e.g. because you publicly posted a screenshot with the latency slider text visible) and proceeding to mass report you to Nintendo. Like the original, the mod doesn't send any extra network packets (arenas or otherwise), so short of Nintendo scanning your SD card, there shouldn't be any way to automatically detect it.

#### Are you fine with people using this mod to cheat in online tournaments, or on qp?
The short answer is "how people use this mod is up to them". The long answer is this: First, for quickplay, I don't view using this mod as cheating, but rather making the game playable, since there's nothing on the line (if you think GSP holds any meaningful value, I suggest an immediate and thorough psych evaluation), same as in arenas.

When it comes to online tournaments, for those without prizes my views are the same as those for quickplay. Now, for the others, I am of the opinion that those with significant prizes should have died together with COVID lockdowns. The reason is that online, even without any sort of mods, is inherently random and unfair. Network interference, packet loss, and all the fun things aside, since SSBU determines the input delay on the client side, it is entirely possible that two players play the game with different input delays as is, even without the latency slider. So, if anything, latency slider makes online tournaments *fairer*, but only if both players have it and set it to the same delay, of course. Note that I said *fairer* and not *fair*, because you still have random lag spikes which may impact one player more than the other (e.g. if a huge lag spike happens during Ness' PK thunder recovery, or during a frame-tight combo).

Additionally, even without latency slider, there are mods (software and hardware) you can use to reduce your input delay when playing with others (both on quickplay and in arenas). `less-delay` just shaves off 1 frame of input delay no matter the game mode (even offline), and there are 3rd party GC adapters that, at best, improve input delay by another frame and, at worst, make the controller input delay much more consistent than the OG.

The bottom line here is that online tournaments have never been - and will never be - "fair", and if there's a will to cheat, there's a way (even without this mod). Unless you can ensure a 100% stable connection, equal and consistent input delay for both parties, and proctor all players to ensure they aren't using any special hardware to improve their play, this entire discussion is pointless to me.

## Final Note

This fork is published under the original project's AGPL license. Though I pinky promise to never take this repo offline or privatize the source code in any way, I encourage you to fork it and re-share it as much as your heart desires.
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#![feature(restricted_std)]

use offsets::OFFSET_DRAW;
use skyline::hooks::InlineCtx;
use skyline::nn::ui2d::{Layout, Pane};
use smash::ui2d::{SmashPane, SmashTextBox};

mod offsets;

#[skyline::from_offset(0x37a1ef0)]
unsafe fn set_text_string(pane: u64, string: *const u8);

Expand Down Expand Up @@ -86,7 +83,7 @@ unsafe fn non_hdr_update_room_hook(_: &skyline::hooks::InlineCtx) {
}
}

#[skyline::hook(offset = *OFFSET_DRAW)]
#[skyline::hook(offset = 0x004b620)]
unsafe fn handle_draw_hook(layout: *mut Layout, draw_info: u64, cmd_buffer: u64) {
// let layout_name = skyline::from_c_str((*layout).layout_name);
let root_pane = &mut *(*layout).root_pane;
Expand Down
54 changes: 0 additions & 54 deletions src/offsets.rs

This file was deleted.

0 comments on commit 0bc3393

Please sign in to comment.