update passwd auto

This commit is contained in:
shoopea
2021-11-10 15:04:27 +08:00
parent 0d5c94e06f
commit caba808d8b
2 changed files with 15 additions and 5 deletions

12
ttd.go
View File

@@ -558,7 +558,17 @@ func (s *ServerTTD) UpdateCompanies() {
logErrorDebug(err, "Server.UpdateClients() : Send(PacketAdminPoll) : AdminPacketAdminRCon")
break
} else if !co.Protected {
s.SetPasswd(co.CompanyExtlID, "blabla")
for _, cc := range cfg.Clients {
if cc.CompanyID == co.CompanyID {
s.SetPasswd(co.CompanyExtlID, cc.Passwd)
co.Protected = true
break
}
}
if !co.Protected {
s.SetPasswd(co.CompanyExtlID, "blabla")
}
}
}
s.Status.UpdateCompanies = time.Now()