Menu
Lumberyard
User Guide (Version 1.15)

Testing the Web Communicator Cloud Gem

To perform a simple test of the Web Communicator cloud gem, you can use the CommunicatorSample level that is included with Lumberyard.

Prerequisites

This tutorial assumes the following:

Test Workflow Summary

The test workflow uses the PlayerAccountSample level, the CommunicatorSample level, and the AWS IoT management console in the following ways:

  1. PlayerAccountSample – To create an player account (authenticated identity) for testing. Web Communicator uses authenticated identities by default.

  2. CommunicatorSample – To register a WebSocket, connect the WebSocket, and request a channel list.

  3. AWS IoT management console – To publish a test message that appears in the CommunicatorSample level.

Test Workflow Steps

The following sections describe each of the workflow steps in detail.

A. Using PlayerAccountSample to Create a Player Account

In this step, you use the PlayerAccountSample level to create a player account and sign in with it.

To create a player account for the test

  1. Follow Testing the Player Account Cloud Gem (steps 1-11) to create a player account. To verify the account, submit the verification code that is emailed to you.

  2. With the PlayerAccountSample level still running, sign in to the PlayerAccountSample level with the credentials that you created (Testing the Player Account Cloud Gem step 12).

  3. Press ESC to exit the level.

B. Using CommunicatorSample to Register and Connect a Websocket

In this step, register and connect a Websocket that can receive messages from AWS IoT.

To register and connect a Websocket

  1. In Lumberyard Editor, choose File, Open.

  2. In the Open a Level dialog box, choose CommunicatorSample, and then click Open. If you are using a launcher and need to restart, your authenticated identity should be found on startup.

  3. Press Ctrl+G to start the level. The sample level looks similar to the following image.

    
                The CommunicatorSample level
  4. Click Register WebSocket.

    
                Registering a WebSocket

    The status changes to Registered.

    
                Registered WebSocket
  5. Click Connect WebSocket.

    
                Connecting a WebSocket

    The status changes to Connected.

    
                Connected WebSocket
  6. Click Request List.

    
                Request channel list

    Your test channels are listed in the sample level user interface.

    
                The list of communication channels
  7. Leave the CommunicatorSample level running.

Now that you have registered and connected a WebSocket, you are ready to test it.

C. Using the AWS IoT Management Console to Publish a Test Message

In this step, you send a test from the message AWS IoT console to the CommunicatorSample level.

To send a test message to the CommunicatorSample level

  1. Do one of the following:

    • Press Alt+Tab to change to your browser.

    • Open a browser on another computer that has internet access.

  2. In your browser, sign in to the AWS Management Console with the AWS credentials that you used to create your project stack and deployment.

  3. Choose Services, Internet of Things, IoT Core to open the AWS IoT console.

  4. In the left navigation pane of AWS IoT console, choose Test.

    
                Choose Test in the AWS IoT console.
  5. Navigate to the Publish section at the bottom of the page.

    
                Publishing a test message in the AWS IoT console.
  6. In the Publish section, enter the following information:

    1. For Specify a topic, specify your channel as project_name/deployment_name/CloudGemWebCommunicator (for example, cgs624803/dep/CloudGemWebCommunicator).

    2. For Message, add a message that uses the following syntax:

    { "Channel":"CloudGemWebCommunicator", "Message":"This is a test" }
  7. Choose Publish to topic.

  8. Return to the CommunicatorSample level to see the results. If you are on the same computer, press Alt+Tab to return to Lumberyard Editor.

    The sample level shows the message that you sent from AWS IoT.

    
                Test message received in the CommunicatorSample level that is sent from the
                  AWS IoT console.