AppWarp Multiplayer Game. A lot of messages

0 votes

Hi.

I successfully created a multiplayer demo game based on the example:
 
In my test app, I just connect two users to a room and one of them only sends one short message. Then both users leave the room. I only did it once.
Then in the AppHQ console, I see 105 messages for my test app. How is this possible?
 
I use App42MultiPlayerGamingSDK.jar (version 2.3).
Code:
public void quickGame() {
    ...
    WarpClient.initialize(apiKey, secretKey);
    warpClient = WarpClient.getInstance();

    connectionListener = new ConnectionListener(this);
    roomListener = new RoomListener(this);
    zoneListener = new ZoneListener(this);
    notificationListener = new NotificationListener(this);

    warpClient.addConnectionRequestListener(connectionListener);
    warpClient.addRoomRequestListener(roomListener);
    warpClient.addZoneRequestListener(zoneListener);
    warpClient.addNotificationListener(notificationListener);

    warpClient.connectWithUserName(myId);
}

private void onConnectDone(boolean status) {
    ...
    warpClient.joinRoomWithProperties(properties);
}

private void onJoinRoomDone(RoomEvent event) {
    if (event.getResult() == WarpResponseResultCode.SUCCESS) {
        ...
        warpClient.subscribeRoom(roomId);
    } else if (event.getResult() == WarpResponseResultCode.RESOURCE_NOT_FOUND) {
        ...
        warpClient.createRoom("game", "owner", 2, properties);
    }
}

private void onRoomCreated(String roomId){
    ...
    warpClient.joinRoom(roomId);
}

private void onRoomSubscribed(String roomId) {
    ...
    warpClient.getLiveRoomInfo(roomId);
}

public void sendMessage(byte[] msgBuf) {
    warpClient.sendPrivateUpdate(opponentId, msgBuf);
}

public void leaveGame() {
    ...
    warpClient.unsubscribeRoom(roomId);
    warpClient.leaveRoom(roomId);
    warpClient.deleteRoom(roomId);
    warpClient.removeConnectionRequestListener(connectionListener);
    warpClient.removeRoomRequestListener(roomListener);
    warpClient.removeZoneRequestListener(zoneListener);
    warpClient.removeNotificationListener(notificationListener);
    warpClient.disconnect();
}

What am I doing wrong? How do I reduce the number of messages? Does App Configuration (Auto Recover Time, Default Zone) affect the number of messages?

This may be a problem when choosing AppWarp to implement multiplayer in the release version of the game. Since it is not profitable. It is still more profitable to pay for CCU than for the number of messages that are not clearly counted.
 
Thanks.
 
asked Mar 31, 2020 in Java by Byril Games (25 points)
edited Apr 1, 2020 by Byril Games

2 Answers

0 votes
 
Best answer
Hi Byril,

We have replied to you on support for the same.

In the case if you have any concern please let us know, we will be happy to help you.

 

Regards,

Priyanka Singh

App42 Team
answered Apr 3, 2020 by anonymous
selected Apr 3, 2020 by Byril Games
0 votes

I repeated the same experiment the next day. This time, the AppHQ console showed 37 messages. This already seems to be true if you consider the callbacks of all the added listeners. Is it possible that more messages are sent during the first user initialization than usual?

answered Apr 13, 2020 by Byril Games (25 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...