Changeset 636 in code for trunk/server.go
- Timestamp:
- Oct 13, 2021, 8:58:34 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server.go
r612 r636 64 64 listeners map[net.Listener]struct{} 65 65 users map[string]*user 66 67 motd atomic.Value // string 66 68 } 67 69 68 70 func NewServer(db Database) *Server { 69 return&Server{71 srv := &Server{ 70 72 Logger: log.New(log.Writer(), "", log.LstdFlags), 71 73 HistoryLimit: 1000, … … 75 77 users: make(map[string]*user), 76 78 } 79 srv.motd.Store("") 80 return srv 77 81 } 78 82 … … 269 273 return &stats 270 274 } 275 276 func (s *Server) SetMOTD(motd string) { 277 s.motd.Store(motd) 278 } 279 280 func (s *Server) MOTD() string { 281 return s.motd.Load().(string) 282 }
Note:
See TracChangeset
for help on using the changeset viewer.