aboutsummaryrefslogtreecommitdiff
path: root/Server.go
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2018-05-18 22:49:25 +0000
committerMartin Ashby <martin@ashbysoft.com>2018-05-18 22:49:25 +0000
commit20ee809e540556801fca87a573852d16c2ac7388 (patch)
tree7fafc3115565c07f736d6bc6a42948a270e0a5f6 /Server.go
parentd2dea8058c88b39f161178f59c6bfec0e32dfa02 (diff)
downloadunicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.gz
unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.bz2
unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.xz
unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.zip
Go server now working
Diffstat (limited to 'Server.go')
-rw-r--r--Server.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/Server.go b/Server.go
index f25376c..eee725d 100644
--- a/Server.go
+++ b/Server.go
@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/gorilla/websocket"
- "github.com/veandco/go-sdl2/sdl"
+ //"github.com/veandco/go-sdl2/sdl"
"io/ioutil"
"log"
"net/http"
@@ -185,7 +185,7 @@ func upgradeHandler(w http.ResponseWriter, r *http.Request) {
}
}
-func handleSdlEvents() {
+/*func handleSdlEvents() {
running := true
for running {
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
@@ -196,7 +196,7 @@ func handleSdlEvents() {
}
}
}
-}
+}*/
func handleClients() {
for {
@@ -222,8 +222,9 @@ func main() {
http.Handle("/", http.FileServer(http.Dir("build")))
http.HandleFunc("/ws", upgradeHandler)
go http.ListenAndServe(":3001", nil)
- go handleClients()
- handleSdlEvents()
+ //go handleClients()
+ handleClients()
+ //handleSdlEvents()
}
func doBroadcast(obj interface{}) {