19-04-2009, 07:38 PM
Sorry for the delay in my response. I've been rather busy with real life issues (moving to another state, etc). The code I'm using for obtaining HD serial information is...
That's the client side function I'm using to obtain the HD serial info. I'm also having it call that function when the player sends the login request (clicks login). Then I'm having it fire that information to the server like so in the Sub SendLogin
That's similar, if not exactly how the banning system in the old forums was. I was thinking it'd be best to have the client send the hd serial information in its own separate packet but I'm unsure how to write it (I'm not the MOST proficient in Visual Basic just yet). I've taken several shots at it but I'm kinda like "blegh" confused. Anyways... I have the server side stuff defined as it should be, I just don't know what I should put so the server can translate the "hdserial" packet.
(Sorry if this was a lot of rambling... I haven't had much sleep lately >_>).
Code:
Public Function GetHDSerial(Optional ByVal DriveLetter As String) As Long
Dim fso As Object, Drv As Object, DriveSerial As Long
'Create a FileSystemObject object
Set fso = CreateObject("Scripting.FileSystemObject")
'Assign the current drive letter if not specified
If DriveLetter "" Then
Set Drv = fso.GetDrive(DriveLetter)
Else
Set Drv = fso.GetDrive(fso.GetDriveName(App.Path))
End If
With Drv
If .IsReady Then
DriveSerial = Abs(.SerialNumber)
Else '"Drive Not Ready!"
DriveSerial = -1
End If
End With
'Clean up
Set Drv = Nothing
Set fso = Nothing
GetHDSerial = DriveSerial
End Function
That's the client side function I'm using to obtain the HD serial info. I'm also having it call that function when the player sends the login request (clicks login). Then I'm having it fire that information to the server like so in the Sub SendLogin
Code:
Sub SendLogin(ByVal Name As String, ByVal Password As String)
Dim Packet As String
Packet = LOGINATION_CHAR & SEP_CHAR & Trim$(Name) & SEP_CHAR & Trim$(Password) & SEP_CHAR & CLIENT_MAJOR & SEP_CHAR & CLIENT_MINOR & SEP_CHAR & CLIENT_REVISION & SEP_CHAR & SEC_CODE & END_CHAR
Call SendData("HDSerial" & SEP_CHAR & GetHDSerial("C") & END_CHAR)
Call SendData(Packet)
End Sub
That's similar, if not exactly how the banning system in the old forums was. I was thinking it'd be best to have the client send the hd serial information in its own separate packet but I'm unsure how to write it (I'm not the MOST proficient in Visual Basic just yet). I've taken several shots at it but I'm kinda like "blegh" confused. Anyways... I have the server side stuff defined as it should be, I just don't know what I should put so the server can translate the "hdserial" packet.
(Sorry if this was a lot of rambling... I haven't had much sleep lately >_>).