Me Gusta Posted April 8, 2012 Author Share Posted April 8, 2012 This is a tutorial to bring back a feature from EE/ES for EO2\. That feature would be the server status checker. What this does(if it isn't obvious to you) is tells you whether the games server is online or offline. Now to begin.**Client***This is all client sidedFormOkay open up your source and go to frmMenu and create 2 labels and a timer:Timer:Name: tmrStatusTop: 0Left: 0Interval: 2000Label 1:Place anywhere you wantlabel name: lblWTF(name whatever)Caption: The Server is:Font: GeorgiaFont style: boldColor: WhiteLabel 2:Place next to label 1label name: lblOnlineCaption: Checking…Font: GeorgiaFont style: boldColor: WhiteCodeOkay now that the form work is done open up the frmMenu code and create a private sub called: tmrStatus_Timerit should look like this```Private Sub tmrStatus_Timer()End Sub```in the sub put:```  If ConnectToServer(1) Then    lblOnline.Caption = "Online"    lblOnline.ForeColor = vbGreen  Else    lblOnline.Caption = "Offline"    lblOnline.ForeColor = vbRed  End If```This will check if the server is online. If it is then it'll say Online in green. If not it'll say offline in red.After all this your code in Private Sub tmrStatus_Timer should look like this:```Private Sub tmrStatus_Timer()  If ConnectToServer(1) Then    lblOnline.Caption = "Online"    lblOnline.ForeColor = vbGreen  Else    lblOnline.Caption = "Offline"    lblOnline.ForeColor = vbRed  End IfEnd Sub```Credit goes to:Nickpop123For helping me figure this out.I've tested this it works. Link to comment Share on other sites More sharing options...
Growlith1223 Posted April 8, 2012 Share Posted April 8, 2012 Have you tested this to see if it even works? Link to comment Share on other sites More sharing options...
Me Gusta Posted April 9, 2012 Author Share Posted April 9, 2012 @Growlith1223:> Have you tested this to see if it even works?@Me:> I've tested this it works. Link to comment Share on other sites More sharing options...
Growlith1223 Posted April 9, 2012 Share Posted April 9, 2012 oh lol i didn't see that xD Link to comment Share on other sites More sharing options...
fernz123 Posted April 14, 2012 Share Posted April 14, 2012 I think this is basic enough for me to write by myself but thanks anyway :) Link to comment Share on other sites More sharing options...
SkywardRiver Posted April 15, 2012 Share Posted April 15, 2012 Great feature for developing teams and full made games alike! Link to comment Share on other sites More sharing options...
Wilfre Posted April 15, 2012 Share Posted April 15, 2012 You can use 1 label also.put 1 of the labelsand in the Timer, the Sub should look like this```Private Sub tmrStatus_Timer()  If ConnectToServer(1) Then    lblOnline.Caption = "The server is currently Online"    lblOnline.ForeColor = vbGreen  Else    lblOnline.Caption = "The server is currently Offline"    lblOnline.ForeColor = vbRed  End IfEnd Sub``` Link to comment Share on other sites More sharing options...
Domino_ Posted April 15, 2012 Share Posted April 15, 2012 Isnt there a way to do without timer? Like he checks server status when you press login so there under username text is displayed server status? Link to comment Share on other sites More sharing options...
Me Gusta Posted April 15, 2012 Author Share Posted April 15, 2012 @Domino_:> Isnt there a way to do without timer? Like he checks server status when you press login so there under username text is displayed server status?I'll look at it@Wilfre:> You can use 1 label also.> put 1 of the labels> and in the Timer, the Sub should look like this> > ```> Private Sub tmrStatus_Timer()> Â Â If ConnectToServer(1) Then> Â Â Â Â lblOnline.Caption = "The server is currently Online"> Â Â Â Â lblOnline.ForeColor = vbGreen> Â Â Else> Â Â Â Â lblOnline.Caption = "The server is currently Offline"> Â Â Â Â lblOnline.ForeColor = vbRed> Â Â End If> End Sub> ```Then it would be one ugly blotch of color Link to comment Share on other sites More sharing options...
Domino_ Posted April 15, 2012 Share Posted April 15, 2012 @Me:> I'll look at it@Me:> I'll look at itChange login code (case 1 ) to```    Case 1      If Not picLogin.Visible Then        ' destroy socket, change visiblity        DestroyTCP        picCredits.Visible = False        picLogin.Visible = True        picRegister.Visible = False        picCharacter.Visible = False        picMain.Visible = False        'Login checks server status        If ConnectToServer(1) Then            lblSStatus.Caption = "Server status: Online"            lblSStatus.ForeColor = vbGreen          Else            lblSStatus.Caption = "Server status: Offline"            lblSStatus.ForeColor = vbRed        End If        ' play sound        PlaySound Sound_ButtonClick      End If```and make label where you want to.. I added it in login area so before login you can see status. You can also add it somewhere else.>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/d42bd868677c0d560486a90abbf0a9b5.PNG) Link to comment Share on other sites More sharing options...
Wilfre Posted April 15, 2012 Share Posted April 15, 2012 How'd you get the menu translucency Domino Link to comment Share on other sites More sharing options...
Naruto Posted January 3, 2013 Share Posted January 3, 2013 I get an error here```frmMain.Socket.RemoteHost = Options.IP```Invalid operation at current stateerror number 40020 Link to comment Share on other sites More sharing options...
WiseRock Posted January 3, 2013 Share Posted January 3, 2013 > I get an error here```> > frmMain.Socket.RemoteHost = Options.IP> > ```> Invalid operation at current state> > error number 40020To fix this first delete those 2 lines```frmMain.Socket.RemoteHost = Options.IP``````frmMain.Socket.RemotePort = Options.PORT```Then go to frmMain find Socket and in Properties find RemoteHost and Remote Port and put"127.0.0.1" or your IP"7001" or your Port Link to comment Share on other sites More sharing options...
Stach Posted January 3, 2013 Share Posted January 3, 2013 > How'd you get the menu translucency DominoHe did it in his graphic.> To fix this first delete those 2 lines> > ```> frmMain.Socket.RemoteHost = Options.IP> ```> ```> frmMain.Socket.RemotePort = Options.PORT> ```> > Then go to frmMain find Socket and in Properties find RemoteHost and Remote Port and put> > "127.0.0.1" or your IP> > "7001" or your PortThat's doing the same thing. Error 40020 generally occurs when you are trying to send/receive data while the socket is disconnected. Link to comment Share on other sites More sharing options...
WiseRock Posted January 28, 2013 Share Posted January 28, 2013 Or make sure the Timer Is on an interval of 1000 Link to comment Share on other sites More sharing options...
abhi2011 Posted January 28, 2013 Share Posted January 28, 2013 Make the socket to connect to the server? Link to comment Share on other sites More sharing options...
Fuyuumi Posted January 28, 2013 Share Posted January 28, 2013 Can I use pictures instead of labels and how do I do that? Link to comment Share on other sites More sharing options...
SkywardRiver Posted January 28, 2013 Share Posted January 28, 2013 You would have to make 2 different pictures and then instead of making the caption of the label change make the picture change Link to comment Share on other sites More sharing options...
abhi2011 Posted January 29, 2013 Share Posted January 29, 2013 @Jax a single picture is enough.Just change the picture while run time by hardcoding it.Something like this```if connected thenpicstatus.picture = directoryelsepicstatus.picture = directory``` Link to comment Share on other sites More sharing options...
SkywardRiver Posted January 29, 2013 Share Posted January 29, 2013 Another way of doing it is to simply have 2 pictures and change their visibility. Link to comment Share on other sites More sharing options...
abhi2011 Posted January 29, 2013 Share Posted January 29, 2013 That would consume a bit more memory I believe. Link to comment Share on other sites More sharing options...
WiseRock Posted January 29, 2013 Share Posted January 29, 2013 > Another way of doing it is to simply have 2 pictures and change their visibility.This is what your looking for```If ConnectedToServer(1) thenpic1.visible = truepic2.visible = falseelsepic2.visible = truepic1.visible = falseend if``` Link to comment Share on other sites More sharing options...
cheatking Posted January 29, 2013 Share Posted January 29, 2013 Disregard this eclipse ate my post and I can't be arsed to fix it. Link to comment Share on other sites More sharing options...
DMF Posted January 29, 2013 Share Posted January 29, 2013 does work o-o ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
cheatking Posted January 29, 2013 Share Posted January 29, 2013 > ```> [color]pic1[/color][color].[/color][color]visible [/color][color]=[/color] [color][font]ConnectedToServer[/font][/color][color][font]([/font][/color][color][font]1[/font][/color][color][font])[/font][/color]> > [color]pic2[/color][color].[/color][color]visible [/color][color]= Not[/color][color] [/color][color][font]ConnectedToServer[/font][/color][color][font]([/font][/color][color][font]1[/font][/color][color][font])[/font][/color]> ```> > I think it's Not, I forget VBHoly shit eclipse what did you do to my post O.o Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now