initial interface requests
[netris.git] / netris.h
index 5864cf775872fbebb4f6a398632b53501ea99317..874ec0b70063b2cd201c990a6e6f7be7469fd96a 100644 (file)
--- a/netris.h
+++ b/netris.h
@@ -1,6 +1,6 @@
 /*
  * Netris -- A free networked version of T*tris
- * Copyright (C) 1994,1995,1996  Mark H. Weaver <mhw@netris.org>
+ * Copyright (C) 1994-1996,1999  Mark H. Weaver <mhw@netris.org>
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: netris.h,v 1.27 1996/02/09 08:22:14 mhw Exp $
+ * $Id: netris.h,v 1.28 1999/05/16 06:56:29 mhw Exp $
  */
 
 #ifndef NETRIS_H
@@ -65,11 +65,13 @@ typedef long netint4;
 
 #define DEFAULT_PORT 9284      /* Very arbitrary */
 
-#define DEFAULT_KEYS "jkl mspf^l"
+//#define DEFAULT_KEYS "hlkj mspf^l"
+//#define DEFAULT_KEYS "4685 2spf^l"
+#define DEFAULT_KEYS "dcaf b^sp^f^l"
 
 /* Protocol versions */
 #define MAJOR_VERSION          1       
-#define PROTOCOL_VERSION       3
+#define PROTOCOL_VERSION       4
 #define ROBOT_VERSION          1
 
 #define MAX_BOARD_WIDTH                32
@@ -91,7 +93,9 @@ typedef long netint4;
 #define EM_any                         000777
 
 typedef enum _GameType { GT_onePlayer, GT_classicTwo, GT_len } GameType;
-typedef enum _BlockTypeA { BT_none, BT_piece1, BT_wall, BT_len } BlockTypeA;
+typedef enum _BlockTypeA { BT_none, BT_white, BT_blue, BT_magenta,
+                                                       BT_cyan, BT_yellow, BT_green, BT_red,
+                                                       BT_wall, BT_len } BlockTypeA;
 typedef enum _Dir { D_down, D_right, D_up, D_left } Dir;
 typedef enum _Cmd { C_end, C_forw, C_back, C_left, C_right, C_plot } Cmd;
 typedef enum _FDType { FT_read, FT_write, FT_except, FT_len } FDType;
@@ -99,7 +103,7 @@ typedef enum _MyEventType { E_none, E_alarm, E_key, E_net,
                                                        E_lostConn, E_robot, E_lostRobot } MyEventType;
 typedef enum _NetPacketType { NP_endConn, NP_giveJunk, NP_newPiece,
                                                        NP_down, NP_left, NP_right,
-                                                       NP_rotate, NP_drop, NP_clear,
+                                                       NP_rotright, NP_rotleft, NP_drop, NP_clear,
                                                        NP_insertJunk, NP_startConn,
                                                        NP_userName, NP_pause, NP_version,
                                                        NP_byeBye } NetPacketType;
@@ -135,7 +139,7 @@ typedef struct _EventGenRec {
 } EventGenRec;
 
 typedef struct _Shape {
-       struct _Shape *rotateTo;
+       struct _Shape *rotateTo, *rotateFrom;
        int initY, initX, mirrored;
        Dir initDir;
        BlockType type;
@@ -153,10 +157,10 @@ typedef int (*ShapeDrawFunc)(int scr, int y, int x,
 EXT GameType game;
 EXT int boardHeight[MAX_SCREENS];
 EXT int boardVisible[MAX_SCREENS], boardWidth[MAX_SCREENS];
-EXT Shape *curShape[MAX_SCREENS];
+EXT Shape *curShape[MAX_SCREENS], *nextShape[MAX_SCREENS];
 EXT int curY[MAX_SCREENS], curX[MAX_SCREENS];
 EXT char opponentName[16], opponentHost[256];
-EXT int standoutEnable;
+EXT int standoutEnable, colorEnable;
 EXT int robotEnable, robotVersion, fairRobot;
 EXT int protocolVersion;