@@ -89,7 +89,7 @@ Livescore.prototype.setTime = function(time) {
8989 clearInterval ( self . interval ) ;
9090
9191 self . time = time ;
92- self . interval = setInterval ( function ( ) {
92+ self . interval = setInterval ( ( ) => {
9393 self . time = self . time - 1 ;
9494 self . emit ( 'time' , self . time ) ;
9595 } , 1000 ) ;
@@ -130,10 +130,11 @@ Livescore.prototype._onLog = function(logs) {
130130 if ( logs && logs !== self . _lastLog ) {
131131 self . emit ( 'log' , logs ) ;
132132
133- self . getPlayers ( function ( players ) {
133+ self . getPlayers ( ( players ) => {
134134 if ( Object . keys ( players ) . length && logs ) {
135- logs . forEach ( function ( log ) {
135+ logs . forEach ( ( log ) => {
136136 var event ;
137+
137138 for ( event in log ) {
138139 self . emit ( 'debug' , 'received event: ' + event ) ;
139140
@@ -173,7 +174,7 @@ Livescore.prototype._onScoreboard = function(event) {
173174
174175 updateGame ( event ) ;
175176
176- self . getTeams ( function ( teams ) {
177+ self . getTeams ( ( teams ) => {
177178 var scoreboard = new Livescore . Classes . Scoreboard ( event ) ;
178179
179180 scoreboard . teams [ Livescore . Enums . ESide [ 'TERRORIST' ] ] = teams [ Livescore . Enums . ESide [ 'TERRORIST' ] ] ;
@@ -184,7 +185,7 @@ Livescore.prototype._onScoreboard = function(event) {
184185} ;
185186
186187Livescore . prototype . _onKill = function ( event ) {
187- self . getPlayers ( function ( players ) {
188+ self . getPlayers ( ( players ) => {
188189 self . emit ( 'kill' , {
189190 killer : players [ event . killerName ] ,
190191 victim : players [ event . victimName ] ,
@@ -200,7 +201,7 @@ Livescore.prototype._onKill = function(event) {
200201} ;
201202
202203Livescore . prototype . _onSuicide = function ( event ) {
203- self . getPlayers ( function ( players ) {
204+ self . getPlayers ( ( players ) => {
204205 self . emit ( 'suicide' , {
205206 player : players [ event . playerName ]
206207 } ) ;
@@ -210,15 +211,15 @@ Livescore.prototype._onSuicide = function(event) {
210211Livescore . prototype . _onBombPlanted = function ( event ) {
211212 self . setTime ( self . options [ Livescore . Enums . EOption [ 'BOMB_TIME' ] ] ) ;
212213
213- self . getPlayers ( function ( players ) {
214+ self . getPlayers ( ( players ) => {
214215 self . emit ( 'bombPlanted' , {
215216 player : players [ event . playerName ]
216217 } ) ;
217218 } ) ;
218219} ;
219220
220221Livescore . prototype . _onBombDefused = function ( event ) {
221- self . getPlayers ( function ( players ) {
222+ self . getPlayers ( ( players ) => {
222223 self . emit ( 'bombDefused' , {
223224 player : players [ event . playerName ]
224225 } ) ;
@@ -244,7 +245,7 @@ Livescore.prototype._onRoundEnd = function(event) {
244245
245246 self . setTime ( self . options [ Livescore . Enums . EOption [ "FREEZE_TIME" ] ] ) ;
246247
247- self . getTeams ( function ( teams ) {
248+ self . getTeams ( ( teams ) => {
248249 if ( Object . keys ( teams ) . length ) {
249250 teams [ Livescore . Enums . ESide [ 'TERRORIST' ] ] . score = event . terroristScore ;
250251 teams [ Livescore . Enums . ESide [ 'COUNTERTERRORIST' ] ] . score = event . counterTerroristScore ;
@@ -270,7 +271,7 @@ Livescore.prototype._onPlayerJoin = function(event) {
270271} ;
271272
272273Livescore . prototype . _onPlayerQuit = function ( event ) {
273- self . getPlayers ( function ( players ) {
274+ self . getPlayers ( ( players ) => {
274275 self . emit ( 'playerQuit' , {
275276 player : players [ event . playerName ]
276277 } ) ;
@@ -307,16 +308,16 @@ function updateGame(scoreboard) {
307308 history : scoreboard . ctMatchHistory
308309 } ) ;
309310
310- self . getTeams ( function ( teams ) {
311- scoreboard . TERRORIST . forEach ( function ( pl ) {
311+ self . getTeams ( ( teams ) => {
312+ scoreboard . TERRORIST . forEach ( ( pl ) => {
312313 var player = new Livescore . Classes . Player ( pl ) ;
313314 player . team = teams [ Livescore . Enums . ESide [ 'TERRORIST' ] ] ;
314315
315316 self . players [ player . name ] = player ;
316317 tPlayers . push ( player ) ;
317318 } ) ;
318319
319- scoreboard . CT . forEach ( function ( pl ) {
320+ scoreboard . CT . forEach ( ( pl ) => {
320321 var player = new Livescore . Classes . Player ( pl ) ;
321322 player . team = teams [ Livescore . Enums . ESide [ 'COUNTERTERRORIST' ] ] ;
322323
0 commit comments