Giter VIP home page Giter VIP logo

3ds-rpc's Introduction

3DS Discord Rich Presence

Display your 3DS game status on Discord!

This README will be split into two sections:

Notice

By using this app, you agree to the terms listed in TERMS.md.

Credits

This project connects to a self-hosted API (or one provided by me) and fetches data received by mimicking a real 3DS connecting to the friends service and receiving friend data.
I'd like to thank:

  • kinnay and his NintendoClients
    • NintendoClients is what this program uses to pretend to be a real 3DS.
  • hax0kartik and his 3dsdb
    • 3dsdb is an open-source project that includes data about games on the eShop. A modified version of it is used to retrieve the game's name and icon url.
  • HEYimHeroic and her mii2studio
    • mii2studio is a command line tool written in Python that allows the user to convert between various versions of Nintendo Mii formats. I have created a modified version of it internally to convert CFSD (really, MiiData) to Mii Studio code.
  • jaames and his mii-qr.py
    • mii-qr.py is a Python script that converts from the encrypted QR code format to normal CFSD. For whatever reason, a direct connection to the friends service on the 3DS returns a QR code, so this is insanely useful. Thank you.
  • qwerty for her pypresence
    • pypresence is a useful Python module that allows developers to connect their games to Discord via Python. It is how 3DS-RPC sends Rich Presence data to Discord.
  • StartBootstrap for their startbootstrap-sb-admin
    • startbootstrap-sb-admin is a template using bootstrap which is how I created the friends network website!
  • MrGameCub3 for resource design!
    • He made all of the pretty things :) -- except for the app's GUI. I did that. But the pretty logos were his!

Quickstart Guide

3DS-RPC has been updated to support Mobile users and to work without a Desktop client open!

  1. Open the website 3dsrpc.com and click on the icon in the top right-hand corner, then choose Register. By following the steps on the website, you will be able to connect your target Discord account to 3DS-RPC.

  2. After doing so, enter your consoles menu by clicking on your PFP in the top-right corner and choosing "'s consoles".

  3. In the consoles menu, select "Register Friend Code" and follow the on-screen instructions. After doing so, click "Add To Consoles".

  4. You can change which consoles you'd like to enable, if any, in the consoles menu!

Tutorial GIF (which is STILL pronounced 'gif', not 'jif')

If you'd still like to use the Desktop Client instead of linking your Discord account, that's still an option! You can do so by following the instructions below:

Using the Desktop Client

Download the app from the latest release and run!
Once ran, the app will ask for you to add a friend on your Nintendo 3DS. This is for the express purpose of pulling your currently playing Nintendo game.

  1. Open Discord first, and then open 3DS-RPC

  2. Add the bot's friend code provided

  3. Enter your own friend code when prompted

  4. Profit! - Each update is around every ~30 seconds (keep in mind, the backend is updating at a different rate than the client, so this may vary). They are automatic, but it may take upwards of one minute after the program begins. To make certain that everything is in order, check your 3DS' friends list to verify the bot account has added you back.

Tutorial GIF (which is pronounced 'gif', not 'jif')

FAQ

If none of the below Qs and As help with your problem, feel free to file an issue. Alternatively, you can join the 3DS-RPC Discord server for a better back-and-forth method of communication with me!

Q: Whenever I play a game, 3DS-RPC won't change from the home screen!
A: Firstly, try waiting ~30 seconds, as the application has a fairly slow response time. Secondly, make sure that you've enabled "Show friends what you're playing?" on your 3DS' friends app.

Please don't DDoS me...

In-depth guide

Building

For Windows, run

cd .\3DS-RPC\client\scripts
.\build.bat

For MacOS, run

cd ./3DS-RPC/client/scripts
chmod +x build.sh
./build.sh

*(Make sure you have python3 and pip installed)

Understanding

