Skip to content

Commit 8c952d8

Browse files
Suggestions
1 parent 1b52a30 commit 8c952d8

2 files changed

Lines changed: 12 additions & 30 deletions

File tree

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# The Poki Networking Library &nbsp;&nbsp;[<img src="https://img.shields.io/npm/v/@poki/netlib?color=lightgray">](https://www.npmjs.com/package/@poki/netlib)
22

33
<img align="right" src="https://raw.githubusercontent.com/poki/netlib/main/.github/logo.png" width=140>
4-
The Poki Networking Library is a powerful peer-to-peer networking solution for web games, leveraging WebRTC datachannels to enable direct UDP connections between players. Think of it as the Steam Networking Library for the web, designed to make WebRTC as simple to use as WebSockets for game development.
4+
The Poki Networking Library is a peer-to-peer networking library for web games, leveraging WebRTC datachannels to enable direct UDP connections between players. Think of it as the Steam Networking Library for the web, designed to make WebRTC as simple to use as WebSockets for game development.
55

66
<p></p>
77

8-
> ⚠️ **Warning**: This library is still under development and considered a beta. The library API can change. Make sure to get in touch if you want to go live with this so we can keep you up-to-date about changes.
8+
> [!WARNING]
9+
> This library is still under development and considered a beta. While it's being actively used in production by some games, the API can change. Make sure to get in touch if you want to go live with this so we can keep you up-to-date about changes.
910
1011
## Features
1112

@@ -24,7 +25,6 @@ The Poki Networking Library is a powerful peer-to-peer networking solution for w
2425
- Optimized for real-time gaming with minimal latency
2526
- Perfect for fast-paced multiplayer games
2627
- Unlike WebSockets or HTTP (which use TCP), UDP doesn't pause new packets when one packet is slow or dropped
27-
- This is ideal for real-time updates like position data
2828
- Includes reliable data channels for critical events like chat messages or NPC spawns
2929

3030
- **Easy to Use**
@@ -63,7 +63,7 @@ network.on('ready', () => {
6363

6464
// Or join an existing one
6565
network.on('ready', () => {
66-
network.join('LOBBY-CODE')
66+
network.join('ed84')
6767
})
6868
```
6969

@@ -80,13 +80,10 @@ network.on('message', (peer, channel, data) => {
8080

8181
For more detailed examples and API documentation:
8282
- [Basic Usage Guide](./docs/basic-usage.md)
83-
- [Example Implementation](./example/)
83+
- [Example Usage](./example/)
8484

85-
## Project Status
85+
## Roadmap
8686

87-
This library is currently in alpha stage. While it's being actively used in production by some games, the API may change without warning and without bumping the major version. Please contact us if you're planning to use this library in production.
88-
89-
### Roadmap
9087
- [x] Basic P2P connectivity
9188
- [x] Lobby system
9289
- [x] Lobby discovery and filtering
@@ -118,9 +115,8 @@ UDP Transport
118115
- Facilitates WebRTC connection establishment
119116

120117
#### 2. STUN/TURN Servers
121-
- STUN: Helps peers discover their public IP
122-
- TURN: Provides fallback relay when direct P2P fails
123-
- Hosted by Poki (or self-hostable)
118+
- STUN: Helps peers discover their public IP (by default Google STUN servers)
119+
- TURN: Provides fallback relay when direct P2P fails (when using the Poki hosted version, Cloudflare TURN servers are used)
124120

125121
## Self-Hosting
126122

docs/basic-usage.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Getting Started
44

5-
#### 1. Installation
5+
#### 1. Add dependency
66
First add [@poki/netlib](https://www.npmjs.com/package/@poki/netlib) as a dependency to your project:
77
```sh
88
yarn add @poki/netlib
@@ -36,13 +36,8 @@ network.on('lobby', code => {
3636
// Wait for network to be ready before creating
3737
network.on('ready', () => {
3838
network.create({
39-
public: true, // Make lobby visible in listings
40-
maxPlayers: 4, // Optional: limit number of players
41-
password: 'secret', // Optional: add password protection
42-
customData: { // Optional: add custom lobby data
43-
map: 'aztec',
44-
gameMode: 'deathmatch'
45-
}
39+
public: true, // Make lobby visible in listings
40+
maxPlayers: 4, // Optional: limit number of players
4641
})
4742
})
4843
```
@@ -51,7 +46,7 @@ network.on('ready', () => {
5146
When a player wants to join an existing game:
5247
```js
5348
network.on('ready', () => {
54-
network.join(lobbyCode, 'secret') // Second parameter is optional password
49+
network.join(lobbyCode)
5550
})
5651
```
5752

@@ -105,15 +100,6 @@ network.on('disconnected', peer => {
105100
})
106101
```
107102

108-
##### Monitoring Connection Quality
109-
```js
110-
// Check for errors
111-
network.on('error', error => {
112-
console.error('Network error:', error)
113-
// Handle or display error to user
114-
})
115-
```
116-
117103
#### 6. Listing Lobbies
118104
You can list available lobbies using the `list` function. This function supports filtering using MongoDB-style filters:
119105

0 commit comments

Comments
 (0)