1: <?php
2: /**
3: * ManiaLive - TrackMania dedicated server manager in PHP
4: *
5: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
6: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
7: * @version $Revision: 451 $:
8: * @author $Author: martin.gwendal $:
9: * @date $Date: 2012-09-07 14:13:52 +0200 (ven., 07 sept. 2012) $:
10: */
11:
12: namespace ManiaLive\DedicatedApi\Callback;
13:
14: interface Listener extends \ManiaLive\Event\Listener
15: {
16: /**
17: * Method called when a Player join the server
18: * @param string $login
19: * @param bool $isSpectator
20: */
21: function onPlayerConnect($login, $isSpectator);
22: /**
23: * Method called when a Player quit the server
24: * @param string $login
25: */
26: function onPlayerDisconnect($login);
27: /**
28: * Method called when a Player chat on the server
29: * @param int $playerUid
30: * @param string $login
31: * @param string $text
32: * @param bool $isRegistredCmd
33: */
34: function onPlayerChat($playerUid, $login, $text, $isRegistredCmd);
35: /**
36: * Method called when a Answer to a Manialink Page
37: * difference with previous TM: this is not called if the player doesn't answer, and thus '0' is also a valid answer.
38: * @param int $playerUid
39: * @param string $login
40: * @param int $answer
41: */
42: function onPlayerManialinkPageAnswer($playerUid, $login, $answer,array $entries);
43: /**
44: * Method called when the dedicated Method Echo is called
45: * @param string $internal
46: * @param string $public
47: */
48: function onEcho($internal, $public);
49: /**
50: * Method called when the server starts
51: */
52: function onServerStart();
53: /**
54: * Method called when the server stops
55: */
56: function onServerStop();
57: /**
58: * Method called when the Race Begin
59: */
60: function onBeginMatch();
61: /**
62: * Method called when the Race Ended
63: * struct of SPlayerRanking is a part of the structure of DedicatedApi\Structures\Player object
64: * struct SPlayerRanking
65: * {
66: * string Login;
67: * string NickName;
68: * int PlayerId;
69: * int Rank;
70: * [for legacy TrackMania modes also:
71: * int BestTime;
72: * int[] BestCheckpoints;
73: * int Score;
74: * int NbrLapsFinished;
75: * double LadderScore;
76: * ]
77: * }
78: * @param SPlayerRanking[] $rankings
79: * @param int|SMapInfo $winnerTeamOrMap Winner team if API version >= 2012-06-19, else the map
80: */
81: function onEndMatch($rankings, $winnerTeamOrMap);
82: /**
83: * Method called when a map begin
84: * @param SMapInfo $map
85: * @param bool $warmUp
86: * @param bool $matchContinuation
87: */
88: function onBeginMap($map, $warmUp, $matchContinuation);
89: /**
90: * Method called when a map end
91: * @param SPlayerRanking[] $rankings
92: * @param SMapInfo $map
93: * @param bool $wasWarmUp
94: * @param bool $matchContinuesOnNextMap
95: * @param bool $restartMap
96: */
97: function onEndMap($rankings, $map, $wasWarmUp, $matchContinuesOnNextMap, $restartMap);
98: /**
99: * Method called on Round beginning
100: */
101: function onBeginRound();
102: /**
103: * Method called on Round ending
104: */
105: function onEndRound();
106: /**
107: * Method called when the server status change
108: * @param int StatusCode
109: * @param string StatsName
110: */
111: function onStatusChanged($statusCode, $statusName);
112:
113: /**
114: * Method called when a player cross a checkPoint
115: * @param int $playerUid
116: * @param string $login
117: * @param int $timeOrScore
118: * @param int $curLap
119: * @param int $checkpointIndex
120: */
121: function onPlayerCheckpoint($playerUid, $login, $timeOrScore, $curLap, $checkpointIndex);
122: /**
123: * Method called when a player finish a round
124: * @param int $playerUid
125: * @param string $login
126: * @param int $timeOrScore
127: */
128: function onPlayerFinish($playerUid, $login, $timeOrScore);
129: /**
130: * Method called when there is an incoherence with a player data
131: * @param int $playerUid
132: * @param string $login
133: */
134: function onPlayerIncoherence($playerUid, $login);
135: /**
136: * Method called when a bill is updated
137: * @param int $billId
138: * @param int $state
139: * @param string $stateName
140: * @param int $transactionId
141: */
142: function onBillUpdated($billId, $state, $stateName, $transactionId);
143: /**
144: * Method called server receive data
145: * @param int $playerUid
146: * @param string $login
147: * @param base64 $data
148: */
149: function onTunnelDataReceived($playerUid, $login, $data);
150: /**
151: * Method called when the map list is modified
152: * @param int $curMapIndex
153: * @param int $nextMapIndex
154: * @param bool $isListModified
155: */
156: function onMapListModified($curMapIndex, $nextMapIndex, $isListModified);
157: /**
158: * Method called when player info changed
159: * @param SPlayerInfo $playerInfo
160: */
161: function onPlayerInfoChanged($playerInfo);
162: /**
163: * Method called when the Flow Control is manual
164: * @param string $transition
165: */
166: function onManualFlowControlTransition($transition);
167: /**
168: * Method called when a vote change of State
169: * @param string $stateName can be NewVote, VoteCancelled, votePassed, voteFailed
170: * @param string $login the login of the player who start the vote if empty the server start the vote
171: * @param string $cmdName the command used for the vote
172: * @param string $cmdParam the parameters of the vote
173: */
174: function onVoteUpdated($stateName, $login, $cmdName, $cmdParam);
175: /**
176: * @param string
177: * @param string
178: */
179: function onModeScriptCallback($param1, $param2);
180: }
181:
182: ?>