(String name, String ip, boolean admin)
| 82 | } |
| 83 | |
| 84 | public static Switcher put(String name, String ip, boolean admin) { |
| 85 | name = name.replace('_', ' ').strip(); |
| 86 | String stripedName = Strings.stripGlyphs(Strings.stripColors(name)).strip().toLowerCase(); |
| 87 | Switcher new_ = new Switcher(name, ip, admin); |
| 88 | |
| 89 | if (new_.error) return null; |
| 90 | |
| 91 | else if (stripedName.equals("lobby")) { |
| 92 | if (lobby != null) new_.changed = true; |
| 93 | lobby = new_; |
| 94 | lobby.name = stripedName; |
| 95 | |
| 96 | } else { |
| 97 | new_.changed = list.put(stripedName, new_) != null; |
| 98 | if (new_.changed) ordonedList.remove(s -> s.name.equals(new_.name)); |
| 99 | ordonedList.add(new_); |
| 100 | } |
| 101 | |
| 102 | return new_; |
| 103 | } |
| 104 | |
| 105 | public static Switcher remove(String name) { |
| 106 | name = Strings.stripGlyphs(Strings.stripColors(name.replace('_', ' '))).strip().toLowerCase(); |
no test coverage detected