git.shiar.nl
/
netris.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
code cosmetics
[netris.git]
/
netris.h
diff --git
a/netris.h
b/netris.h
index df459eb141478e2c58509ca49c04908bc1468c87..31c08f1f1c4f905dc741abd193b7f73f74faa59b 100644
(file)
--- a/
netris.h
+++ b/
netris.h
@@
-57,15
+57,15
@@
typedef long netint4;
/* Protocol versions */
#define MAJOR_VERSION 1
/* Protocol versions */
#define MAJOR_VERSION 1
-#define PROTOCOL_VERSION
4
+#define PROTOCOL_VERSION
6
#define DEFAULT_PORT 9284 /* Very arbitrary */
#define CONFIG_FILE "netris.conf"
#define DEFAULT_PORT 9284 /* Very arbitrary */
#define CONFIG_FILE "netris.conf"
-//#define DEFAULT_KEYS "hlkj mfp^ltq"
-//#define DEFAULT_KEYS "4685 2fp^l^mq"
-#define DEFAULT_KEYS "dcaf b^fp^l^mq"
+//#define DEFAULT_KEYS "hlkj m
n
fp^ltq"
+//#define DEFAULT_KEYS "4685
0
2fp^l^mq"
+#define DEFAULT_KEYS "dcaf
x
b^fp^l^mq"
#define MAX_BOARD_WIDTH 32
#define MAX_BOARD_HEIGHT 64
#define MAX_BOARD_WIDTH 32
#define MAX_BOARD_HEIGHT 64
@@
-78,7
+78,6
@@
typedef long netint4;
#define EM_connect 000020
#define EM_any 000777
#define EM_connect 000020
#define EM_any 000777
-typedef enum _GameType { GT_onePlayer, GT_classicTwo, GT_len } GameType;
typedef enum _BlockTypeA {
BT_shadow, BT_none,
BT_S, BT_L, BT_I, BT_O, BT_Z, BT_J, BT_T,
typedef enum _BlockTypeA {
BT_shadow, BT_none,
BT_S, BT_L, BT_I, BT_O, BT_Z, BT_J, BT_T,
@@
-129,10
+128,6
@@
typedef struct _MyEvent {
union {
char key;
_netEvent net;
union {
char key;
_netEvent net;
- struct {
- int size;
- char *data;
- } robot;
} u;
} MyEvent;
} u;
} MyEvent;
@@
-151,8
+146,6
@@
typedef struct _EventGenRec {
int bufSize, bufGoal;
} EventGenRec;
int bufSize, bufGoal;
} EventGenRec;
-MyEventType NetGenFunc(EventGenRec *gen, MyEvent *event);
-
/* NP_startConn flags */
#define SCF_paused 1
/* NP_startConn flags */
#define SCF_paused 1
@@
-161,18
+154,17
@@
typedef struct {
char name[16];
int flags;
int team;
char name[16];
int flags;
int team;
- int dropmode;
int boardHeight, boardWidth, boardVisible;
int curX, curY;
char curShape, nextShape;
int boardHeight, boardWidth, boardVisible;
int curX, curY;
char curShape, nextShape;
- struct
_Score
{
+ struct
score_t
{
short level;
long score;
int pieces, lines, adds;
} score;
char host[256]; //last
short level;
long score;
int pieces, lines, adds;
} score;
char host[256]; //last
-}
_Player
;
-EXT
_Player
Players[MAX_SCREENS];
+}
player_t
;
+EXT
player_t
Players[MAX_SCREENS];
EXT short me;
EXT short maxPlayer;
EXT int spied; //in player.flags
EXT short me;
EXT short maxPlayer;
EXT int spied; //in player.flags
@@
-181,21
+173,27
@@
EXT int spied; //in player.flags
#define SPEEDINC 1.2
#define SPEEDMINIMUM 40000
#define SPEEDINC 1.2
#define SPEEDMINIMUM 40000
+typedef enum _GameType { GT_onePlayer, GT_classicTwo, GT_len } GameType;
typedef struct {
typedef struct {
+ GameType type;
int gravity; //1
int started; //2
int continuous; //3
long seed; //4
int gravity; //1
int started; //2
int continuous; //3
long seed; //4
+ float shapes[7];
int initspeed; //5
int speed;
int initspeed; //5
int speed;
-}
_Game
;
-EXT
_Game
Game;
+}
game_t
;
+EXT
game_t
Game;
#define MSG_WIDTH 128
#define MSG_WIDTH 128
-EXT
GameType game; // => Game.type
+EXT
short port; // => just in client.c, parameter to inet connect
-EXT short port; // => just in game.c, parameter to inet connect
+static const char *teamname[] = {
+ "", "Green", "Cyan", "Blue", "Purple",
+ "Red", "Grey", "White", "*Orange"
+};
#endif //__NETRIS_H
#endif //__NETRIS_H