GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#238)
by
unknown
01:05
created

GpgNetServerProtocol.send_JoinGame()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
from abc import ABCMeta, abstractmethod
2
3
4
from typing import List, Union
0 ignored issues
show
Configuration introduced by
The import typing could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
5
from server.abc.base_game import InitMode
0 ignored issues
show
Bug introduced by
The name abc does not seem to exist in module server.
Loading history...
Configuration introduced by
The import server.abc.base_game could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
6
7
8
class GpgNetServerProtocol(metaclass=ABCMeta):
0 ignored issues
show
Unused Code introduced by
This abstract class does not seem to be used anywhere.
Loading history...
9
    """
10
    Defines an interface for the server side GPGNet protocol
11
    """
12
    def send_CreateLobby(self, init_mode: InitMode, port: int, login: str, uid: int, natTraversalProvider: int):
13
        """
14
        Tells the client to create a new LobbyComm instance and have it listen on the given port number
15
        :type init_mode: Whether to use ranked or ladder mode for the in game lobby
16
        :type port: The port number for the client to listen on
17
        :type login: The username of the player
18
        :type uid: The identifier of the player
19
        :type natTraversalProvider: A number representing the nat-traversal-provider, typically 1
20
        """
21
        self.send_gpgnet_message('CreateLobby', [int(init_mode.value), port, login, uid, natTraversalProvider])
22
23
    def send_ConnectToPeer(self, player_name: str, player_uid: int):
24
        """
25
        Tells a client that has a listening LobbyComm instance to connect to the given peer
26
        :param player_name: Remote player name
27
        :param player_uid: Remote player identifier
28
        """
29
        self.send_gpgnet_message('ConnectToPeer', [player_name, player_uid])
30
31
    def send_JoinGame(self, address_and_port: str, remote_player_name: str, remote_player_uid: int):
0 ignored issues
show
Unused Code introduced by
The argument address_and_port seems to be unused.
Loading history...
32
        """
33
        Tells the game to join the given peer by address_and_port
34
        :param address_and_port:
35
        :param remote_player_name:
36
        :param remote_player_uid:
37
        """
38
        self.send_gpgnet_message('JoinGame', [remote_player_name, remote_player_uid])
39
40
    def send_HostGame(self, map):
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in map.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
41
        """
42
        Tells the game to start listening for incoming connections as a host
43
        :param map: Which scenario to use
44
        """
45
        self.send_gpgnet_message('HostGame', [str(map)])
46
47
    def send_DisconnectFromPeer(self, id: int):
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in id.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
48
        """
49
        Instructs the game to disconnect from the peer given by id
50
51
        :param id:
52
        :return:
53
        """
54
        self.send_gpgnet_message('DisconnectFromPeer', [id])
55
56
    def send_Ping(self):
57
        """
58
        Heartbeat pinging used between the FAF client and server
59
        :return:
60
        """
61
        self.send_gpgnet_message('ping', [])
62
63
    def send_gpgnet_message(self, command_id, arguments):
64
        message = {"command": command_id, "args": arguments}
65
        self.send_message(message)
66
67
    @abstractmethod
68
    def send_message(self, message):
69
        pass  # pragma: no cover
70
71
72
class GpgNetClientProtocol(metaclass=ABCMeta):
0 ignored issues
show
Unused Code introduced by
This abstract class does not seem to be used anywhere.
Loading history...
73
    def send_GameState(self, arguments: List[Union[int, str, bool]]) -> None:
74
        """
75
        Sent by the client when the state of LobbyComm changes
76
        """
77
        self.send_gpgnet_message('GameState', arguments)
78
79
    def send_ProcessNatPacket(self, arguments: List[Union[int, str, bool]]) -> None:
80
        """
81
        Sent by the client when it received a nat packet
82
        :param arguments:
83
        :return:
84
        """
85
        self.send_gpgnet_message('ProcessNatPacket', arguments)
86
87
    @abstractmethod
88
    def send_gpgnet_message(self, command_id, arguments: List[Union[int, str, bool]]) -> None:
89
        pass  # pragma: no cover
90