16-07-2006, 08:04 PM
with only the character name
ONLY SERVER SIDE
make a new module and name it modOfflineAccount
add all of this code to it
need to make a file list on frmServer named fileList
set its filter to *.ini
set its visibility to false
then you need these two subs but with your specific code in them..
now what this will do is find out which accoutn the character name belongs to then load in that account to the TempAccount array
allowing you to change anything in it you wish to change then you
can save it and be done with it
the saveing sub is something you can figure out on your own from
the code provided i am sure
the clear TempAccount sub is used to erase the info server side
enjoy
ONLY SERVER SIDE
make a new module and name it modOfflineAccount
add all of this code to it
Code:
Type TempAccountRec
Login As String * NAME_LENGTH
Password As String * NAME_LENGTH
Char(1 To MAX_CHARS) As PlayerRec
End Type
Public TempAccount As TempAccountRec
Sub GetChar(ByVal Name As String)
Dim f As Long
Dim s As String, X As Long
f = FreeFile
frmServer.fileList.Path = App.Path & "\accounts"
For X = 0 To frmServer.fileList.ListCount
Open (frmServer.fileList.Path & "/" & frmServer.fileList.List(X)) For Input As #f
Do While Not EOF(f)
Input #f, s
If Trim(LCase(s)) = ("name=" & Trim(LCase(Name))) Then
Close #f
Call LoadTempAccount(frmServer.fileList.List(X))
Exit Sub
End If
Loop
Close #f
Next X
End Sub
set its filter to *.ini
set its visibility to false
then you need these two subs but with your specific code in them..
Code:
Sub LoadTempAccount(ByVal Name As String)
Dim FileName As String
Dim n As Long, X As Byte
FileName = App.Path & "\accounts\" & Trim(Name)
TempAccount.Login = Trim(GetVar(FileName, "GENERAL", "Login"))
TempAccount.Password = Trim(GetVar(FileName, "GENERAL", "Password"))
For X = 1 To MAX_CHARS
With TempAccount.Char(X)
'place a copy of your load player Sub here
End With
Next X
End Sub
Sub ClearTempAccount()
Dim n As Long, X As Byte
TempAccount.Login = ""
TempAccount.Password = ""
For X = 1 To MAX_CHARS
With tempAccount.Char(X)
'place a copy of your clear player Sub here
End With
Next X
End Sub
allowing you to change anything in it you wish to change then you
can save it and be done with it
the saveing sub is something you can figure out on your own from
the code provided i am sure
the clear TempAccount sub is used to erase the info server side
enjoy