commit | 12242ec2f9dccf9ca7ab196fdbcea6e53e9bd5eb | [log] [tgz] |
---|---|---|
author | Alex Fandrianto <alexfandrianto@google.com> | Thu Jan 28 17:06:49 2016 -0800 |
committer | Alex Fandrianto <alexfandrianto@google.com> | Thu Jan 28 17:06:49 2016 -0800 |
tree | f6d4736959b5ccb23281034ab6bc570c81eac96e | |
parent | c898bcb14c8a842e8e689fdfc709cf506136a60d [diff] |
TBR croupier: Add GLOBAL support and new Arrange Players (Sorry for combining 2 changes.) GLOBAL support was added to the Makefile. - If you say GLOBAL=1 when running, then you will mount on the global mount table and use the proxy. New Arrange Players - Now, we primarily arrange players on the Table Device - After being prompted (player vs table), we allow the Table to place each player who joined the game. - If there is no Table, the owner can still fallback to the old Arrange Players behavior. NOTE: Presubmit will not pass in the short term. https://github.com/vanadium/issues/issues/1093 So I've had to prepend TBR to the front of this CL. Change-Id: Ic0486554444819da991a52130143749fff3dc04d
Croupier is a Vanadium demo app of a general card playing game for multiple devices. Croupier utilizes Syncbase and P2P Discovery as the foundations for game formation and state synchronization.
This repository contains two implementations of Croupier, one in Go and the other in Mojo and Flutter. As Croupier's primary card game is Hearts, the two sides are meant to interoperate with that game. The Flutter version also supports Solitaire and is built so that more games can be added in the future.
Instructions for running the program with Flutter on Android follow. TODO(alexfandrianto): Add instructions for running the Go version.
Currently, development is heavily tied to an existing installation of Mojo. Please ensure that your Mojo checkout is located at $MOJO_DIR and has built out/android_Debug. Instructions are available here.
Development now also depends on the alpha branch of the Flutter repo. It is possible that the pubspec.yaml
file will need to be modified to accomodate your installation of Flutter. Instructions are available here.
Flutter depends on a relatively new version of the Dart SDK. Therefore, please ensure that you have installed the following version or greater:
Dart VM version: 1.13.0-dev.3.1 (Thu Sep 17 10:54:54 2015) on "linux_x64"
If you are unsure what version you are on, use dart --version
.
To install Dart, visit their download page. You may need to manually download a specific version of Dart. If so, visit their archives for exact downloads.
A Vanadium installation is not required since Croupier pulls all of its Vanadium-related dependencies from pub.
There are two ways to get credentials. These are used to determine who can access your Syncbase instance. You do not need to follow both instructions.
One way to obtain them is through OAuth. When Syncbase is started on Android, it will ask you to select an account. You must have an account added on the Android device for this to work.
During tests, it may be more convenient to create test credentials locally and push them onto the phone. Note: running the following command will pop-up the standard principal seekblessings
tab in order to obtain your approval to use OAuth.
make creds
If you clean the credentials, you will need to obtain fresh credentials.
If you have more than 1 device plugged into the computer, you will need to specify which device to use. adb devices
will tell you the order of your devices.
It is highly recommended that you mark/remember the order of the devices; it is the same as the order they were plugged into the computer/workstation.
For later devices, instead of ANDROID=1
use 2
, 3
, 4
, etc.
Note: Running Croupier on multiple Android devices simultaneously is still a work-in-progress. The workaround is to launch Croupier on a single device at a time.
Note: This example currently relies on a mount table on the local network at 192.168.86.254:8101
. This may be changed to the global mount table at a later time. https://github.com/vanadium/issues/issues/782
Start Croupier on your USB-debugging enabled Android device.
ANDROID=1 make start
Alternatively, use a different integer. Since the first device creates a syncbase instance that the others are mounted upon, it is recommended that this one is started before the other devices.
On your Android device, go to the Apps that you downloaded and Uninstall Mojo Shell from there. This cleanup step is important for when Mojo is in a bad state.
Note: Syncgroup data and some Syncbase data is not cleaned up between runs. This means that deleting Mojo Shell can often be helpful in cases where clearing Mojo Shell's data is insufficient.
Due to some issues with mojo_shell, you may occasionally fail to start the program due to a used port. Follow the error's instructions and try again.
Between builds of Mojo and Syncbase, you may wish to clean up the app and database info.
ANDROID=1 make clean
You can also clean credentials instead:
ANDROID=1 make clean-creds
Don't forget to do make creds
to rebuild them.
Lastly, you can also clear out the pub packages:
make veryclean