User Tag List

Page 7 of 7 FirstFirst ... 3 4 5 6 7
Results 43 to 45 of 45

Thread: [C#][Source] Cataclysm Launcher

  1. #43
    Founder <span style='color: #FF4500'>Tommy</span>'s Avatar
    Join Date
    Apr 2013
    Posts
    7,391
    XP
    3,449,104
    Level
    378
    Thanks
    889
    Thanked 1,858 Times in 1,120 Posts
    Quote Originally Posted by CDAGaming View Post
    Thanks for the Quick Reply!

    I saw that the server string said the name of the server & Not the IP, I Fixed it but it still doesn't work

    Is there i chance I can send you the modified source code to see if there is anything else you can suggest to me?

    Thanks Also in advance, Tommy :D
    You removed the "status" bool from the try catch but you still have it checking if status is true in the invoke function. It will always be false if you don't have it setting to true during a check.

    Code:
                try
                {
                    TcpClient client = new TcpClient();
    
                    client.Connect(Settings.Default.server, Settings.Default.port);
    
                    status = true;
                }
                catch (Exception ex)
                {
                    status = false;
                }

  2. #44
    Emulation Addict
    Join Date
    Nov 2015
    Posts
    4
    XP
    616
    Level
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Tommy View Post
    You removed the "status" bool from the try catch but you still have it checking if status is true in the invoke function. It will always be false if you don't have it setting to true during a check.

    Code:
                try
                {
                    TcpClient client = new TcpClient();
    
                    client.Connect(Settings.Default.server, Settings.Default.port);
    
                    status = true;
                }
                catch (Exception ex)
                {
                    status = false;
                }
    Sorry for the late response, Have had PC issues these past few days
    Will definitly try & See if it works


    Edit: Both codes are now identical to each other yet on the Original, it shows Online / Correct & On Ours, it still shows offline, which is incorrect

    Original:
    Code:
    private void checkServerStatusBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
            {
                bool status = false;
    
                try
                {
                    TcpClient client = new TcpClient();
    
                    client.Connect(Settings.Default.server, Settings.Default.port);
    
                    status = true;
                }
                catch (Exception ex)
                {
                    status = false;
                }
    
                statusLabel.Invoke((MethodInvoker)delegate
                {
                    if (status)
                    {
                        statusLabel.ForeColor = Color.Green;
                        statusLabel.Text = "Online";
                    }
                    else
                    {
                        statusLabel.ForeColor = Color.Red;
                        statusLabel.Text = "Offline";
                    }
                });
            }
    Ours:

    Code:
    private void checkServerStatusBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
            {
                bool status = false;
    
                using (TcpClient client = new TcpClient())
                {
                    try
                    {
                        client.Connect(Settings.Default.server, Settings.Default.port);
    
                        status = true;
                    }
                    catch (Exception ex)
                    {
                        status = false;
                    }
                }
    
                statusLabel.Invoke((MethodInvoker)delegate
                {
                    if (status)
                    {
                        statusLabel.ForeColor = Color.LimeGreen;
                        statusLabel.Text = "Online";
                    }
                    else
                    {
                        statusLabel.ForeColor = Color.IndianRed;
                        statusLabel.Text = "Offline";
                    }
                });
            }
    Thanks for your help so far, & I really hope I can solve this with your assistance
    Last edited by CDAGaming; 08-06-2016 at 02:14 AM.
    Achievements:
    3 months registered Level V

  3. #45
    Founder <span style='color: #FF4500'>Tommy</span>'s Avatar
    Join Date
    Apr 2013
    Posts
    7,391
    XP
    3,449,104
    Level
    378
    Thanks
    889
    Thanked 1,858 Times in 1,120 Posts
    The last thing I can think of is the settings not actually changing. I did test this without using the settings "server" and "port" and it showed my server Online. For example:

    Code:
    client.Connect("emudevs.com", 3724);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •