update dxcc
This commit is contained in:
19
TCPClient.go
19
TCPClient.go
@ -31,9 +31,10 @@ type TCPClient struct {
|
||||
SpotChan chan TelnetSpot
|
||||
Log *log.Logger
|
||||
Config *Config
|
||||
Countries Countries
|
||||
}
|
||||
|
||||
func NewTCPClient(TCPServer *TCPServer, FlexClient *FlexClient, log *log.Logger) *TCPClient {
|
||||
func NewTCPClient(TCPServer *TCPServer, FlexClient *FlexClient, log *log.Logger, Countries Countries) *TCPClient {
|
||||
return &TCPClient{
|
||||
Address: Cfg.Cluster.Server,
|
||||
Port: Cfg.Cluster.Port,
|
||||
@ -44,6 +45,7 @@ func NewTCPClient(TCPServer *TCPServer, FlexClient *FlexClient, log *log.Logger)
|
||||
Log: log,
|
||||
TCPServer: *TCPServer,
|
||||
FlexClient: *FlexClient,
|
||||
Countries: Countries,
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,11 +108,21 @@ func (c *TCPClient) SetFilters() {
|
||||
c.Log.Debug("Skimmer is on as defined in the config file")
|
||||
}
|
||||
|
||||
if Cfg.Cluster.FT4 {
|
||||
c.Write([]byte("set/ft4\r\n"))
|
||||
c.Log.Debug("FT4 is on as defined in the config file")
|
||||
}
|
||||
|
||||
if !Cfg.Cluster.FT8 {
|
||||
c.Write([]byte("set/noft8\r\n"))
|
||||
c.Log.Debug("FT8 is off as defined in the config file")
|
||||
}
|
||||
|
||||
if !Cfg.Cluster.FT4 {
|
||||
c.Write([]byte("set/noft4\r\n"))
|
||||
c.Log.Debug("FT4 is off as defined in the config file")
|
||||
}
|
||||
|
||||
if !Cfg.Cluster.Skimmer {
|
||||
c.Write([]byte("set/noskimmer\r\n"))
|
||||
c.Log.Debug("Skimmer is off as defined in the config file")
|
||||
@ -138,7 +150,10 @@ func (c *TCPClient) ReadLine() {
|
||||
c.Log.Info("start receiving spots")
|
||||
}
|
||||
|
||||
ProcessTelnetSpot(spotRe, message, c.SpotChan, c.Log)
|
||||
start := time.Now()
|
||||
ProcessTelnetSpot(spotRe, message, c.SpotChan, c.Log, c.Countries)
|
||||
elapsed := time.Since(start)
|
||||
Log.Infof("Total time for processing spot: %s", elapsed)
|
||||
|
||||
// Send the spot message to TCP server
|
||||
if len(c.TCPServer.Clients) > 0 {
|
||||
|
Reference in New Issue
Block a user