~ubuntu-branches/ubuntu/trusty/ggz-client-libs/trusty

« back to all changes in this revision

Viewing changes to ggzmod/ggzmod-ggz.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut, Josef Spillner, Peter Eisentraut
  • Date: 2006-09-09 13:37:14 UTC
  • mfrom: (2.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20060909133714-q49a9kvjfkc0wcc3
Tags: 0.0.13-3
[ Josef Spillner ]
* Change ggzcore-bin dependency from ggzmod to recommends from ggzcore
  (closes: #384671).

[ Peter Eisentraut ]
* Make package dependencies binNMU-safe through use of ${binary:Version}
  (closes: #386126)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * File: ggzmod-ggz.h
3
 
 * Author: GGZ Dev Team
4
 
 * Project: ggzmod
5
 
 * Date: 10/20/02
6
 
 * Desc: GGZ game module functions, GGZ side
7
 
 * $Id: ggzmod-ggz.h,v 1.1 2002/10/21 04:26:59 jdorje Exp $
8
 
 *
9
 
 * This file contains the GGZ-only interface for the ggzmod library.  This
10
 
 * library facilitates the communication between the GGZ server (ggz)
11
 
 * and game servers.  This file provides a unified interface that can be
12
 
 * used at both ends.
13
 
 *
14
 
 * Copyright (C) 2002 GGZ Development Team.
15
 
 *
16
 
 * This program is free software; you can redistribute it and/or modify
17
 
 * it under the terms of the GNU General Public License as published by
18
 
 * the Free Software Foundation; either version 2 of the License, or
19
 
 * (at your option) any later version.
20
 
 *
21
 
 * This program is distributed in the hope that it will be useful,
22
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 
 * GNU General Public License for more details.
25
 
 *
26
 
 * You should have received a copy of the GNU General Public License
27
 
 * along with this program; if not, write to the Free Software
28
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
29
 
 */
30
 
 
31
 
 
32
 
#ifndef __GGZMOD_GGZ_H__
33
 
#define __GGZMOD_GGZ_H__
34
 
 
35
 
typedef enum {
36
 
  /* Sit down (stop spectatin; join a seat) */
37
 
  GGZMOD_TRANSACTION_SIT,
38
 
 
39
 
  /* Stand up (leave your seat; become a spectator) */
40
 
  GGZMOD_TRANSACTION_STAND,
41
 
 
42
 
  /* Boot a player */
43
 
  GGZMOD_TRANSACTION_BOOT,
44
 
 
45
 
  /* Replace a bot/reserved seat with an open one */
46
 
  GGZMOD_TRANSACTION_OPEN,
47
 
 
48
 
  /* Put a bot into an open seat */
49
 
  GGZMOD_TRANSACTION_BOT
50
 
} GGZModTransaction;
51
 
 
52
 
typedef void (*GGZModTransactionHandler) (GGZMod * mod, GGZModTransaction t,
53
 
                                          void *data);
54
 
 
55
 
void ggzmod_set_transaction_handler(GGZMod * ggzmod, GGZModTransaction t,
56
 
                                    GGZModTransactionHandler func);
57
 
 
58
 
/** @brief Set the module executable, pwd, and arguments
59
 
 *
60
 
 *  GGZmod must execute and launch the game to start a table; this
61
 
 *  function allows ggz to specify how this should be done.
62
 
 *  @note This should not be called by the table, only ggz.
63
 
 *  @param ggzmod The GGZmod object.
64
 
 *  @param pwd The working directory for the game, or NULL.
65
 
 *  @param args The arguments for the program, as needed by exec.
66
 
 *  @note The pwd directory must already exist.
67
 
 */
68
 
void ggzmod_set_module(GGZMod * ggzmod, const char *pwd, char **args);
69
 
                       
70
 
 
71
 
/** @brief Set the fd of the game server connection
72
 
 *  @param ggzmod The GGZMod object.
73
 
 *  @return The server connection fd
74
 
 */
75
 
void ggzmod_set_server_fd(GGZMod * ggzmod, int fd);
76
 
 
77
 
/** @brief Set data about which seat at which this ggzmod is sitting.
78
 
 *
79
 
 *  The GGZ client can use this function to set data about this client.
80
 
 *  @param ggzmod The GGZMod object.
81
 
 *  @param is_spectator TRUE iff the player is a spectator.
82
 
 *  @param seat_num The seat or spectator seat number.
83
 
 *  @return 0 on success, negative on error.
84
 
 */
85
 
int ggzmod_set_player(GGZMod *ggzmod,
86
 
                      const char *my_name,
87
 
                      int is_spectator, int seat_num);
88
 
 
89
 
/** @brief Set seat data.
90
 
 *
91
 
 *  The GGZ client can use this function to set data about
92
 
 *  a seat.
93
 
 *  @param seat The new seat structure (which includes seat number).
94
 
 *  @return 0 on success, negative on failure.
95
 
 */
96
 
int ggzmod_set_seat(GGZMod *ggzmod, GGZSeat * seat);
97
 
 
98
 
/** @brief Set spectator data.
99
 
 *
100
 
 *  The GGZ client can use this function to set data about a spectator seat.
101
 
 *  @param seat The new spectator seat data.
102
 
 *  @return 0 on success, negative on failure.
103
 
 */
104
 
int ggzmod_set_spectator_seat(GGZMod * ggzmod, GGZSpectatorSeat * seat);
105
 
 
106
 
#endif /* __GGZMOD_GGZ_H__ */