Ejemplo n.º 1
0
        public static void Home(this Phone phone, Client sender)
        {
            if (phone.BatteryLevel > 3)
            {
                API.shared.triggerClientEvent(sender, "ReloadHomeScreen", Phone.PhoneWallpapers[phone.WallpaperId]);

                List <PhoneApp> phoneApps = PhoneAppRepository.GetPhoneAppsByPhoneId(phone.Id);
                API.shared.triggerClientEvent(sender, "LoadPhoneApps", phoneApps.Count, string.Join(",", phoneApps.Select(pa => pa.Position)), string.Join(",", phoneApps.Select(pa => PhoneApp.AppInfo[pa.AppId][0])),
                                              string.Join(".", phoneApps.Select(pa => PhoneApp.AppInfo[pa.AppId][1])));

                API.shared.triggerClientEvent(sender, "phoneUpdateClock", ServerInit.ServerHour, ServerInit.ServerMinute);
            }
        }
Ejemplo n.º 2
0
        public static async void Show(this Phone phone, Client sender)
        {
            await Task.Run(async() =>
            {
                API.shared.triggerClientEvent(sender, "initiatePhone");
                await Task.Delay(1000);
                if (phone.BatteryLevel > 3)
                {
                    API.shared.triggerClientEvent(sender, "PhoneHomeScreen", phone.BatteryLevel, phone.InstalledSim, Phone.PhoneWallpapers[phone.WallpaperId], phone.PassActive);

                    List <PhoneApp> phoneApps = PhoneAppRepository.GetPhoneAppsByPhoneId(phone.Id);
                    API.shared.triggerClientEvent(sender, "LoadPhoneApps", phoneApps.Count, string.Join(",", phoneApps.Select(pa => pa.Position)), string.Join(",", phoneApps.Select(pa => PhoneApp.AppInfo[pa.AppId][0])),
                                                  string.Join(".", phoneApps.Select(pa => PhoneApp.AppInfo[pa.AppId][1])));

                    API.shared.triggerClientEvent(sender, "phoneUpdateClock", ServerInit.ServerHour, ServerInit.ServerMinute);
                }
            });
        }