예제 #1
0
 public static void smurfEnd(string _username, LoLLauncher.Region _region, double _endXp, double _endIp, double _endLevel, double _expforNextLevel)
 {
     if (sessionExists)
     {
         currentSession.smurfs.Find(i => (i.username == _username && i.region == _region)).endXp            = _endXp;
         currentSession.smurfs.Find(i => (i.username == _username && i.region == _region)).endIp            = _endIp;
         currentSession.smurfs.Find(i => (i.username == _username && i.region == _region)).endLevel         = _endLevel;
         currentSession.smurfs.Find(i => (i.username == _username && i.region == _region)).endXpToNextLevel = _expforNextLevel;
         updateCurrent();
     }
 }
예제 #2
0
 public static void smurfStart(string _username, LoLLauncher.Region _region, double _startXp, double _startIp, double _startLevel, double _expforNextLevel)
 {
     if (sessionExists)
     {
         currentSession.smurfs.Add(new SmurfDataSessionSave()
         {
             username           = _username,
             region             = _region,
             startXp            = _startXp,
             startIp            = _startIp,
             startLevel         = _startLevel,
             startXpToNextLevel = _expforNextLevel
         });
         updateCurrent();
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (maxLevels.SelectedValue != null && rgCombo.SelectedValue != null)
            {
                LoLLauncher.Region regi = (LoLLauncher.Region)System.Enum.Parse(typeof(LoLLauncher.Region), rgCombo.SelectedValue.ToString());
                if (username.Text.Length > 0 && password.Text.Length > 0)
                {
                    bool smurfFound = App.smurfList.Any(smurf => (smurf.username == username.Text && smurf.region == regi));
                    if (!smurfFound)
                    {
                        Smurf newSmurf = new Smurf();
                        newSmurf.username = username.Text;
                        newSmurf.password = password.Text;
                        newSmurf.region   = regi;

                        if (maxLevels.SelectedValue.ToString() == "Unlimited")
                        {
                            newSmurf.maxLevel = 31;
                        }
                        else
                        {
                            newSmurf.maxLevel = Int32.Parse(maxLevels.SelectedValue.ToString());
                        }
                        App.smurfList.Add(newSmurf);
                        Settings.update();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("This smurf already exists");
                    }
                }
                else
                {
                    MessageBox.Show("Please fill all inputs");
                }
            }
            else
            {
                MessageBox.Show("Please fill all inputs");
            }
        }
예제 #4
0
 private void LoadFile(String fileName)
 {
     try
     {
         accountList.Items.Clear();
         String[] filelines = File.ReadAllLines(fileName);
         foreach (String line in filelines)
         {
             if (line.Split(' ').Count() > 3)
             {
                 LoLLauncher.Region     reg = (LoLLauncher.Region)Enum.Parse(typeof(LoLLauncher.Region), line.Split(' ')[2]);
                 LoLLauncher.QueueTypes q   = (LoLLauncher.QueueTypes)Enum.Parse(typeof(LoLLauncher.QueueTypes), line.Split(' ')[3]);
                 Panel tempPanel            = new Panel();
                 if (!panels.ContainsKey(line.Split(' ')[0]))
                 {
                     tempPanel.BackColor = Color.Black;
                     tempPanel.Size      = gamePanel.Size;
                     tempPanel.Anchor    = gamePanel.Anchor;
                     panels.Add(line.Split(' ')[0], tempPanel);
                 }
                 else
                 {
                     tempPanel = panels[line.Split(' ')[0]];
                 }
                 LoLLauncherClient acct = new LoLLauncherClient(line.Split(' ')[0], line.Split(' ')[1], reg, q, tempPanel.Handle, FindLoLExe());
                 accountList.Items.Add(acct);
             }
         }
     }
     catch (Exception ex)
     {
         String serverList = String.Join(", ", Enum.GetNames(typeof(LoLLauncher.Region)));
         String gameList   = String.Join(", ", Enum.GetNames(typeof(LoLLauncher.QueueTypes)));
         MessageBox.Show("Error: Incorrect format for input.\nPlease use:\n\tusername password server gamemode\nOne account per line\nServers: " + serverList + "\nGame modes: " + gameList);
     }
 }