# Coverage for client/parts/admin.py : 100%

## 21 statements 21 run 0 missing 2 excluded 0 partial

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1# -*- coding: utf-8 -*-

2 from __future__ import annotations

3

4# -- stdlib --

5 from typing import TYPE_CHECKING

6

7# -- third party --

8# -- own --

9 import wire

10

11# -- typing --

12 if TYPE_CHECKING:

13 from client.core import Core # noqa: F401

14

15

16# -- code --

17 class Admin(object):

18 def __init__(self, core: Core):

19 self.core = core

20

21 # ----- Public Methods -----

22 def kick(self, uid: int) -> None:

23 core = self.core

24 core.server.write(wire.msg.AdminKick(uid=uid))

25

26 def clearzombies(self) -> None:

27 core = self.core

28 core.server.write(wire.msg.AdminClearZombies())

29

30 def migrate(self) -> None:

31 core = self.core

32 core.server.write(wire.msg.AdminMigrate())

33

34 def stacktrace(self) -> None:

35 core = self.core

36 core.server.write(wire.msg.AdminStacktrace())

37

38 def kill_game(self, gid: int) -> None:

39 core = self.core

40 core.server.write(wire.msg.AdminKillGame(gid=gid))