Fix: fuck udp
This commit is contained in:
@@ -97,7 +97,7 @@ func (m *LobbyModel) serverSendReply(response bool) tea.Cmd {
|
||||
}
|
||||
|
||||
local := fmt.Sprintf("%s:%d",
|
||||
m.listener.Addr().(*net.TCPAddr).IP.String(),
|
||||
viper.GetString("host"),
|
||||
m.listener.Addr().(*net.TCPAddr).Port)
|
||||
m.err = utils.SendPayload(local, m.remote,
|
||||
types.JoinResponse{Endpoint: local})
|
||||
@@ -116,12 +116,7 @@ type clientScanMsg time.Time
|
||||
|
||||
func (m *LobbyModel) clientScan() tea.Cmd {
|
||||
return tea.Tick(REFRESH_TIME, func(t time.Time) tea.Msg {
|
||||
m.endpoints = []string{}
|
||||
for _, endpoint := range viper.GetStringSlice("udp-endpoints") {
|
||||
if err := utils.Ping(endpoint); err == nil {
|
||||
m.endpoints = append(m.endpoints, endpoint)
|
||||
}
|
||||
}
|
||||
m.endpoints, m.err = utils.Ping(viper.GetStringSlice("udp-endpoints"))
|
||||
return clientScanMsg(t)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user