Fix stats with multiple clients.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4151 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		
							
								
								
									
										13
									
								
								core/core.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								core/core.js
									
									
									
									
									
								
							| @@ -793,15 +793,12 @@ async function loadSettings() { | ||||
| } | ||||
|  | ||||
| function sendStats() { | ||||
| 	var any = false; | ||||
| 	for (var process of Object.values(gProcesses)) { | ||||
| 		if (process.app && process.stats) { | ||||
| 			process.app.send({action: 'stats', stats: getStats()}); | ||||
| 			any = true; | ||||
| 	let apps = Object.values(gProcesses).filter(process => process.app && process.stats).map(process => process.app); | ||||
| 	if (apps.length) { | ||||
| 		let stats = getStats(); | ||||
| 		for (let app of apps) { | ||||
| 			app.send({action: 'stats', stats: stats}); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (any) { | ||||
| 		setTimeout(sendStats, 1000); | ||||
| 	} else { | ||||
| 		gStatsTimer = false; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user