Commit 18d07212 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

The program does not use DBus anymore

Well, it still uses dbus for the Gtk application, but we do not
implement any tarot specific API on DBus.
parent b030f64d
......@@ -19,8 +19,6 @@ apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
dbus \
dbus-x11 \
libglib2.0-dev \
libxml2 \
libxml2-dev \
......@@ -19,8 +19,6 @@ apt-get update || exit 1
apt-get install -y \
build-essential \
dbus \
dbus-x11 \
libcairo2-dev \
libglib2.0-dev \
libgtk-3-0 \
......@@ -34,8 +32,6 @@ apt-get install -y \
dh-make \
|| exit 1
export $(dbus-launch)
mkdir -p public || exit 1
echo "Build tarot"
......@@ -30,8 +30,6 @@ apt-get install -y \
build-essential \
check \
curl \
dbus \
dbus-x11 \
devscripts \
emacs \
emacs-goodies-el \
......@@ -68,8 +66,6 @@ apt-get install -y \
wget \
export $(dbus-launch)
rm -rf $SOURCE_TOP/dist || exit 1
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
......@@ -20,8 +20,6 @@ apt-get upgrade -y
apt-get install -y \
build-essential \
curl \
dbus \
dbus-x11 \
git \
libcairo2-dev \
libgirepository1.0-dev \
......@@ -636,55 +636,6 @@ assumes that you are running tarot with the =C= locale:
#+BEGIN_SRC shell :eval no
LANG=C tarot --help
** The shell
The shell will guide you. You will first have to bid, then do a slam
declaration, then a call (only if you chose =--call-allowed=), then a
discard (only if you were the taker), then a handful, then play!
When you are prompted for a card, just enter the card name as they
appear to you, except you have to replace the suit symbols with their
initials. So, =KH= is the King of Hearts, and so on.
When you are prompted for a list of cards, enter a list of cards,
separated by spaces.
** D-Bus
When run with =--dbus-server=, the program will start a D-Bus service
with its own name, =eu.planete_kraus.Tarot=, or anonymously (pass
=--anonymous-dbus=) or with a custom name (pass
=--dbus-server-name=DBUS_NAME=). There is a service file to make it
activable. It provides mainly one object,
=/eu/planete_kraus/Tarot/Server/v1=, from the
=eu.planete_kraus.Tarot.Server= interface.
All objects are introspectable.
The server object has one method, =CreateRandom=. It takes the number
of players, as an =Uint32=, whether there is a call, as a =Boolean=,
and the random seed, as a =String=. It returns the game index, and
creates a seat for each new player.
The seats implement the interface =eu.planete_kraus.Tarot.Seat= and
are registered under the path
=/eu/planete_kraus/Tarot/Server/Games/N/seat/P=, where =N= is the game
ID and =P= is the player index (starting from 0). It provides a few
signals to follow the game, along with a =Next= signal to prompt for a
move and =End= signal to give the final score (an array of =Int32=).
You should wait for the =Next= signal before playing, in case someone
else has been using the seat and you are reviewing the past events.
The events are called =EventBid=, =EventCall=, =EventDeal= and so on,
with every scalar (including the bids, but not the booleans) mapped to
=Uint32=, and the list of cards mapped as an array of =Uint32=.
The events are not sent immediately. You first need to call
=Subscribe= with no parameters and then the events will be sent. You
can also call =Me= with no parameters to get back your seat number.
All other game accessors are hidden; you may want to use libtarot for
Finally, when you want to make a move, call the =Bid=, =Call= etc
methods with what you want to play. These method immediately perform
the action and signal an error if it is not valid. You can use
libtarot, again, to check the move.
* Programming with libtarot
Libtarot is the library that you can use in your own program. In
order to use it, you may use the =pkg-config= configuration file that
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment