Sealbreaker Posted August 26, 2010 Author Share Posted August 26, 2010 I recently have a problem with my server… So i tried myself on adding gravity to EO and added a sub in my game-loop (client-sided) which calls sendgravity:```Public Sub SendGravity(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CGravity SendData Buffer.ToArray() Set Buffer = NothingEnd Sub```and serverside the place where the server reacts and which also is the part that causes my server to crash (btw, it crashes WITHOUT giving me the chance to debug or any further information):```' :::::::::::::::::::' :: Gravity Packet ::' :::::::::::::::::::Sub HandleGravity(ByVal Index As Long) Dim n As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer If Index = 0 Or Index > MAX_PLAYERS Then Exit Sub If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_PLATFORM Then Call SendPlayerXY(Index) Exit Sub End If If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type <> TILE_TYPE_PLATFORM Then Call SetPlayerY(Index, GetPlayerY(Index) + 1) SendPlayerXY (Index) End If End If Set Buffer = NothingEnd Sub```SO, i need any help i can get to get my server and this code working…(i had this sort of topic before with a "subscript out of range" error i had within the gravity-code (serverside again) which i fixed with help of robin and which i changed a bit... The new problem (crash) seems to me to be caused through the if-check for the index being higher than max_players...-seal Link to comment Share on other sites More sharing options...
PD Posted August 26, 2010 Share Posted August 26, 2010 umm…may i ask why your making a new buffer if you aint sending anything. Link to comment Share on other sites More sharing options...
Robin Posted August 26, 2010 Share Posted August 26, 2010 @Zesh:> umm…may I ask why your making a new buffer if you aint sending anything.He's sending just a packet header to trigger a procedure. Link to comment Share on other sites More sharing options...
PD Posted August 27, 2010 Share Posted August 27, 2010 I was taking about HandleGravity but im tired so forgive me, i know about packets and stuff. I dont see anything wrong with it if no on fix it for you by morning ill check it out :cheesy: Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2010 Author Share Posted August 27, 2010 okay, i can wait for help ( if noone helps before you)-seal Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 29, 2010 Author Share Posted August 29, 2010 BUMP!i need help….and i got my 900th post now ;)-seal Link to comment Share on other sites More sharing options...
DarkSpine Posted August 29, 2010 Share Posted August 29, 2010 When is Index ever set? Is there a portion of the code that sets it? If not, you need to have the client send MyIndex, and then have the handle code read it, and set Index to it, or have the client send the player's name, and use```FindPlayer(Name)```, after setting the variable name to the received data.I may be wrong, as I have been lately, but since nobody else has tried anything…And it's the only thing I can see that could possibly be screwing it up.~Urame Link to comment Share on other sites More sharing options...
shadowwulf Posted August 29, 2010 Share Posted August 29, 2010 index is set when gravity is called as an argument in gravity. Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 30, 2010 Author Share Posted August 30, 2010 so… should i do what urame said... or not??-seal Link to comment Share on other sites More sharing options...
shadowwulf Posted August 30, 2010 Share Posted August 30, 2010 wait it wont let you debug?are you running the server and client by hitting the play button in VB?if you do it that way and it crashes, you are prompted to debug… Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 30, 2010 Author Share Posted August 30, 2010 sure i did it in vb-editor <.< that's the problem.. i just don't get the problem :/-seal Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now