CTR Pia  4.11.3
Game Communication Engine
sync/SyncProtocol Sample Demo

Introduction

This sample demonstrates the use of SyncProtocol in PiaSync.

Scope of the Demo

This sample demonstrates the following.

Performs synchronous communication between stations in the session using the inputs that you select: key or button state (Key), touch-panel state (Touch), or analog pad/stick state (Stick).

The program has trouble maintaining synchronous communication when the connection is poor. The following steps can improve the connection conditions.

  • Build a wired network using Wii LAN adapters.
  • If you are using wireless connections, move the APs used by the development machine so that they are not too concentrated in one place.

Process Overview and Controls

Mode Selection Screen

Select the communication mode from this screen. Select to perform matchmaking, and then go to the Main screen.

Input

Operation

A Button Run local communication (UDS library) as a host. After you successfully create a session, you transition to the Synchronized Data Selection screen.
B Button

Run local communication (UDS) as a client. Search for UDS networks, join the one that is found, and then transition to the Synchronized Data Selection screen. If you press START during a search of the UDS network, you cancel the search and return to the Mode Selection screen.

X Button Run in the mode that uses Internet communication. Perform random matchmaking. If there is a session that can be joined, join it as a client. If there are no sessions, create one as the host. You next transition to the Synchronized Data Selection screen.
START Exits the program.

Synchronized Data Selection Screen

On this screen, you select the data that the local station sends during synchronized communication.

This screen appears if the SyncProtocol::State is NOT_SYNCHRONIZED.

Input Operation
Up/down on the +Control Pad Moves the cursor.
Left/right on the +Control Pad Selects whether to send the item that the cursor is currently over.
A Button Call SyncProtocol::Start with the specified settings as arguments, and start synchronized communication. When communication starts, the program transitions to the Main screen.
START Withdraws from the session and returns to the Mode Selection screen.

When a session cannot continue because of an error or another reason, you are automatically returned to the Mode Selection screen.

Main Screen

Performs synchronized communication using SyncProtocol.

The data sent by using synchronized communication appears on the screen.

A value appears for items selected for synchronized communication. Items that were not selected are blank.

Input Operation
R + X Buttons Calls SyncProtocol::End, and ends synchronized communication. After communication ends, the program returns to the Synchronized Data Selection screen.
R + Y Buttons Calls SyncProtocol::EndAlone, and unilaterally ends synchronized communication for the local station only.
R Button + left/right on the +Control Pad Changes the requested delay.
R + A Buttons Calls the SyncProtocol::RequestToChangeDelay function, and requests a change in the delay.
R Button + up/down on the +Control Pad Changes the send interval.
R + B Buttons Calls the SyncProtocol::SetSendPeriod function, and sets the send interval.
START Withdraws from the session and returns to the Mode Selection screen.

When a session cannot continue because of an error or another reason, you are automatically returned to the Mode Selection screen.