• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[C#][Source] Cataclysm Launcher

Vitrex

Moderator
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

can you upload the pictures to online image viewer like tinypic, imgur , imageshack ? since attachment is so small it's practically impossible to see anything.
Thank you.
 

Tommy

Founder
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);

                [COLOR="#00FF00"]status = true;[/COLOR]
            }
            catch (Exception ex)
            {
                [COLOR="#00FF00"]status = false;[/COLOR]
            }
 

CDAGaming

Emulation Addict
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);

                [COLOR="#00FF00"]status = true;[/COLOR]
            }
            catch (Exception ex)
            {
                [COLOR="#00FF00"]status = false;[/COLOR]
            }

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:

Tommy

Founder
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);
 
Top