All Projects → spacemeowx2 → Switch Lan Play

spacemeowx2 / Switch Lan Play

Licence: gpl-3.0
Make you and your friends play games like in a LAN.

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Switch Lan Play

Hydrosphere
Ocean beyond the Horizon
Stars: ✭ 17 (-98.58%)
Mutual labels:  switch
Libnx
Library for Switch Homebrew
Stars: ✭ 908 (-24.14%)
Mutual labels:  switch
Esp8266 Wifi Socket
Custom SW for the OBI "Wifi Stecker Schuko"
Stars: ✭ 55 (-95.41%)
Mutual labels:  switch
Pegaswitch
PegaSwitch is an exploit toolkit for the Nintendo Switch
Stars: ✭ 922 (-22.97%)
Mutual labels:  switch
Iconswitch
🍭 Custom Android Switch widget
Stars: ✭ 874 (-26.98%)
Mutual labels:  switch
Tegrarcmgui
C++ GUI for TegraRcmSmash (Fusée Gelée exploit for Nintendo Switch)
Stars: ✭ 965 (-19.38%)
Mutual labels:  switch
Stickyswitch
⭐️ beautiful switch widget with sticky animation ⭐️
Stars: ✭ 725 (-39.43%)
Mutual labels:  switch
Pharaohstroy
A maplestory IDE which can develop the multi-platform maplestory game
Stars: ✭ 69 (-94.24%)
Mutual labels:  switch
React Toggle Switch Demo
Source code for a simple demo app showing how to build a custom toggle switch for React applications.
Stars: ✭ 15 (-98.75%)
Mutual labels:  switch
Vggradientswitch
一个渐变效果的Switch
Stars: ✭ 48 (-95.99%)
Mutual labels:  switch
Awesome Sdn
A awesome list about Software Defined Network (SDN)
Stars: ✭ 841 (-29.74%)
Mutual labels:  switch
Splatoon 2 Meme Mod
Splatoon 2 mod about memes.
Stars: ✭ 11 (-99.08%)
Mutual labels:  switch
Nintimdo Rp 3d models
Autodesk Fussion and stl files
Stars: ✭ 35 (-97.08%)
Mutual labels:  switch
Aiflatswitch
Nicely animated flat design switch alternative to UISwitch
Stars: ✭ 904 (-24.48%)
Mutual labels:  switch
Logisim
Logisim Italian Fork
Stars: ✭ 61 (-94.9%)
Mutual labels:  switch
Vue Js Toggle Button
🍥 Vue.js 2 toggle / switch button - simple, pretty, customizable
Stars: ✭ 836 (-30.16%)
Mutual labels:  switch
Phpnetmap
Web application for ethernet network mapping. PHP Software for network device monitoring with SNMP v(1/2c/3) protocol.
Stars: ✭ 20 (-98.33%)
Mutual labels:  switch
Soundswitch
C# application to switch default playing device. Download: https://soundswitch.aaflalo.me/
Stars: ✭ 1,190 (-0.58%)
Mutual labels:  switch
Zwtopselectvcview
快速导入多个控制器,通过顶部选择菜单切换控制器,实现一个页面多个控制器切换处理.(It's an so easy way to add your all kinds of childControllers into superViewController, then you can slide around or just click on the topButton which is automatically building in the topView to switch your childViewController.)
Stars: ✭ 61 (-94.9%)
Mutual labels:  switch
Ahb3lite interconnect
AHB3-Lite Interconnect
Stars: ✭ 36 (-96.99%)
Mutual labels:  switch

switch-lan-play

Build status Chat on discord

Make you and your friends play games like in a LAN.

                     Internet
                        |
                  [SOCKS5 Proxy] (optional)
                        |
        ARP,IPv4        |          LAN Packets
Switch <-------->  PC(lan-play)  <-------------> Server
                                       UDP

NOTE:

  • This project is in an early stage. The protocol may change frequently.

Usage

To play with your friends, you and your friends should run lan-play client connecting to the same Server on your PC, and set static IP on your Switch.

Your PC and Switch must be connected to the same router.

1. Windows Client

  1. Download and run latest Npcap installer.

  2. Must check Installed in WinPcap API-compatible mode. in Npcap installation wizard.

  3. Download the latest lan-play.exe from releases

  4. Run lan-play.exe

After that, you will prompted to enter a server as shown below:

--relay-server-addr is required
Input the relay server address [ domain/ip:port ]:

You can find a list with public servers here: https://www.lan-play.com/

Optionally you can go to the Switch Lan Play Discord to find people to match make: https://discord.gg/zEMCu5n

2. Switch

  1. Make sure lan-play client is running.

  2. Go to your Switch settings page, set the IP address to static. The IP address can be any from 10.13.0.1 to 10.13.255.254, excepting 10.13.37.1. But don't use the same IP address with your friend.

    IP Address 10.13.?.?
    Subnet Mask 255.255.0.0
    Gateway 10.13.37.1
  3. Click save. Your Switch now can access the Internet via your PC.

  4. Launch your game, hold L+R+LStick to enter lan-play mode. Host or join a game, enjoy!

SOCKS5 Proxy

lan-play --socks5-server-addr example.com:1080

Data sent to the relay server does not pass through the proxy.

Build

Debug or Release

cmake -DCMAKE_BUILD_TYPE=Debug .. cmake -DCMAKE_BUILD_TYPE=Release ..

Ubuntu / Debian

This project depends on libpcap, you can install libpcap0.8-dev on Ubuntu or Debian:

sudo apt install libpcap0.8-dev git gcc g++ cmake

Prepare a cmake, gcc, and run like this:

mkdir build
cd build
cmake ..
make

Windows

Use MSYS2 to compile.

pacman -Sy
pacman -S make \
    mingw-w64-x86_64-cmake \
    mingw-w64-x86_64-gcc

To compile 32bit program:

pacman -S mingw-w64-i686-cmake \
    mingw-w64-i686-gcc

Open MSYS2 MinGW 64-bit or MSYS2 MinGW 32-bit.

mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make

Mac OS

brew install cmake
mkdir build
cd build
cmake ..
make

Server

Docker

docker run -d -p 11451:11451/udp -p 11451:11451/tcp spacemeowx2/switch-lan-play

Node

git clone https://github.com/spacemeowx2/switch-lan-play
cd switch-lan-play/server
npm install
npm run build # build ts to js. run it again when code changed.
npm start

Use --port pass the port parameter, or else it will use 11451/udp as default.

Use --simpleAuth pass the auth via username and password, or else there's no authentication.

Use --httpAuth pass the auth via http url, or else there's no authentication.

Use --jsonAuth pass the auth via json file, or else there's no authentication.

Example:

npm run build
npm start -- --port 10086 --simpleAuth username:password

Meanwhile the monitor service will be started on port 11451/tcp by default, you can get online client count via HTTP request:

Request: GET http://{YOUR_SERVER_IP}:11451/info

Response: { "online": 42 }

Protocol

The protocol is very simple now, but I'm going to add some fileds to calculate network quality(packet loss, ping), like timestamp, seq_id, etc.

struct packet {
    uint8_t type;
    uint8_t payload[packet_len - 1];
};
enum type {
    KEEPALIVE = 0,
    IPV4 = 1,
    PING = 2,
    IPV4_FRAG = 3
};

The server can read IP addresses from payload and save source IP -> LAN IP to a cache table. If target ip address shown in payload doesn't hit the cache, broadcast this packet to the entire room(now a server is a room).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].