/
ServerResolverInterface.php
142 lines (116 loc) · 2.33 KB
/
ServerResolverInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
namespace Savander\TwServers\Server;
/**
* Interface ServerResolverInterface
*
* @package Savander\TwServers\Server
*/
interface ServerResolverInterface
{
const DEFAULT_PORT_SERVER = 8303;
/**
* ServerResolverInterface constructor.
*
* @param string $ipAddress
* @param $port
*/
public function __construct(string $ipAddress , $port);
/**
* Resolve server by IpAddress
*
* @param string $ipAddress
* @param $port
*
*/
public function resolveServer(string $ipAddress , $port);
/**
* Return players list
*
* @return \Savander\TwServers\Player\PlayerInterface[]
*/
public function getPlayers();
/**
* Return token sent to server
*
* @return string
*/
public function getToken(): string;
/**
* Return server name
*
* @return string
*/
public function getName(): string;
/**
* Return server version
*
* @return string
*/
public function getVersion(): string;
/**
* return server players number
*
* @return int
*/
public function getNumPlayers(): int;
/**
* Return server max players variable
*
* @return int
*/
public function getMaxPlayers(): int;
/**
* return server clients number
*
* @return int
*/
public function getNumClients(): int;
/**
* Return server max clients variable
*
* @return int
*/
public function getMaxClients(): int;
/**
* return server map name
*
* @return string
*/
public function getMapName(): string;
/**
* return server gametype
*
* @return string
*/
public function getGameType(): string;
/**
* Return server flags
*
* @return int
*/
public function getFlags(): int;
/**
* Return given ip address
*
* @return string
*/
public function getIpAddress(): string;
/**
* Return given port
*
* @return int
*/
public function getPort(): int;
/**
* Returns if server has password
*
* @return bool
*/
public function hasPassword(): bool;
/**
* Checks if server gives data
*
* @return bool
*/
public function collectedData(): bool;
}