From a0971f13cf4510dbbba3649cf3d5a9f3d3d74f65 Mon Sep 17 00:00:00 2001 From: Akilan Selvacoumar Date: Sun, 25 Jul 2021 00:07:41 +0400 Subject: [PATCH] added setup files --- .gitignore | 2 +- README.md.save | 14 -------------- main.go | 20 ++++++++++++++++++++ room.json | 1 - setup.sh | 16 ++++++++++++++++ 5 files changed, 37 insertions(+), 16 deletions(-) delete mode 100644 README.md.save delete mode 100644 room.json create mode 100644 setup.sh diff --git a/.gitignore b/.gitignore index 4ec62db..b2d8205 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ config.json env/ remotegameplay -rooms.json +room.json laplace \ No newline at end of file diff --git a/README.md.save b/README.md.save deleted file mode 100644 index c9179ad..0000000 --- a/README.md.save +++ /dev/null @@ -1,14 +0,0 @@ -# Remote game play -The aim of this project is develop a WebRTC screenshare designed for streaming video games and -accpeting remote inputs. -There will be ansible intrcutions which can be executed inside into any virtual environment. This will -a plugin which complements the project [P2PRC](https://p2prc.akilan.io) - -## Laplace Binary -The laplace binary is generated from the fork: -https://github.com/Akilan1999/laplace/tree/keyboard_mouse - -## Running Laplace headless -``` -chromium --auto-select-desktop-capture-source=Entire screen --url https://0.0.0.0:8888/?mode=headless -``` diff --git a/main.go b/main.go index 3e30ef2..e054c17 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,9 @@ func main() { keyFile := flag.String("keyFile", "files/server.key", "TLS key file") headless := flag.Bool("headless", false, "Creating screenshare using headless mode") roomInfo := flag.Bool("roomInfo", false, "Getting room id of headless server") + killServer := flag.Bool("killServer", false, "Kills the laplace") + killChromium := flag.Bool("killChromium", false, "Kills all chromuim") + flag.Parse() // Action performed when the config file is called @@ -54,6 +57,23 @@ func main() { return } + // kills laplace server + if *killServer { + cmd := exec.Command("pkill" ,"laplace") + if err := cmd.Run(); err != nil { + log.Fatalln(err) + } + return + } + // kills chromium server + if *killChromium { + cmd := exec.Command("pkill" ,"chromium") + if err := cmd.Run(); err != nil { + log.Fatalln(err) + } + return + } + if *tls { log.Println("Listening on TLS:", *addr) diff --git a/room.json b/room.json deleted file mode 100644 index ec747fa..0000000 --- a/room.json +++ /dev/null @@ -1 +0,0 @@ -null \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..2fa8f61 --- /dev/null +++ b/setup.sh @@ -0,0 +1,16 @@ +export REMOTEGAMEPLAY=$PWD + +go build . + +./laplace -setconfig +./laplace -tls -addr 0.0.0.0:8888 & +./laplace -headless -addr 0.0.0.0:8888 & + +sleep 2 + +./laplace -headless -roomInfo + + + + +