Tempting the internet.

This commit is contained in:
2024-12-10 20:58:17 -05:00
parent cc9edb7825
commit c439c42b2f
2 changed files with 16 additions and 12 deletions

View File

@@ -21,7 +21,8 @@ func NewClient() *Client {
} }
//conn, err := net.Dial("tcp", "localhost:501") //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 { if err != nil {
fmt.Println("Error connecting to server:", err) fmt.Println("Error connecting to server:", err)
} else { } else {

View File

@@ -145,6 +145,8 @@ func (g *Game) HandleServerData(allclients *pb.AllClients) {
for _, client := range allclients.Clients { for _, client := range allclients.Clients {
//fmt.Println(client.Coordinates.X) //fmt.Println(client.Coordinates.X)
localaddr := g.gameclient.GetLocalAddr()
if client.Address != localaddr {
update := ClientData{ update := ClientData{
Address: client.Address, Address: client.Address,
Name: client.Name, Name: client.Name,
@@ -158,6 +160,7 @@ func (g *Game) HandleServerData(allclients *pb.AllClients) {
g.clients[update.Address] = update g.clients[update.Address] = update
g.mu.Unlock() g.mu.Unlock()
} }
}
//log.Println(data) //log.Println(data)
/* /*