| 118 | } |
| 119 | |
| 120 | func (srv *Server) provideStatus(*net.Conn) status.StatusResponseData { |
| 121 | //count := srv.World.Broadcast.NumSession() |
| 122 | count := 0 |
| 123 | max := srv.cfg.MaxPlayers |
| 124 | if max == -1 { |
| 125 | max = count + 1 |
| 126 | } |
| 127 | return status.StatusResponseData{ |
| 128 | Version: status.StatusVersion{ |
| 129 | Name: "Zeppelin 1.21.3", |
| 130 | Protocol: net.ProtocolVersion, |
| 131 | }, |
| 132 | Description: text.Unmarshal(srv.cfg.MOTD, srv.cfg.ChatFormatter.Rune()), |
| 133 | Players: status.StatusPlayers{ |
| 134 | Max: max, |
| 135 | Online: count, |
| 136 | //Sample: srv.World.Broadcast.Sample(), |
| 137 | }, |
| 138 | Favicon: srv.icon, |
| 139 | EnforcesSecureChat: srv.cfg.EnforceSecureProfile, |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | func (srv *Server) SetStatusProvider(sp net.StatusProvider) { |
| 144 | srv.listener.SetStatusProvider(sp) |