You’re connecting to your external IP address which you likely aren’t getting access to because the port is blocked by your router. Try first connecting to “127.0.0.1” (this is your computer)… Presuming that succeeds, you will want to look up the instructions on port forwarding for your particular router.
My guess is that you aren’t going to be able to unblock ports using one of those mobile USB sticks. If you’re connecting a client to server on the same computer, 127.0.0.1 is fine… If you were behind a router then you’d have DHCP assigned addresses for each device but your possibilities are really limited when you’re connected directly to the ISP.
Yeah, I might try that. I added a custom cube to the camera making it follow with target on the cube. So you control the cube and if I run from a second process as you say, the cube will be visible? I set up an ad-hoc network on my computer and have the game running on both computers in the network. My guess is that it connected successfully but we couldn’t see eachothers cubes that you control.
Also, a bit off-topic. Can I log everything in the console to a text-file for debugging purposes? That case I can see that the connection was established between the computers.
Yeah, I might try that. I added a custom cube to the camera making it follow with target on the cube. So you control the cube and if I run from a second process as you say, the cube will be visible? I set up an ad-hoc network on my computer and have the game running on both computers in the network. My guess is that it connected successfully but we couldn't see eachothers cubes that you control.
Yep, I followed the tutorial as far as setting up a server and client goes. I presumed that was all I needed at the moment.
Edit: Also regarding the different processes. When I make the server and client versions I comment away the functions to start the server and compile, which would give me the client. When I want to compile the server version, I comment away the functions to start a client.
I think I have multiplayer working now, I just need to make the players visible. Everything connects as it should, so is there some kind of code to make each player visible?
What "visible" is would sort of be up to your game. SpiderMonkey, like JGN, is just the networking layer and it's still up to you to send the right messages and do something with those messages. JME doesn't yet provide any out of the box object sync system at least partially because it's not clear how to make something general that is usually very game specific. In fact, some games won't even use a sync system, for example.
How to proceed may depend on what kind of game you are making.
xieu90, thanks for the piece of code you put up. It took me around 10 minutes to set the classes right, but when I was done I started the server on my computer and the client on my computer aswell. I used my IPv4 IP, just to press the limits, and it worked out. It worked out good.
I thank you again and everyone who responded. Another quicky for xieu90, is it OK for me to use your project as template? I will of course modify it for my specific game needs later.