Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Client chooser error #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

if you will forget to add port when using OT option with client chooser it will 
show exception.

Corrected code:

private void ChooseClient()
        {
            options.UseOT = uxUseOT.Checked;
            LoginServer ls = null;
            if (options.UseOT)
            {
                try
                {
                    string[] split = uxLoginServer.Text.Split(new char[] { ':' });
                    ls = new LoginServer(split[0], short.Parse(split[1]));
                }
                catch (Exception)
                {
                    ls = new LoginServer(uxLoginServer.Text, (short)7171); //Or you can use MessageBox.Show("Please enter port");
                }
            }
            client = ClientChooserBase.ChooseClient(options, uxClients.SelectedItem, ls);
            newClientChooser.Dispose();
        }

Original issue reported on code.google.com by muttd...@gmail.com on 29 Jun 2010 at 4:57

GoogleCodeExporter commented 9 years ago

Original comment by ian320 on 9 Jul 2010 at 11:20

GoogleCodeExporter commented 9 years ago

Original comment by brunodun...@gmail.com on 26 Jul 2010 at 3:00