Hi all,
I’m walking through the frog tutorial for Unity and have client -> server messaging working, but server -> client messaging gives the following error in the server logs on the EC2 instance:
18 Nov 2020 09:09:55,193 [ERROR] (index.js) 371: Message was missing a target player and target group. Message: {“opCode”:777,“sender”:-1,“payload”:{“type”:“Buffer”,“data”:
I’m using the below function to send a “response” message from the server when the client sends a message:
function onMessage(gameMessage) {
const outMessage = session.newTextGameMessage(777,
session.getServerId(),
“A test message from the server”);
session.sendGroupMessage(outMessage, 0);
}
My understanding is I’m sending to group “0”. My client code should be registered to group “0” using the below code:
// Initiate a connection with the Realtime server with the given connection information
Client.Connect(endpoint, remoteTcpPort, listeningUdpPort, connectionToken);
Client.RequestGroupMembership(0);
Client.JoinGroup(0);
… so I’m at a complete loss as to why the error claims “missing target group”. I’m sure I’m missing something obvious - any help is much appreciated!
Thanks,
Chris