void OnGettingMapInformation(CServerConnection con, CMap map) { GS_LoadedMaps.SetNowForServers(con.MapList.Where(m => m.Value.LoadingState == HalfClass.CurrentState.AllInfoFilled).Count(), con); GS_MapCount.SetNowForServers(con.MapList.Count, con); CDebug.Log("Received informations for " + map.Name); }
public async void ApplyManialinksToPlayer(string serverLogin, params CPlayer[] players) { var server = CManiaNextControl.XmlRPC_Clients[serverLogin]; foreach (var player in players) { await Task.Factory.StartNew(() => { while (player.LoadingState != HalfClass.CurrentState.AllInfoFilled || !player.ControllerLoaded) { ; } }); } Manialink_MapList.Send(new[] { CManiaNextControl.XmlRPC_Clients[serverLogin].Manager }, 0, players); Manialink_MapWidget.Send(new[] { CManiaNextControl.XmlRPC_Clients[serverLogin].Manager }, 0, players); Manialink_MapSideBarTools.Send(new[] { CManiaNextControl.XmlRPC_Clients[serverLogin].Manager }, 0, players); Manialink_MapInfo.Send(new[] { CManiaNextControl.XmlRPC_Clients[serverLogin].Manager }, 0, players); Manialink_ManiaExchangeList.Send(new[] { CManiaNextControl.XmlRPC_Clients[serverLogin].Manager }, 0, players); var gc_Dico = new Dictionary <int, Dictionary <string, string> >(); int i = 0; foreach (var map in server.MapList.Values) { var dico = gc_Dico[i] = new Dictionary <string, string>(); dico["UId"] = map.UId; dico["Name"] = map.Name; i++; } GS_MapCount.SetNowForPlayers(server.MapList.Where(m => m.Value.LoadingState == HalfClass.CurrentState.AllInfoFilled).Count(), players); GS_Maps.SetNowForPlayers(gc_Dico, players); GS_RefreshMapList.SetNowForPlayers(true, players); }