poki / netlib Goto Github PK
View Code? Open in Web Editor NEWThe Poki Networking Library for online multiplayer web games!
License: ISC License
The Poki Networking Library for online multiplayer web games!
License: ISC License
If creating a WebRTC connection to player in the same lobby fails we should tell the game, but at the same time keep re-trying.
We currently only INSERT INTO lobbies
and UPDATE lobbies
but we never actually delete lobbies that don't have peers in them.
We'll probably want to delete lobbies that haven't seen any new peers for X hours?
We can now create, list and join lobbies. But we can't leave them yet without disconnecting everything.
Hey!
Motivation:
Almost every multiplayer online game has a synced clock aka remoteTime, remoteTicks, roomTime etc.
Its helps to understand when exactly actions be happened and how to handle it on the local side.
Suggestion:
When we create a lobby, we set on the server side:
_createdAt = Date.now();
lobbyTime(){
return Date.now() - _createdAt;
}
Then, we send it to the every peer.
On the client side, we have:
network.ts
private onLobbyTimeReceived(lobbyTime: number) {
// TODO we need to compensate for the RTT/ping
const compensation = 10;
this._createdAt = Date.now() - lobbyTime + compensation;
}
get lobbyTime() {
return Date.time() - this._createdAt;
}
Currently we run our cucumber feature tests using nodejs, and this node environment spins up a backend etc. We would like to flip this around, making it that we run the tests in Go and spin up a headless browser to run the client code.
This will make it easier for us to test state and will make the test run faster and more stable (letting us write more tests).
We have examples which is nice, but some clear documentation on exactly which functions exist on which objects would be nice. And which arguments functions require accept.
If you create a private lobby, netlib still makes its public. Look at
netlib/internal/signaling/stores/postgres.go
Line 145 in fb566a2
Plus, the list()
function returns a list where all lobbies are private (public and non-public):
https://github.com/poki/netlib/blob/main/internal/signaling/stores/postgres.go#L253C4-L253C4
I would like to exclude lobbies without players from the list.
Plus, I would like to have the lobbies to be sorted by the date the last peer was connected.
Not every game uses a build flow that can handle an npm module. Some games require a simple script that they can either bundle with their game (PlayCanvas for example), or that they can include using a <script>
tag.
Please, generate a typings for dist
The function network.list()
returns null
if there are no public games.
I guess an empty array []
should be returned.
If you create at least one public game, everything is ok.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.