mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-25 19:13:52 +00:00
Update docker file
This commit is contained in:
parent
141e092b67
commit
475db9e3ab
2 changed files with 2 additions and 13 deletions
|
|
@ -4,5 +4,7 @@ RUN mkdir -p /go/src/github.com/giongto35/game-online
|
|||
COPY . /go/src/github.com/giongto35/game-online/
|
||||
|
||||
# Install server dependencies
|
||||
RUN apt-get install portaudio19-dev
|
||||
RUN go get github.com/pions/webrtc
|
||||
RUN go get github.com/gordonklaus/portaudio
|
||||
RUN go get github.com/gorilla/mux
|
||||
|
|
|
|||
13
main.go
13
main.go
|
|
@ -3,10 +3,8 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
|
|
@ -68,17 +66,6 @@ func postSession(w http.ResponseWriter, r *http.Request) {
|
|||
w.Write([]byte(localSession))
|
||||
}
|
||||
|
||||
func randomImage(width, height int) *image.RGBA {
|
||||
img := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{width, height}})
|
||||
for x := 0; x < width; x++ {
|
||||
for y := 0; y < height; y++ {
|
||||
img.Set(x, y, color.RGBA{uint8(rand.Int31n(0xff)), uint8(rand.Int31n(0xff)), uint8(rand.Int31n(0xff)), 0xff - 1})
|
||||
}
|
||||
}
|
||||
|
||||
return img
|
||||
}
|
||||
|
||||
func screenshotLoop(imageChannel chan *image.RGBA) {
|
||||
for image := range imageChannel {
|
||||
if webRTC.IsConnected() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue