| Mirage Source http://web.miragesource.net/forums/ |
|
| Not Connecting http://web.miragesource.net/forums/viewtopic.php?f=201&t=4102 |
Page 1 of 1 |
| Author: | jsventor [ Mon Aug 04, 2008 5:24 am ] |
| Post subject: | Not Connecting |
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 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) <= 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? |
|
| Author: | Lea [ Mon Aug 04, 2008 8:54 am ] |
| Post subject: | Re: Not Connecting |
It's likely the packet is never being sent to the client saying it's OK to continue. Set a breakpoint as far as you know the server makes it, then use F8 to find the exact line. There's likely a subscript out of range error or something that's not being reported because of the goofy use of variables in MS. When you find it, you'll have a big clue on where to look to fix it. |
|
| Author: | jsventor [ Mon Aug 04, 2008 10:44 pm ] |
| Post subject: | Re: Not Connecting |
EDit: nvm, It didnt do that, its has the Number sett perfectly fine, but still nothing |
|
| Author: | Leighland [ Tue Aug 05, 2008 4:10 pm ] |
| Post subject: | Re: Not Connecting |
What are you using to connect, IE: port etc. And are you using a router by any chance? If so, have you forwarded the port you are using for mirage? Also, in you joingame sub, uncomment the LOGINOK send! |
|
| Author: | jsventor [ Tue Aug 05, 2008 9:56 pm ] |
| Post subject: | Re: Not Connecting |
Still nothing, I'm just going to remake a server Lol |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|