README.md
1# Distributed Gobang
2
3### Introduction
4
5This sample shows Gobang, a popular game played with black and white stones on a go board, developed using the distributed data management function. The display effect is as follows:
6
7
8
9### Concepts
10
11Distributed data management: implements distributed collaboration between databases of different devices. The apps save data to distributed databases and perform operations such as adding, deleting, modifying, querying, and synchronizing data between distributed databases by calling the distributed data APIs.
12
13### Required Permissions
14
15ohos.permission.DISTRIBUTED_DATASYNC
16
17### Usage
18
191. Start the app. After the permissions of the devices are checked, the devices on the same network are displayed. Touch the icon in the upper right corner and select the peer device to connect. If it is the first time to connect to the peer device, authentication is required. After the authentication is successful, the peer device is connected.
20
212. During the game, the user of the local device can restart the game or retract a false move. The user of the peer device cannot. Touching an empty intersection on the go board once presets the target place to move. You can touch it again to move your stone there or touch another empty intersection if you change your mind. If the peer device exits or goes offline unexpectedly, the local user can reconnect to the peer device. After the remote device is connected, the local user can touch any position on the go board. Data will be synchronized to the peer device for the game to continue.
22
23### Constraints
24
25- This sample can only be run on standard-system devices.
26
27- This sample is based on the stage model, which is supported from API version 9.
28
29- This sample requires DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022) to compile and run.
30