Tempting the internet.
This commit is contained in:
@@ -21,7 +21,8 @@ func NewClient() *Client {
|
||||
}
|
||||
|
||||
//conn, err := net.Dial("tcp", "localhost:501")
|
||||
conn, err := net.Dial("tcp", "192.168.5.100:501")
|
||||
//conn, err := net.Dial("tcp", "192.168.5.100:501")
|
||||
conn, err := net.Dial("tcp", "134.231.47.14:501")
|
||||
if err != nil {
|
||||
fmt.Println("Error connecting to server:", err)
|
||||
} else {
|
||||
|
||||
@@ -145,6 +145,8 @@ func (g *Game) HandleServerData(allclients *pb.AllClients) {
|
||||
for _, client := range allclients.Clients {
|
||||
//fmt.Println(client.Coordinates.X)
|
||||
|
||||
localaddr := g.gameclient.GetLocalAddr()
|
||||
if client.Address != localaddr {
|
||||
update := ClientData{
|
||||
Address: client.Address,
|
||||
Name: client.Name,
|
||||
@@ -158,6 +160,7 @@ func (g *Game) HandleServerData(allclients *pb.AllClients) {
|
||||
g.clients[update.Address] = update
|
||||
g.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
//log.Println(data)
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user