The intricacies of this project are deep and innumerable. I started this project some weeks before October 16th (at least since kinnay/NintendoClients#88), when I published the first commit on this repository. I have records of the sheer amount of pain I have undergone to create this (see 2d1ad37, everything on Feb 11th, this thing, and oh so much more), but somehow, I prevailed.

Anywho, none of this matters for the in-depth 'guide'. If you are looking at this guide because you can't figure something out or are having an error, please check the FAQ, join my Discord server, or file an issue. Instead, we're going to be looking at the inner-workings of the project.

So sit back, relax, and wait because, chances are, this guide is either unfinished or out-of-date.

The Beast

Let's get to the good part, shall we?

Basic control structure:

just a diagram

3ds-rpc's People

Contributors

mcmi460 avatar okzyrox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3ds-rpc's Issues

Site is down (502)

Nothing much to say, the web site is down since yesterday with 502-Bad Gateway

not displaying that i'm playing smb2 after almost an hour

so basically, after i get my discord hooked up and everything, it shows that i was playing home screen, which was normal, since i was on the home screen after i added the bot. but, when i started playing smb2 on my 2ds, even after almost an hour it would not show up. it still said i was playing home screen. what's going on ;-;

edit: i also noticed that the bot is offline in my friends list, yet it shows that i'm online

[Request] Add Pretendo support

I want to be able to use this while using Pretendo but it says the bot's friend code is invalid (makes sense because different server), It'd be useful to add support for Pretendo users, plus the fact Nintendo is shutting down the official servers next year would require this addition.

Readline Not Available For Windows

          oh, no now i got `Traceback (most recent call last):

File "C:\Users\Liam\Documents\GitHub\3DS-RPC\client\client.py", line 8, in
from api import *
File "C:\Users\Liam\Documents\GitHub\3DS-RPC\client..\api_init_.py", line 5, in
from .util import * # utility
File "C:\Users\Liam\Documents\GitHub\3DS-RPC\client..\api\util.py", line 7, in
import readline
ModuleNotFoundError: No module named 'readline'`

Originally posted by @liaminventions in #6 (comment)

Data location

Hi!
I wanted to change the friend code, but even if I delete the client (and his other files), it keep bringing me the old FC, so i supposed that a data file is created somewhere on my computer?

Error building dependencies

When I run python3 -m pip install -r requirements.txt, it fails and says this:

  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/project.py", line 601, in setup
          self.update(tool)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-install-rixjb730/pyqt5_aa8cfda52c6d4c90935a49f5c23ec10e/project.py", line 165, in update
          raise UserException(
      sipbuild.exceptions.UserException
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I'm on macOS 13.2, how do I fix this?

an invalid friend code was passed

I can't seem to add my friend code. all I get is:
Traceback (most recent call last): File "client.py", line 213, in <module> main() File "client.py", line 208, in main raise e File "client.py", line 204, in main client = Client(region, friendCode) File "client.py", line 34, in __init__ friendCode = str(convertPrincipalIdtoFriendCode(convertFriendCodeToPrincipalId(friendCode))).zfill(12) # Friend Code check File "/home/waverider/3DS-RPC/client/../api/love.py", line 24, in convertFriendCodeToPrincipalId if not checkPrincipalIdValidity(checksumByte, principalId): raise FriendCodeValidityError('an invalid friend code was passed') api.love.FriendCodeValidityError: an invalid friend code was passed

`PythonCore::ConversionError (0x80040009)` when fetching (23) GetFriendComment with NintendoClients

(23) GetFriendComment (nintendo.nex.friends.FriendsClientV1.get_friend_comment()) errors with PythonCore::ConversionError (0x80040009) on certain friend codes. I'm working on why, but it may be a faulty implementation of the method on my part.

Error code here in NintendoClients
Traceback:

INFO:nintendo.nex.friends:FriendsClientV1.add_friend_by_principal_ids -> done
INFO:nintendo.nex.friends:FriendsClientV1.get_all_friends()
INFO:nintendo.nex.friends:FriendsClientV1.get_all_friends -> done
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_presence()
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_presence -> done
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_comment()
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_comment -> done
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_mii()
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_mii -> done
INFO:nintendo.nex.friends:FriendsClientV1.get_friend_comment()
An error occurred!
PythonCore::ConversionError (0x80040009)

(Crappy, I know. Don't worry about it)

Initial support for Third-Party Nintendo Network servers : Pretendo

As you probably know, the Nintendo Network servers for the 3DS, won’t be around for a long time, but the community is at work to still keep it alive, by archiving content, and hosting their Nintendo Network server.

https://pretendo.network

Pretendo is just that, and is currently aiming at restoring support for all Nintendo Network features for both platforms, app & game wise (Including, already removed things like the Miiverse). While it isn’t complete, and isn’t really usable entirely, even with the currently established features (as far I’ve tested, but I need to check with them), the Friends system is nearly complete! https://github.com/PretendoNetwork/friends 

As I’m not knowledgeable with this third-party implementation, I can’t say for sure if it’s 1:1 identical in terms of the API (or even, provide an extended API for those features for that matter). So, this is a bit of a vague suggestion to prepare for such thing, as I also don’t know how future-proof the 3DS Friends system will hold up once the official servers are gone for good.

PS: They also work on Wii U support if you are interested. I’ve rejoined your Support Discord server as well, so you can contact me there too.

Invalid Friend Code (#6 all again)

Decided to open an issue as I couldn’t re-open #6 (And didn’t knew if I should have continued there)

Traceback (most recent call last):
  File "/home/pm/Documents/3DS-RPC/client/client.py", line 218, in <module>
    main()
  File "/home/pm/Documents/3DS-RPC/client/client.py", line 205, in main
    raise e
  File "/home/pm/Documents/3DS-RPC/client/client.py", line 201, in main
    client = Client(friendCode, config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pm/Documents/3DS-RPC/client/client.py", line 40, in __init__
    friendCode = str(convertPrincipalIdtoFriendCode(convertFriendCodeToPrincipalId(friendCode))).zfill(12) # Friend Code check
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pm/Documents/3DS-RPC/client/../api/love.py", line 24, in convertFriendCodeToPrincipalId
    if not checkPrincipalIdValidity(checksumByte, principalId): raise FriendCodeValidityError('an invalid friend code was passed')
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api.love.FriendCodeValidityError: an invalid friend code was passed

4425-1804-5982 (Tried with - as well)

User profile not being created

My user profile is not showing up on the site. It has been a day since I have signed up, and the console shows up in my list, but does not do any rich presence.

Site wont create profile

So i have gone through the steps to register my friend code with the site but it never activates the console or creates a profile and i cant even delete it to try again.

Suggestion: PreMiD

i think it would be a lot more accessible and easier to use this if this was in PreMiD.

Releases

There are no releases to download. Can you provide a release or say the steps that are nesesarry to run this?

Friendcode not recognized

I run client.py and what I end up with is "APIException: {'Error': 'friendCode not recognized\nHint: You may not have added the bot as a friend'}" altho I have added it so whats going on here?

i keep getting an access denied error

Traceback (most recent call last):
File "app.py", line 239, in
File "client.py", line 51, in init
PermissionError: [Errno 13] Permission denied: 'C:\Users\moddie\Documents\3DS-RPC\private.txt'

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.