'messageRecieved' Override method not recieving?

The issue I’m facing is that when I send any form of data to my sever, whilst the packet sends to localhost, the server is not receiving it. The server is fully connected to the client, so it’s not due to my router (I assume). This is my current code.
- Server

  • Client
  • TypeMessage’ Class
    To summerise the script, it sends the game name and version, and then checks if it matches the server. If you add an instance of the TypeMessage class in the update loop, it will also send the message. Currently though sending the clients ‘version’ & ‘gamename’ is not working, so I can’t test the sending of regular message.

Is there something I’m missing from the wiki that will allow me to receive messages?
I know this post is quite short, but this script throws no errors, so it’s hard to locate the root cause. The issue also occurs when broadcasting from the server to the client, so I may have to somehow add the ‘messageRecived’ method to the update loop to make it run? What do you think?

First, you do know that SpiderMonkey will already do game name and version syncing for you, right?

Second, I don’t see anywhere in your server where you’ve register a message listener… so when the message is received, nothing is listening to it.

Finally, have you looked at the TestChatClient and TestChatServer in the JME tests? Those are fully functional client and server and will probably short-circuit a lot of your next questions.

1 Like