Print Page | Close Window

Version Checker

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=122
Printed Date: 20 December 2006 at 5:52pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Version Checker
Posted By: Sync
Subject: Version Checker
Date Posted: 11 February 2006 at 2:36pm
Ok with what it had in it I didn't have a clue how it worked so i made an easy one
Lets start with the server
In modGeneral Replace

' Version constants
Public Const CLIENT_MAJOR = 3
Public Const CLIENT_MINOR = 0
Public Const CLIENT_REVISION = 3

With

' Version constants
Public Const VERSION = "1.0"


Ok now to modServerTCP
And Find

             ' Check versions
             If Val(Parse(3)) < CLIENT_MAJOR Or Val(Parse(4)) < CLIENT_MINOR Or Val(Parse(5)) < CLIENT_REVISION Then
                 Call AlertMsg(Index, "Version Outdated, please Visit http://blablabla.com")
                 Exit Sub
             End If


And Replace it with

             ' Check versions
             If Val(Parse(3)) < VERSION Then
                 Call AlertMsg(Index, "Version Outdated, please Visit http://blablabla.com")
                 Exit Sub
             End If

Now to the Client Side
add in modTypes

' Version constants
Public Const VERSION = "1.0"

Ok now find in modGameLogic

        Case MENU_STATE_LOGIN 
             frmLogin.Visible = False
             If ConnectToServer = True Then
                 Call SetStatus("Connected, sending login information...")
                 Call SendLogin(frmLogin.txtName.text, frmLogin.txtPassword.text)
             End If

And replace it with
Code:
        Case MENU_STATE_LOGIN 
             frmLogin.Visible = False
             If ConnectToServer = True Then
                 Call SetStatus("Connected, sending login information...")
                 Call SendLogin(frmLogin.txtName.text, frmLogin.txtPassword.text, VERSION)
             End If



Ok and now to modClientTCP
and find Sub SendLogin and Replace the sub with
Sub SendLogin(ByVal Name As String, ByVal Password As String, ByVal VERSION As String)
Dim packet As String

    packet = "login" & SEP_CHAR & Trim(Name) & SEP_CHAR & Trim(Password) & SEP_CHAR & VERSION & SEP_CHAR & END_CHAR
    Call SendData(packet)
End Sub

And thats it just change the
Public Const VERSION = "1.0"

When you update the client and server



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info