Commit graph

151 commits

Author SHA1 Message Date
sergystepanov
d5780acc75
Fix Pion WebRTC codecs (#289)
Since Pion's webrtc v3.0.13 and this fix if both peers have some fmtp set then codecs should match exactly. By default Pion defines a list of supported codecs with fmtp set but different browsers set their own fmtp values by default as well therefore they may not match.
To fix this we can define our own list of codecs on the server with empty fmtp so it will match any client codecs.

See: e5c8c659ca/rtpcodec.go (L99)
2021-03-08 17:22:43 +03:00
sergystepanov
b56069c96e
Fix stream freeze (#279)
* Fix D-pad key and overlay

* Add Video element error reporting

* Terminate clientside ws ping on the connection terminate
2021-02-20 18:45:43 +03:00
Sergey Stepanov
c37c2c3004
Fix D-pad key and overlay 2021-02-20 00:12:05 +03:00
sergystepanov
92d0dd76f4
Refactor input for safe concurrency (#278)
* Extract input stuff

* Move d-pad option into the main screen

* Add mutex lock on the whole input user sessions struct
2021-02-19 20:33:58 +03:00
sergystepanov
c01ddc869b
Don't hide save/load after the help show 2021-02-08 23:24:01 +03:00
sergystepanov
816b210150
Client game screen configuration support (#269)
* Move game screen to a separate [stream] module

* Add a simple canvas video mirror for post-processing

* Add video mirroring to the options
2021-01-25 12:58:05 +03:00
Sergey Stepanov
f7152c7d21
Fix control buttons width 2021-01-18 22:49:47 +03:00
Sergey Stepanov
6f4e27d0fa
Optimize images 2021-01-09 13:55:33 +03:00
sergystepanov
980a97a526
Handle no config situation for workers (#253)
(experimental feature)

Before a worker can start, it should have a configuration file. In case if such a file is not found it may request configuration from the coordinator to which it connected.

Added example logic if a worker is needed to be blocked until a successful packet exchange with a coordinator is being made.

* Add error return for config loader

* Add config loaded flag to worker

* Add zone flag

* Add a custom mutex lock with timout

* Refactor worker runtime

* Refactor internal api

* Extract monitoring server config

* Extract worker HTTP(S) server

* Add generic sub-server interface

* Add internal coordinator API

* Add internal routes and handlers to worker

* Add internal worker API

* Refactor worker run

* Migrate serverId call to new API

* Add packet handler to cws

* Extract handlers for internal worker routes in coordinator

* Pass worker to the worker internal heandlers

* Cleanup worker handlers in coordinator

* Add closeRoom packet handler to the API

* Add GetRoom packet handler to the API

* Add RegisterRoom packet handler to the API

* Add IceCandidate packet handler to the API (internal and browser)

* Add Heartbeat packet handler to the API (internal and browser)

* Rename worker routes init function

* Extract worker/coordinator internal ws handlers

* Update timed locker

* Allow sequential timed locks

* Add config request from workers

* Add nil check for the route registration functions
2021-01-03 21:23:55 +03:00
sergystepanov
1fcf34ee02
Add new Libretro core manager module (#249)
* Add initial external configuration files support.

These external configuration files allow changing app params at the runtime without recompilation.

* Find config files with specified directory in the tests

* Add aspect ratio recalculation config

* Clean code

* Add new configuration files into the Docker container image

* Add shared core and config paths into the Libretro cores config

* Split ROM <-> Emulator mapping between workers and coordinators

* Extract coordinator config

* Add shared worker/coordinator server config

* Add explicit embedded shared worker/coordinator struct for auto-config reflection fill

* Remove default stun/turn servers from the config

* Extract and add new ice servers config structures

* Update coordinator config params

* Add auto emulation lib loader based on the runtime OS/arch

* Update configuration structures

* Remove shared config embedding

* Add missing network config params

* Add game library external config

* Remove unused config parameters

* Add WebRTC encoder external options

* Add user dir for config search

* Update config loader

* Update config

* Add generic downloader with Grab lib implementation

* Add a simple file downloader backed by the grab lib

* Add initial Libretro core repos abstractions

* Expose compression info for Libretro cores repository records

* Add pipe-based abstract file downloader

* Refactor downloader

* Refactor Libretro repos

* Add worker coresync stubs

* Add multiprocess-safe HTTP-based core manager implementation

* Remove Libretro cores from the repo

* Keep custom N64 cores in te repo for now

* Add Libretro cores repo select in the config

* Fix http manager repo switch

* Cleanup code

* Add greedy Libretro lib loader

* Don't crash when arch map is not set

* Disable dynamic recompiler for pcsx core by default since it's could cause a crash

* Use global Libretro dynalib handler

* Shorten the default Libretro cores store path

* Update zip extractor implementation

* Remove explicit fig lib field markings

* Add config note to the README file

* Add GitHub repo backend for the core downloader

* Fix GitHub repo param list in the manager factory

* Add env variables reader with CLOUD_GAME prefix

* Re-optimize ice server info struct custom marshaler
2020-12-31 13:24:27 +03:00
Sergey Stepanov
7299ecc6d1
Add art credits 2020-11-25 20:57:46 +03:00
sergystepanov
8c55c6e142
Fix game sharing (#240)
Call save on the frontend and properly handle cloud save on the backend
2020-10-19 21:26:32 +08:00
sergystepanov
453087ed28
Remove duplicate worker addresses during ping check (client, server) (#234) 2020-10-03 23:53:46 +08:00
sergystepanov
564b96df8d
Add anti-abuse debounce and throttle functions (#233) 2020-10-02 02:16:28 +08:00
giongto35
611a70482a Merge conflict 2020-09-13 03:42:27 +08:00
giongto35
7b736d455e
Merge Pr/173 with master (#218)
* Add the initial support for settings

* Rearrange init order for the settings and log modules

* Add import settings function

* Add initial settings display panel

* Add settings controls

* Add settings controls handlers

* Add garbage gui auto-builder for settings

* Add some custom binding handlers for settings

* Add super ineffective ¯\_(ツ)_/¯ keyboard bindings remap function

* Migrate keyboard to codes instead deprecated keyCodes

* Abort key remap on Esc

Co-authored-by: Sergey Stepanov <sergystepanov@gmail.com>
2020-07-04 04:24:13 +08:00
88hcsif
f7f044d039 Add multitap support to SNES
Change SNES emulator to Snes9X
Add client control to toggle multitap
2020-06-28 23:35:07 +01:00
88hcsif
42514fa09a Swap A and B for PS3 controller
Add PS3 controller mapping for Safari and Firefox
2020-06-28 23:35:06 +01:00
88hcsif
2aa1ae4ecb
Add frame delay or frame rate stats to stat view. (#206)
Unfortunately Firefox does not expose frame delay stat.
Unfortunately Chrome and Safari do not expose frame rate stat.
2020-06-26 02:39:39 +08:00
sergystepanov
36894ad730
Swap the A/B buttons (#209) 2020-06-25 23:06:25 +08:00
sergystepanov
43d5ca1737
Fix Chrome stereo issue (#202) 2020-06-18 18:56:00 +08:00
88hcsif
091b086bcb
N64 Support (#195)
* Allow HTTP access to Raspberry Pi over local network
Lower audio buffer maximum theoretical size to get the worker code to compile on Raspberry Pi

* Add https port flag to run https worker and coordinator on the same machine
Add https chain and key flags to allow to use an existing certificate and bypass letsencrypt
Note the ping address resolution is still broken with this configuration

* Add option to define a ping server in the coordinator
This is useful when it is not predicatable what address and port the worker will be runnning at
This only works when there is a single worker

* Free temporarily allocated CStrings
Store constant CString

* Only load core once and unload it when done

* Add Nintendo 64 support!
Disclaimer: only tested with Mupen64plus and Mupen64plusNext on Raspberry Pi.
It probably needs more work to run on every system and with other OpenGL libretro libraries.
Input controls are hacked together, it really needs analog stick and remapping support to play in a nicer way.
I am worried there might be a memory leak when unloading Mupen64plus but this needs further investigation.

* Add analog sticks + R2,L2,R3,L3 support

* Add client logic to control left analog stick via keyboard and touch
Add client logic to toggle between dpad mode and analog mode (even for joystick)
Might need to revisit if and when remapping is implemented
Tocuh sensitivity of analog stick is pretty high, might need tweaking

* Add cores for Raspberry Pi
Add N64 core for linux x86_64

* Reset use OpenGL flag on nanoarch shutdown (line lost in refactoring)
2020-06-17 18:07:10 +08:00
sergystepanov
27f8fdc117
Make it choose ws/wss protocol based on URL's protocol. (#196)
When you open the app with https: protocol it will chose wss secured socket connection instead of hardcoded addresses / domains.
2020-06-13 14:23:01 +08:00
giongto35
c8e6cfcb64
Feature: Add pgm bios + quit reload to the main page (#183) 2020-05-18 02:00:00 +08:00
giongto35
edf7c4b872
Enable voice communication in the same room (#182)
- All voice is fan-in and broadcasted.
- Currently, voice is sent in the same game track. TODO: send voice in different track (Having issue with dynamically addTrack after offer and answer)
2020-05-15 01:52:51 +08:00
trichimtrich
5dcf4ac95f
Add support firefox safari ios (#175)
* change rtc offer/answer direction

* remove overlay log

* merge browser+session, fix log, add browser map

* add candidate transfer on worker + web
2020-04-28 02:20:49 +08:00
Sergey Stepanov
da2d5b0ead
Minor fixes in the stats module after the review 2020-04-26 21:46:33 +03:00
sergystepanov
e05ae221e8
Add generic application statistics overlay (#168)
* Add stat module initial example

* Add stats module help overlay overlap handling

* Add generic graph canvas image builder

* Add more generic graphing module

* Clean up the code

* Some fixes

* Change graphing styles

* Clean some stats module code

* Move to RAF rendering to burn your CPU

* Add not standardized memory stats module

* Fix initial stats visibility flag handle
2020-04-26 22:19:00 +08:00
sergystepanov
23c2f5b4ee
Fix ui scaling for Chrome (#169)
* Fix ui scaling for Chrome

* Bump the versions for cache
2020-04-25 04:01:48 +08:00
sergystepanov
b3cb95849d
Refactor input poll (#167)
* Refactor input poll to make it x2-3 faster (0.4ms+ -> 0.1ms)

* If Server is sendrecv transceiver, client needs to be sendrecv on Firefox.
c641b530a0

Co-authored-by: giongto35 <giongto35@yahoo.com>
2020-04-22 01:11:36 +08:00
Sergey Stepanov
11d640a516
Remove annoying poster chunks under not 1:1 AR videos 2020-04-19 22:56:03 +03:00
giongto35
7e8ebd5f74 Minor fix + Update more collaborate games for fun 2020-04-19 03:35:28 +08:00
giongto35
fb85bcf8ca Update fonts 2020-04-16 18:28:13 +08:00
Sergey Stepanov
9238e57acb
Fix event params shadowing (0, false and so on -> {}) 2020-04-13 17:13:11 +03:00
giongto35
7f2f10518a Update font css 2020-04-12 03:29:19 +08:00
giongto35
490e8eb02f
Update new UI (#160)
* Update new ui

* Update script version
2020-04-10 05:15:23 +08:00
giongto35
8484eca293 Add L R 2020-04-01 01:27:42 +08:00
giongto35
e52ba36759
Update concurrent input (#150) 2020-01-12 19:46:24 +08:00
giongto35
a1ac8f272a
Setup HTTPS using autocert (#149)
* Add HTTPS WSS

* Update https

* HTTPS

* Add https

* Add HTTPS worker

* Add HTTPS

* add https

* Add pingserver to worker

* add https

* Add public domain whitelist

* Not fatal when there existing echo server
2020-01-03 04:37:26 +08:00
giongto35
55815cb9ef
Add multiplayer player (#148)
* Add player index

* Add second player

* Add player index slider

* add multiplayer

* WIP

* Clean up

* Add multiplayer play
2019-12-14 12:32:31 +08:00
giongto35
76515a00ce Hot fix wrong param when connect 2019-12-12 02:31:10 +08:00
giongto35
e2d2436ceb Fix roomID correct 2019-12-12 02:30:14 +08:00
giongto35
1ccdab08a0
Update pion version (#147)
* Update DREADME CrowdPlay

* Update README

* Update README.md

* Update webRTC version

* Update pion version
2019-12-10 03:33:14 +08:00
giongto35
1342fabe15
Give option to join by zone + update README (#146)
* Update DREADME CrowdPlay

* Update README

* Update README.md

* Add zone control

* add zone

* Update MISC

* Update go mod
2019-12-09 03:02:35 +08:00
sergystepanov
3d1f1ee587 Initial new frontend rewrite (#129)
* Initial new frontend rewrite

* Refactor some module deps

* Fix options ref in the ajax module

* Refactor

* Add controller state

* Refactor
2019-11-05 01:44:19 +07:00
sergystepanov
6c8d39f86f Fix URI encoding / decoding for game names (#121)
I verified! it fixed the bug!
2019-10-23 03:15:52 +08:00
giongto35
b7f47f5519
MISC fix, fix aspect ratio setting + Only play audio when has user interaction (#117)
* Update encoding flow

* unmute when play

* only play audio when action

* Update version

* Update more comments

* Remove indirect

* Fix comments
2019-10-20 13:00:52 +08:00
giongto35
d01521f4ae
Join same room when giving roomID (#111) 2019-10-17 03:49:24 +08:00
giongto35
50343faaad
Update Audio batch + Fix the issue reload failed + escape room ID (#106)
* Try muted first

* WIP

* Update AudioChannel by batch

* Update util package

* Remove min

* Tidy module

* Update module
2019-10-12 21:46:02 +08:00
sergystepanov
4e06d6a27e Add audio streaming support with WebRTC and Opus (#102)
* Update README.md with additional info about Windows builds

* Add initial Opus stream audio support
2019-10-09 03:02:09 +08:00