mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-22 17:47:11 +00:00
Add third path connect to overlord
This commit is contained in:
parent
a0cdb2f537
commit
7d8c4ef419
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
|
@ -61,6 +61,9 @@ var port string = "8000"
|
|||
var serverID = ""
|
||||
var oclient *Client
|
||||
|
||||
// Temp
|
||||
var overlordHost = "ws://localhost:9000/wso"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Usage: ./game [debug]")
|
||||
if len(os.Args) > 1 {
|
||||
|
|
@ -71,6 +74,9 @@ func main() {
|
|||
if len(os.Args) >= 3 {
|
||||
if os.Args[2] == "overlord" {
|
||||
IsOverlord = true
|
||||
} else {
|
||||
// If the third arg is not overlord, it is path to overlord
|
||||
overlordHost = os.Args[2]
|
||||
}
|
||||
fmt.Println("Running as overlord ")
|
||||
}
|
||||
|
|
@ -448,8 +454,6 @@ func bridgeConnection(session *Session, serverID string, gameName string, roomID
|
|||
log.Println("Game is started on remote host")
|
||||
}
|
||||
|
||||
const overlordHost = "ws://localhost:9000/wso"
|
||||
|
||||
func createOverlordConnection() (*websocket.Conn, error) {
|
||||
c, _, err := websocket.DefaultDialer.Dial(overlordHost, nil)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue