04-08-2008, 05:24 AM
Annoying Problem, basically, whenever I use a character, it gets stuck on "Connected, sending char data..."
Ok, so First off, I compared the source to a Regular Mirage Source, and everything is basically the same.
Here is all the code I have for using characters, I reviewed MILLIONS of times >.>
Client
Server
[code]Sub JoinGame(ByVal Index As Long)
' Set the flag so we know the person is in the game
Player(Index).InGame = True
' Send a global message that he/she joined
If GetPlayerAccess(Index)
Ok, so First off, I compared the source to a Regular Mirage Source, and everything is basically the same.
Here is all the code I have for using characters, I reviewed MILLIONS of times >.>
Client
Code:
Case MENU_STATE_USECHAR
frmChars.Visible = False
If ConnectToServer = True Then
Call SetStatus("Connected, sending char data...")
Call SendUseChar(frmChars.lstChars.ListIndex + 1)
End If
Code:
Sub SendUseChar(ByVal CharSlot As Long)
Dim Packet As String
Packet = "usechar" & SEP_CHAR & CharSlot & END_CHAR
Call SendData(Packet)
End Sub
Server
Code:
' ::::::::::::::::::::::::::::
' :: Using character packet ::
' ::::::::::::::::::::::::::::
If LCase(Parse(0)) = "usechar" Then
If Not IsPlaying(Index) Then
CharNum = Val(Parse(1))
' Prevent hacking
If CharNum < 1 Or CharNum > MAX_CHARS Then
Call HackingAttempt(Index, "Invalid CharNum")
Exit Sub
End If
' Check to make sure the character exists and if so, set it as its current char
If CharExist(Index, CharNum) Then
Player(Index).CharNum = CharNum
Call JoinGame(Index)
CharNum = Player(Index).CharNum
Call AddLog(GetPlayerLogin(Index) & "/" & GetPlayerName(Index) & " has began playing " & GAME_NAME & ".", PLAYER_LOG)
Call TextAdd(frmServer.txtText, GetPlayerLogin(Index) & "/" & GetPlayerName(Index) & " has began playing " & GAME_NAME & ".", True)
Call UpdateCaption
' Now we want to check if they are already on the master list (this makes it add the user if they already haven't been added to the master list for older accounts)
If Not FindChar(GetPlayerName(Index)) Then
f = FreeFile
Open App.Path & "\accounts\charlist.txt" For Append As #f
Print #f, GetPlayerName(Index)
Close #f
End If
Else
Call AlertMsg(Index, "Character does not exist!")
End If
End If
Exit Sub
End If
[code]Sub JoinGame(ByVal Index As Long)
' Set the flag so we know the person is in the game
Player(Index).InGame = True
' Send a global message that he/she joined
If GetPlayerAccess(Index)