Skip to content

Commit

Permalink
update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Jan 10, 2024
1 parent 076475c commit 5f48da2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

switch-lan-play: Make you and your friends play games like in a LAN.
switch-lan-play: Enjoy games with your friends as if you were on a LAN.
Copyright (C) 2018 spacemeowx2

This program is free software: you can redistribute it and/or modify
Expand Down
29 changes: 13 additions & 16 deletions README.md
Expand Up @@ -4,7 +4,7 @@

English | [中文](README_zh.md)

Make you and your friends play games like in a LAN.
Enjoy games with your friends as if you were on a LAN.

```
Internet
Expand All @@ -16,16 +16,13 @@ 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.
To play with your friends, both you and your friends need to run the lan-play client connecting to the **same** Server on your PCs, and set static IP on your Switch.

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

Visit [https://www.lan-play.com/](http://lan-play.com/install-switch) for steps on how to set this up. See below for build instructions.
Visit [https://www.lan-play.com/](http://lan-play.com/install-switch) for instructions on how to set this up. See below for build instructions.

## SOCKS5 Proxy

Expand All @@ -46,7 +43,7 @@ This project depends on libpcap, you can install libpcap0.8-dev on Ubuntu or Deb

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

Prepare a cmake, gcc, and run like this:
Prepare cmake and gcc, then run the following:

```sh
mkdir build
Expand All @@ -66,7 +63,7 @@ pacman -S make \
mingw-w64-x86_64-gcc
```

To compile 32bit program:
To compile a 32-bit program:

```sh
pacman -S mingw-w64-i686-cmake \
Expand Down Expand Up @@ -107,17 +104,17 @@ make
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 run build # build ts to js. run it again when code changes.
npm start
```

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

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

Use `--httpAuth` pass the auth via http url, or else there's no authentication.
Use `--httpAuth` to pass authentication via HTTP URL, or there will be no authentication.

Use `--jsonAuth` pass the auth via json file, or else there's no authentication.
Use `--jsonAuth` to pass authentication via JSON file, or there will be no authentication.

Example:

Expand All @@ -126,7 +123,7 @@ 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:
Meanwhile, the monitor service will start on port `11451/tcp` by default. You can get the online client count via an HTTP request:

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

Expand All @@ -135,7 +132,7 @@ 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.
The protocol is quite simple at the moment, but additional fields may be added to calculate network quality (packet loss, ping), such as timestamp, seq_id, etc.

```c
struct packet {
Expand All @@ -153,4 +150,4 @@ enum type {
};
```

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).
The server can read IP addresses from the payload and save the source IP -> LAN IP to a cache table. If the target IP address shown in the payload doesn't match the cache, the packet is broadcast to the entire room.
9 changes: 3 additions & 6 deletions README_zh.md
Expand Up @@ -16,9 +16,6 @@ Switch <--------> PC(本工具) <-------------------> 服务器
UDP协议
```

**注意:**
* 这个项目正处于早期开发阶段,通信协议可能会频繁变化。

# 用法

本工具分为服务端和客户端,你和朋友要在**各自的电脑**上运行 lan-play 客户端,并连接到**同一个**服务器,最后给 Switch 设置静态 IP 上网。
Expand All @@ -29,7 +26,7 @@ Switch <--------> PC(本工具) <-------------------> 服务器

1. 下载并安装最新的 [Npcap](https://nmap.org/npcap/#download)

2. 安装 Npcap 的时候记得选择 **Installed in WinPcap API-compatible mode** (以 WinPcap API 兼容模式安装)
2. 安装 Npcap 的时候记得选择 **Installed in WinPcap API-compatible mode** (以 WinPcap API 兼容模式安装)

3.[releases](https://github.com/spacemeowx2/switch-lan-play/releases) 下载最新版 `lan-play.exe` 客户端

Expand All @@ -41,7 +38,7 @@ Switch <--------> PC(本工具) <-------------------> 服务器
--relay-server-addr is required (必须输入 --relay-server-addr 参数)
Input the relay server address [ domain/ip:port ]: (输入中继服务器地址)
```
你可以从这个网站里提供的公共中继服务器列表中选择一个
你可以从这个网站提供的公共中继服务器列表中选择一个
https://www.lan-play.com/

也可以到本项目的 Discord 群组里找人匹配
Expand Down Expand Up @@ -70,7 +67,7 @@ https://discord.gg/zEMCu5n
</tbody>
</table>

2. 点击保存,这时候 Switch 会开始通过你的电脑上网。
2. 点击保存,这时 Switch 会开始通过你的电脑上网。

3. 启动游戏,然后按 L+R+LStick 进入局域网联机模式。

Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile.openwrt
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
endef

define Package/$(PKG_NAME)/description
Make you and your friends play games like in a LAN.
Enjoy games with your friends as if you were on a LAN.
endef

define Build/Prepare
Expand Down

0 comments on commit 5f48da2

Please sign in to comment.