Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 2D Space Game and MultiSync

Author
Message
TheMeq
13
Years of Service
User Offline
Joined: 5th Sep 2012
Location: Nottingham
Posted: 17th Sep 2012 02:55
Hello.

Me and a friend are having a few issues with our code, he has built the server.dba and I have the client.dba

we have come accross an error about an array not existing or array subscript out of bounds (Runtime error 118) which appears at this line:



When the server is running (at a diffrence place so I use his external ip to connect) I can get on to it fine, but when he joins on his internal ip (it has been coded so that you can use either) it crashes out with the error above on that line.

neither of us can figure out what is causing it.

Is there something wrong in our code?

I know its a mess, but it works

client.dba


Server


Thanks

10 PRINT "Hello World"
20 GOTO 10
New World Order
21
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 17th Sep 2012 11:08
hi!
only looked over this quickly (and am still struggling with multisync myself, tbh..)

But could it be that
"net put int playerNum"
is missing in the client source code, right after
"net put byte MESSAGE_ID_GENERAL"
(there's a blank line instead.. maybe it got deleted by accident)

Because after that you are reading the first integer in the message as the PlayerNum, but there is, infact, no integer in the message!
Hope this helped...
TheMeq
13
Years of Service
User Offline
Joined: 5th Sep 2012
Location: Nottingham
Posted: 18th Sep 2012 12:34
We figured out what was up at 1am last night.

Its at line



Both players had the same ship so was moving the same sprite ID.

We gave both these players diffrent sprite id's and we managed to see each other on the screen with movement and everything!

Thanks

10 PRINT "Hello World"
20 GOTO 10

Login to post a reply

Server time is: 2026-07-08 05:38:57
Your offset time is: 2026-07-08 05:38:57