An open source server for Super Mario Bros. 35

Related tags

Miscellaneous SMB35
Overview

SMB35

A custom server for Super Mario Bros. 35

This server is highly experimental. Do not expect it to work without flaws.

To try it out, simply copy the patch folder into /atmosphere/exefs_patches and play the game. The patch redirects the game to smb35.ymar.dev:20000, which is where I am hosting the game server. It also disables most bcat and prepo calls that are made by the game.

The dashboard is hosted at https://smb35.ymar.dev:20002. Here you can check out if anyone is currently playing the game.

If you encounter any bugs, please submit an issue or pull request on github.

Comments
  • Is it compatible with Switch Emulators?

    Is it compatible with Switch Emulators?

    Hey there,

    Been trying to test it with both Ryujinx and Yuzu and i haven't been able to get it working but i am not sure i have set it up properly.

    Could you confirm that it works with either ?

    opened by Vaskiemaia 48
  • Not an issue with SMB35, but rather Splatoon 2's Global Testfire ~ See below

    Not an issue with SMB35, but rather Splatoon 2's Global Testfire ~ See below

    Hey! This isn't exactly an issue with Super Mario Bros. 35

    I was trying to adapt this custom server to the Splatoon 2 Global Testfire, and I managed to get the console to connect to my PC which is hosting the server, but then I realized that it was just giving me error 2306-0102, (only when I had the server up of course). And yes, I have indeed changed the access key to match that of the testfire. Also, I've placed an image of the error screen at the bottom of this post.

    From what I can tell, there are a few needed funcs that aren't yet implemented... Is there any chance you could perhaps implement a few of them? I tried making some adjustments but I had no luck. I'm thinking its just a few authentication funcs. Maybe matchmaking eventually, but I'm not worried about that yet haha. I'm assuming that I should probably also mention that handle_validate_and_request_ticket_with_custom_data is where it's failing.

    If you need more info, lemme know!

    Global Testfire Patches

    Here are the patches that I've made ~~ Feel free to test them if you'd like.

    • Patchtext file
    @nsobid-0F129135D8A7621C9E4940B0C3808BF0
    @flag offset_shift 0x0
    #Splatoon 2 Global Testfire
    
    //Set Custom Server URL
    @enabled
    024FC706 "192.168.4.156:20000"
    
    //nn::nex::JobAcquireNsaIdToken::StepWaitingForGetGameAuthentication(void)+9C -> Replace GetResult call with MOV X0, XZR
    @enabled
    01132844 E0031FAA
    
    //force branch at "CBZ W8, loc_7101132844"
    @enabled
    01132924 08000014
    
    • Skyline hook to disable SSL & log calls to QLOG (I now realize that there is a thing you can use to disable it system-wide, but I'm sharing this anyways)
    typedef u32 CURLcode;
    typedef void CURL;
    enum CURLoption { };
    CURLcode (*original_curl_easy_perform)(CURL *curl);
    CURLcode curl_easy_perform_hook(CURL *curl)
    {
        u64 curl_easy_setopt_addr;
        nn::ro::LookupSymbol(&curl_easy_setopt_addr, "curl_easy_setopt");
        
        skyline::TcpLogger::SendRaw("curl_easy_perform() was called!\n");
        // yes I'm aware this is disgusting.
        ((CURLcode (*)(CURL *curl, CURLoption curlopt, long val))curl_easy_setopt_addr)(curl, (CURLoption)64, 0L);
        return original_curl_easy_perform(curl);
    }
    Result (*original_nnNexQLOG_func)(int logLevel, const char* message, ...);
    Result nnNexQLOG_hook(int logLevel, const char* message, ...)
    {
        va_list argptr;
        va_start(argptr, message);
        char s[0x100];
        int maxlen = 255;
        Result result = vsnprintf(s, maxlen, message, argptr);
        va_end(argptr);
    
        skyline::TcpLogger::SendRawFormat("[Log Level %d]: %s\n", logLevel, s);
        return original_nnNexQLOG_func(logLevel, s);
    }
    
    int main() {
        u64 curl_easy_perform_addr;
        nn::ro::LookupSymbol(&curl_easy_perform_addr, "curl_easy_perform");
        A64HookFunction(
            reinterpret_cast<void*>(curl_easy_perform_addr),
            reinterpret_cast<void*>(curl_easy_perform_hook),
            (void**) &original_curl_easy_perform
        );
    
        u64 nnNexQLOG_addr;
        nn::ro::LookupSymbol(&nnNexQLOG_addr, "_ZN2nn3nex5_QLOGENS0_8EventLog8LogLevelEPKcz");
        A64HookFunction(
            reinterpret_cast<void*>(nnNexQLOG_addr),
            reinterpret_cast<void*>(nnNexQLOG_hook),
            (void**) &original_nnNexQLOG_func
        );
    }
    

    Error Screen

    2021112416225400-1AB131B6E6571375B79964211BB3F5AE

    opened by Sheldon10095 22
  • Disconnected players stay in the game, become

    Disconnected players stay in the game, become "immortal", and defeat all players

    We noticed in several games, some people would be frozen in place, never time out, and beat us all after we reach fastest red timer and time out.

    At first we thought it was a hacker, until one of us got a connection error and also had the same result.

    Now we can reproduce it reliably: Steps to reproduce:

    1. Have 2 or more players join a lobby, then wait until the game starts
    2. One player presses the home button, closes the game by pressing X.
    3. That player is now "immortal" in the game, will never run out of time, and cannot be beaten by the remaining players.

    This is the error that appears once they close the game: Screen Shot 2021-05-30 at 6 15 46 PM

    And of course, this initiates the ClosedResourceError stacktrace spam until the end of the game Screen Shot 2021-05-30 at 6 17 52 PM

    opened by just-another-random-person 9
  • Participants Limit

    Participants Limit

    Hello kinnay, i have a question to participants, is it possible to limit the max participants from ( 35 ) to ( 5 )for example ? It is a good feature for nearly server test

    opened by PhynixP 7
  • Licensed as GPLv3, should be AGPLv3

    Licensed as GPLv3, should be AGPLv3

    In a scenario such as this where its server software under GPLv3 hosting a server does not qualify as "distributing" and therefore does not actually require source code to be made public.

    It should instead be licensed under AGPLv3, which contains an affero clause, which also makes distribution of services over a network such as the internet qualify as "distributing".

    In its current state it may as well be public domain with no protections on it due to its nature.

    opened by Nolij 5
  • this alternative server method to do in other games?

    this alternative server method to do in other games?

    I was wondering if this method you used to use an alternative server instead of the nintendo server is possible to be used in other games like: splatoon, smash, mario kart ...

    opened by FelipeBand657 4
  • Spectating doesn't work, all players except the last two get Error 2306-0103 upon death

    Spectating doesn't work, all players except the last two get Error 2306-0103 upon death

    So we've managed to get a few friends set up their Switch to connect to our own hosted private server, and we finally had around 3-5 players a lot of the time.

    We were wondering why almost everyone except the final two players would always immediately get an Error 2306-0103 upon death.

    So it seems spectating is broken, anyone who would end up in spectate mode instead gets that error.

    One of them suggested it might be because of the game trying to submit coin rankings to the (non-existent) coin leaderboard. But I decided to check the logs and it was: WARNING:nintendo.nex.matchmaking_eagle:MatchmakeRefereeServer.end_round_with_partial_report not implemented Screen Shot 2021-05-30 at 3 59 05 PM

    Is there a quick way we can fix it so spectating works (if the issue is the coin leaderboard thing as they guessed)? We plan to implement coin leaderboards eventually (even via something simple like SQLite), but for now, we hope to get spectating working at least since that's most of the fun of the game.

    Also, when someone gets the error, the server just keeps spamming stacktraces (ClosedResourceError) in the log until the game ends (not sure if this is helpful):

    Screen Shot 2021-05-30 at 4 00 12 PM

    Thanks for any help, and also thanks so much for writing the server code! It's amazing!

    opened by just-another-random-person 3
  • Error 2623-1011 on round start after matchmaking

    Error 2623-1011 on round start after matchmaking

    When connecting to my server, matchmaking works (players that join and leave show up properly, late joining players get the correct gamestart countdown time).

    However, once countdown finishes, and game is about to start with "Here we go..." message, game doesn't start and instead clients get an "Error 2623-1011".

    No visible errors are seen in the server logs (with either logging.INFO or logging.DEBUG levels).

    My setup

    • Brand new clean Ubuntu 20.04 VPS
      • nothing installed except python3 (Python 3.8.5 according to --version), pip-python3, git, and snap/certbot
      • Used git clone on https://github.com/kinnay/NintendoClients/
      • Ran "pip3 install ." in the cloned folder, successfully with seemingly no errors
      • Used git clone on https://github.com/kinnay/SMB35
      • Created "resources" folder inside the cloned folder, and copy-pasted all the generated *.pem files into it, which were generated as so:

    image

    • Then, I simply ran "python3 main.py"

    Below are the consoles I used to connect:

    • Console 1:

      • version 12.0.0|AMS M.19.3|E in settings
      • brand new clean Atmosphere install, added nothing except
        • exosphere.ini for emummc prodinfo blanking
        • my own IPS in atmosphere/exefs_patches/patch
        • 90DNS set up in the emuMMC
    • Console 2:

      • version 11.0.1|AMS M.19.3|E
      • brand new clean Atmosphere install, added nothing except
        • exosphere.ini for emummc prodinfo blanking
        • my own IPS in atmosphere/exefs_patches/patch
        • 90DNS set up in the emuMMC

    Also, Hekate's "Fix Arch Bit" is used afterwards every time files are copied over.

    The IPS patch file I am using was created like so:

    image

    After they connected, during matchmaking, they show up properly on the dashboard:

    image

    Below is the logging.INFO log, from startup all the way up to Error 2623-1011

    image image

    Here is the logging.DEBUG log (note at the end I close the software on both Switches):

    • https://pastebin.com/raw/DdcHVif5

    More Testing:

    • I replaced the patch file with the stock one that redirects to "smb35.ymar.dev:20000", and the game works properly after matchmaking.
      • Nothing else was replaced/changed except the patch file.
    • I replaced the patch file with one I created to connect to "bluephynix.de:20000", the person in the other issue. The game works properly after matchmaking.
    • Replaced it back with my own patch file and I get "Error 2623-1011" when the game is about to switch from matchmaking to relay server mode.
      • Matchmaking works perfectly (leaving, rejoining, etc. shows up properly, as well as the reduced countdown timer), can also play Practice mode.

    It must be something with my setup, but my setup is pretty barebones as it is

    • nothing on the VPS but python3 and let's encrypt certificate from certbot (no webserver even)
    • ports are confirmed open (matchmaking works, dashboard works)
    • clean Atmosphere installs on Switches
    • replacing the patch file with other servers works (ymar and bluephynix patch files work)

    I've tried it on other VPS boxes I had access to (even tried it on an OSX box with Python 3.7), as well as some other certs available to me, and I get the same error. But it instantly works once I point it to those two known working servers. EDIT: Just tried to update my VPS to Python 3.9 and run it there, still got the same error code.

    I hope you can help me figure this out.

    opened by just-another-random-person 3
  • error code 2306-0103

    error code 2306-0103

    Does not happen with 2 players When 3 players, At the beginning of the game, Player A runs to commit suicide show error

    WARNING:nintendo.nex.matchmaking_eagle:MatchmakeRefereeServer.end_round_with_partial_report not implemented
    WARNING:nintendo.nex.rmc:RMC failed: Core::NotImplemented (0x80010002)
    ERROR:nintendo.nex.prudp:Packet timed out: <PRUDPPacket type=TYPE_DATA flags=NEED_ACK,RELIABLE,HAS_SIZE seq=36 frag=0>
    INFO:nintendo.nex.rmc:Connection was closed
    INFO:nintendo.nex.notification:NotificationClient.process_notification_event()
    INFO:nintendo.nex.messaging:MessageDeliveryServer.deliver_message()
    INFO:nintendo.nex.messaging:MessageDeliveryClient.deliver_message()
    INFO:nintendo.nex.messaging:MessageDeliveryClient.deliver_message()
    

    when B and C wait in place until the time is up: show error:

    ERROR:anynet.util:An exception occurred
    Traceback (most recent call last):
      File "C:\Python38\lib\site-packages\anyio\streams\memory.py", line 79, in receive
        return self.receive_nowait()
      File "C:\Python38\lib\site-packages\anyio\streams\memory.py", line 74, in receive_nowait
        raise WouldBlock
    anyio.WouldBlock
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Python38\lib\site-packages\anynet\util.py", line 86, in catch
        yield
      File "F:\SMB35\source\eagle.py", line 293, in handle
        await client.process()
      File "F:\SMB35\source\eagle.py", line 84, in process
        data = await self.client.recv()
      File "C:\Python38\lib\site-packages\anynet\websocket.py", line 275, in recv
        return await self.binary_packets.get()
      File "C:\Python38\lib\site-packages\anynet\queue.py", line 18, in get
        return await self.stream.receive()
      File "C:\Python38\lib\site-packages\anyio\streams\stapled.py", line 61, in receive
        return await self.receive_stream.receive()
      File "C:\Python38\lib\site-packages\anyio\streams\memory.py", line 99, in receive
        raise EndOfStream
    anyio.EndOfStream
    INFO:nintendo.nex.matchmaking_eagle:MatchmakeRefereeServer.end_round()
    INFO:nintendo.nex.matchmaking_eagle:MatchmakeRefereeServer.end_round()
    INFO:nintendo.nex.matchmaking_eagle:MatchMakingServerExt.end_participation()
    INFO:nintendo.nex.notification:NotificationClient.process_notification_event()
    INFO:nintendo.nex.matchmaking_eagle:MatchMakingServerExt.end_participation()
    INFO:anynet.websocket:WS server is closed
    INFO:nintendo.nex.messaging:MessageDeliveryServer.deliver_message()
    WARNING:nintendo.nex.rmc:RMC failed: RendezVous::SessionVoid (0x80030073)
    
    opened by ffsaga 2
  • DNS-only route with no RCM hacks?

    DNS-only route with no RCM hacks?

    Is it possible that this open source server is made workable by only DNS modding? E.g. a DNS server that serves your server IP instead of the actual Arika/Nintendo one? I believe it will be possible and you should focus on this. I prefer to not mod my switch and it will be much more accessible for everyone if possible.

    opened by petersvp 2
Owner
Yannik Marchand
Yannik Marchand
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
Transform a Google Drive server into a VFX pipeline ready server

Google Drive VFX Server VFX Pipeline About The Project Quick tutorial to setup a Google Drive Server for multiple machines access, and VFX Pipeline on

Valentin Beaumont 17 Jun 27, 2022
📙 Super lightweight function registries for your library

catalogue: Super lightweight function registries for your library catalogue is a tiny, zero-dependencies library that makes it easy to add function (o

Explosion 139 Jan 2, 2023
Minimal, super readable string pattern matching for python.

simplematch Minimal, super readable string pattern matching for python. import simplematch simplematch.match("He* {planet}!", "Hello World!") >>> {"p

Thomas Feldmann 147 Dec 1, 2022
Removes all archived super productivity tasks. Just run the python script.

delete-archived-sp-tasks.py Removes all archived super productivity tasks. Just run the python script. This is helpful to do a cleanup every 3-6 month

Ben Herbst 1 Jan 9, 2022
A free and open-source chess improvement app that combines the power of Lichess and Anki.

A free and open-source chess improvement app that combines the power of Lichess and Anki. Chessli Project Activity & Issue Tracking PyPI Build & Healt

null 93 Nov 23, 2022
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python ?? A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

Machine Learning Tooling 2.7k Jan 3, 2023
TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner.

TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner

GonVas 180 Oct 8, 2022
Open source home automation that puts local control and privacy first

Home Assistant Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiast

Home Assistant 57k Jan 2, 2023
Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed

⚠️ The Nimbus infrastructure project is no longer under development. ⚠️ For more information, please read the news announcement. If you are interested

Nimbus 194 Jun 30, 2022
World's best free and open source ERP.

World's best free and open source ERP.

Frappe 12.5k Jan 7, 2023
Backend/API for the Mumble.dev, an open source social media application.

Welcome to the Mumble Api Repository Getting Started If you are trying to use this project for the first time, you can get up and running by following

Dennis Ivy 189 Dec 27, 2022
A deployer and package manager for OceanBase open-source software.

OceanBase Deploy OceanBase Deploy (简称 OBD)是 OceanBase 开源软件的安装部署工具。OBD 同时也是包管理器,可以用来管理 OceanBase 所有的开源软件。本文介绍如何安装 OBD、使用 OBD 和 OBD 的命令。 安装 OBD 您可以使用以下方

OceanBase 59 Dec 27, 2022
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 7, 2023
Open source tools to allow working with ESP devices in the browser

ESP Web Tools Allow flashing ESPHome or other ESP-based firmwares via the browser. Will automatically detect the board type and select a supported fir

ESPHome 195 Dec 31, 2022
PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

PyMedPhys 238 Dec 27, 2022
La version open source du bot Discord Sblerboy

Sblerboy-Open-Source La version open source du bot Discord Sblerboy Sblerboy est un bot Discord permettant de jouer à des jeux de Gameboy directement

null 15 Nov 19, 2022
An open-source Python project series where beginners can contribute and practice coding.

Python Mini Projects A collection of easy Python small projects to help you improve your programming skills. Table Of Contents Aim Of The Project Cont

Leah Nguyen 491 Jan 4, 2023
🍬️🦇️ Open source Trick or Treat! 🦇️🍬️

Open Source Halloween! What's an easy way to have fun, and celebrate an open source Halloween? Open source trick or treating, of course! The repositor

Research Software Engineers 3 Oct 18, 2021