Raknet Error

BlitzMax Forums/BlitzMax Beginners Area/Raknet Error

YellBellzDotCom(Posted 2011) [#1]
Hello,

I followed the information to get Jimons Raknet wrapper up and running and ran the Nettest that came with it and everything worked great.

I then began making my own networking object and it all seems to be coming together ok and it creates the server fine, but throws a Windows "EXCEPTION_ACCESS_VIOLATION" error. It happens at

Local Packet% = RN_Receive(ServerPeer)

in the Update method. I can't seem to find out why this is happening. It has to be something to do with the fact that I moved all the Functions to my own Network object, because this same function works fine in the Nettest that came with the Jimon Raknet Mod.

Any pointers would be greatly appreciated!
Thanks!


Czar Flavius(Posted 2011) [#2]
Try running in debug mode it will give you more information. Perhaps ServerPeer is Null?

Also packet is type TRKPacket not int. You should program in Strict mode and not store objects in integers. Your program will then contain a lot less bugs.


YellBellzDotCom(Posted 2011) [#3]
Thanks for the help,

I am running in debug mode, no information is givin on the error. I put a print before the statement and after the statement, the output screen prints the before, then I get the error so this is def where I am getting the error at.

ServerPeer is not null, I put a printline around that bit of code and it does print out a value for it.

It was due to the fact that I moved the functions to a seperate object called Network. I got a bit confused about methods and functions. Because ServerPeer was being initialized in a function of my Network type, it couldn't find it. The wierd thing was at one point, I printed the value of ServerPeer and it had a value. I changed the functions to methods of my Network type object and everything is hunky dory now.

Thanks for the help Czar!


Czar Flavius(Posted 2011) [#4]
Put the command DebugStop before the line and then the debug window will let you see the value of all variables.