()
| 206 | } |
| 207 | |
| 208 | func (player *Player) ReadString() (s string, err error) { |
| 209 | length, err := player.ReadVarInt() |
| 210 | if err != nil { |
| 211 | return "", err |
| 212 | } |
| 213 | buffer := make([]byte, length) |
| 214 | _, err = io.ReadFull(player.io.rdr, buffer) |
| 215 | if err != nil { |
| 216 | return "", err |
| 217 | } |
| 218 | return string(buffer), nil |
| 219 | } |
| 220 | |
| 221 | func (player *Player) ReadStringLimited(max int) (s string, err error) { |
| 222 | max = (max * 4) + 3 |
nothing calls this directly
no test coverage detected