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 >.>
ClientCode:
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
ServerCode:
' ::::::::::::::::::::::::::::
' :: 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) <= ADMIN_MONITER Then
Call GlobalMsg(GetPlayerName(Index) & " has joined " & GAME_NAME & "!", JoinLeftColor)
Else
Call GlobalMsg(GetPlayerName(Index) & " has joined " & GAME_NAME & "!", White)
End If
' Send an ok to client to start receiving in game data
'Call SendDataTo(Index, "LOGINOK" & SEP_CHAR & Index & END_CHAR)
' Send some more little goodies, no need to explain these
Call CheckEquippedItems(Index)
Call SendClasses(Index)
Call SendItems(Index)
Call SendNpcs(Index)
Call SendBank(Index)
Call SendShops(Index)
Call SendQuest(Index)
Call SendSpells(Index)
Call SendInventory(Index)
Call SendWornEquipment(Index)
Call SendHP(Index)
Call SendMP(Index)
Call SendSP(Index)
Call SendStats(Index)
Call SendWeatherTo(Index)
Call SendTimeTo(Index)
Call SendElements(Index)
' Warp the player to his saved location
Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
' Send welcome messages
Call SendWelcome(Index)
' Send the flag so they know they can start doing stuff
Call SendDataTo(Index, "INGAME" & END_CHAR)
End Sub
Ok, so I figured that since it got stuck on the SetStatus, the Call SendUseChar wasn't working properly, but everything seems fine. I did add some other features, so in the sub joinGame I commented out things like Call SendQuests Etc... but that still did nothing, so I guess the code doesn't even go that far. I'm thinking that maybe there is a Winsock error, or something is very wrong with the connection, or a packet is wrong.. I have no clue, would anyone know what this problem may be?