T2NET V4.15 PUBLIC

This game is FreeWare and has been designed by XunK Entertainment Team.
Official T2net Site: http://www.chez.com/xunk.
Check new versions at http://www.chez.com/xunk/english/files.htm.
Any contact/suggestion: T2net@jazzgame.com, glop@mail.dotcom.fr.

Acknowledgements:
-----------------
 glop for testing, ideas about algorithms, T2net Web Site and first
 available algorithms.
 DivideError for T2net logo.
 AVANT, Bernie, Galdwyn, Knuckman, Harddrive, ThomC, Billou, Bart, Gaffy
 for testing Beta versions, reporting bugs and suggestions.
 FRCN, drslum, ferd for uggestions and IRC T2net promotion.
 Teknoman-Blade for his official site (http://www.geocities.com/Tokyo/Pagoda/6087/).
 All the people I've talked to about T2net.

Contents:
---------

1.Overview

2.Get Started

3.Menus/Configuration
  3.1 View
  3.2 Game
  3.3 Options
    3.3.1 Connection
    3.3.2 Quick Connect
    3.3.3 Players/Algo
    3.3.4 Preferences
  3.4 Windows
  3.5 Help

4.Windows
  4.1 Chat
  4.2 Teams
  4.3 Actions
  4.4 Fields

5.Rules
  5.1 Standard Rules
  5.2 Multiplayer Rules
  5.3 Special Block Rules
  5.4 Score Rules

6.Theme Files
  6.1 Overview
  6.2 Bitmap Section
  6.3 Grid section
  6.4 Text Section
  6.5 Sound Section

7.Algorithms
  7.1 Overview
  7.2 Interfaces
  7.3 Code Samples
  7.4 More information

8.End-user agreement

1.Overview

 This is a multiplayer version of a well-'known game. Some new features have been added.
 The best one is the algorithm support. This allows anyone to do his own custom Algorithm 
 and let it play against other ones.
 Some other features:
   - two local players on the same PC,
   - pentomino support (5 block pieces).

2.Get Started

 Execute T2netSetup.exe. Enter the directory of your choice for unzipping.
 Launch T2net.exe.
 The first time you launch the application (no ini file), the configuration is set to 
 one player, Classic Mode 2.
 For the first connection to a server, you have to go to Otpions/Connection, 
 select Client, type the server IP @, enter your name to replace Left Player and
 click on the connect button.

3.Menus/Configuration

3.1 View

 This menu allows you to reopen windows you have closed. The target windows could 
 be the Chat, the Games, the Teams or the Actions.
 You have button accelerators in the ToolsBar for Teams and Chat.
 The server has access to one special item: Clients List. This allows the server to 
 see all the connected clients, their IP, the name of the players. For each connection,
 there is a kick button to close a client (if it no longer responds for instance). The
 server have also access to a Transfer button. This can be used when the server has to 
 leave whereas the other players would like to play. The server choose a client to become
 the server and then click the Transfer button.

3.2 Game

 This is for starting a new game, pausing or stopping the current one. You can resume a 
 paused game by selecting pause another time. You have button accelerators for these 
 commands in the ToolsBar.
 You can reset all the scores to 0 by selecting Reset Scores.

3.3 Options

 This is the main configuration menu. It allows you to configure the connection for
 multiplayer games, to select the players or algorithms for the game and to set
 some preferences such as Keys or kind of game.

3.3.1 Connection

 This opens a dialog box. With this dialog box you can select:

  - the name of the two local players,
  - the kind of connection: Client/Server, 
  - if you are a client, you must enter the server IP address,
  - the number of players allowed.
  - the server has a field to type a welcome message. This message is displayed for
    the clients
  - if the server is not playing and noone can start the game on the server, you have
    an option to give the control to a client.

 If you are Server, press Connect to start it.
 If you are Client, press Connect to connect to the server.

3.3.2 Quick Connect

 This is the same as the Connect Button in the previous Menu.
 This allows you to start a pre-configured connection.
 If everything is all right in Options/Connection you can use Quick Connect.
 This menu has a button in the ToolsBar.

3.3.3 Players/Algo

 This allows you to choose the players for your local PC.
 You have a listbox which displays all the players available. The players available are
 the two human players and all the algorithms detected in the Algo Path (see 3.3.4).
 When selecting an algorithm you have a description of it.
 To select/unselect a player press a 'Player X =>' button.
 If you have selected an algorithm and this algorithm provides a function to
 configure it (see 6), press the Param button on the right.

3.3.4 Preferences

 A dialog box is displayed.
 You can choose the kind of the game only if you are server:

   - Classic 1: no special blocks, size of playing field = 10x20
   - Classic 2: special blocks, size of playing field = 12x22
   - Full T2net: Classic 1 + Extended blocks
   - Custom: as you want ! 

 Extended blocks is for future use.
 Delay before new piece adds a delay between each new piece.
 Rate for special controls how new specials are added (by doing 1 or more lines).

 For the sounds, you can enable/disable wav with dialog, wav during games and midi
 during game. Single start sound is usefull when doing multiple automatics games to
 have or not the gamestart sound when a new game is restarting.

 You have two buttons for selecting human players Keys.

 Description of usual keys:

 Left: moves current piece one step left
 Right: moves current piece one step right
 Bottom: causes the piece to be dropped
 Rotate Right: turn current piece one step right
 Rotate Left: turn current piece one step right
 Speed Up Fall: moves current piece one step down
 Chat: when playin this causes the focus to be
 Oneself Block Play: play current special block on yourself
 Suppress Block: remove current special block from inventory

 Absolute player keys provide a direct access to a player whose number is 
 displayed in the Teams window.
 Relative player keys are useful if you don't want to keep in mind the 
 player number for your opponents or friends because this could change from game to game.
 If the teams change from one game to another one, relative keys assume that you
 are always targetting an opponent or a friend.

 There is also two buttons for display options. One for Windows and another one for 
 Tile options.

 Windows Options:
 You can choose to have the Teams window closed automatically during the game.
 You can choose to redirect action traces in Chat window.
 Fonts can be choosen for Action and chat window.
 You can display 2 infos during the game:
 - next piece,
 - nb lines (lines done and lines added to opponents).
 You can choose to have no header and display these infos directly on the playing field 
 (to save space when there is many players).
 For displaying the pieces you have the choice to have bitmaps or coloured pieces (internal 
 t2net drawing).
 For displaying the pieces you have also the choice to have bitmap or standard font use
 (internal t2net drawing).
 You can change the theme. The theme contains all the bitmaps, colours, sound and midi
 used by T2net. See paragraph 6 for more explanations.
 There is a grid option which draw vertical lines on the field. This for helping those
 who have problem with droping pieces.
 'No sys menu' option removes some button in the heading of field windows to have more room.
 Auto private causes to have automatically :x put in the chat when someone privates you (see 4.1).

 Tile Options:
 You have same options for Chat and Actions windows: where to put them (bottom or left) 
 and % size of the main Windows.
 There is two modes for tile: Fixed or not. When choosing Fixed Tile, the windows have
 pre-calculate position and chat and action window are not managed. The size of all local
 windows changes together. Same for remote windows.
 When choosing non-Fixed mode, T2net is managing tile to have all active window using
 maximum room available. This causes some move and resizing when a new client comes or
 leaves.
 You have an option to enable or disable aytomatic Tile. Automatic tile is performed
 when a player is coming or leaving the game.
 You can choose the x/y ratio for the field (100 % = square).
 There is an option to automatically reduce the local size when there is many players.
 Another option allows to automatically remove the heading of the field when there is
 the selected number of player (to have more room to display the field).
 'Allow user font setting' allows T2net to apply remote user to change font setting. 
  This is usefull when someome go too far with font settings.

 Miscellaneous:
  - start level: the starting level could be 1 (1 s between piece move) up to 20 (50 ms
    between piece move).
  - number of games: useful to make tournaments.
  - algorithms allowed: the server can choose to allow or not algorithms to join the
    game.

 Advanced options:

   - the path to retrieve the algorithm DLLs.
   - random start: this allows you to re-play a game with the same random sequence. 
     Useful for troubleshooting a standalone algorithm. A value of zero makes really 
     a random game. A different value will give you always the same sequence with
     this value.
   - algo delay: the time in ms between two calls to an algorithm (200 ms is recommended 
     if you want the algorithm to move pieces at the same speed than an average human player).
   - tempo change level: tempo in seconds before level increases.

3.4 Windows

 Standard Microsoft Multiple Document Interface menu.

3.5 Help

 Link to this Readme.txt file.
 Link to WhatsNew.txt File.
 Standard About.

4.Windows 

4.1 Chat

 This window is useful in connected mode. This allows you to talk with other players.
 You have a text line input at the bottom of this window. Enter a text and press ENTER.
 Your name is added to your text and the message is sent to all other connected players.
 When a game starts, this window looses the focus to allow you to use the keys
 for the game. You can send a message during the game by selecting again this window
 (with the mouse, the Window menu, or the key defined in Options/Preferences/keys).
 There are some channels available to send a message to a specific player. To send a message
 only to a specific player, type :x before your message, x is the player number. 
 To send a message only to all the players in your team (the friends) use :9 before your
 message.
 You can type Help in this window to get a brief summary of special blocks effects.
 Special commands and effect are available:
 /me text : display "Player text" with underlined format,
 /away text : display "Player is away (text)." and the current player is removed,
 /away : display "Player is back." and the Left Player is connected again to the game,
 \b : bold, \u : underline, \i : italic, \r, \R : Red, \g, \G : Green, \B : Blue,
 \y, \Y : Yellow, \t, \T: Turquoise, \p, \P: Purple.

4.2 Teams

 For multiplayer games this allows you to choose a team for the local players.
 Players that have the same team name are playing together (see 5.2). Be careful,
 the team names are case sensitive, so team1 and Team1 are not the same teams.
 You can choose to close automatically this window when a game is starting (see 3.3.4).

4.3 Actions

 This window displays all the actions during the game. An action is "one player plays
 a special to another player", "a player adds lines to another player" or "the game is
 increasing level".
 You can choose to redirect this window into the Chat window (see 3.3.4).

4.4 Fields

 These are the main windows for the game. At the top of these windows you have
 statistics and the next piece to be played. The statistics are the number of lines
 the player has done and the number of lines the player has added to others.
 On the right side you have the inventory with the accumulated special blocks.
 The current special block is the one at the top of the inventory column.

5.Rules

5.1 Standard Rules

 The pieces are going down in the field. The player can change the x-position and
 the rotation of the piece when it is going down. When a block prevents a piece to move
 down, the piece is kept here and another piece appears at the top of the field.
 When a line is completed, this line is removed and all the upper game is shifted down.
 When a new piece cannot be displayed (because there is already a block at this position)
 the game is over for this player.

5.2 Multiplayer Rules

 When a player is doing more than one line in one step, new lines are added at the
 bottom of the fields of the opponents. The rule is: 1 added for 2 completed, 2 for 3 and
 4 for 4.
 Opponents and friends are chosen in the Teams window. To be on the same team,
 enter the same name.
 The game stops when it remains only one team alive.
 
5.3 Special Blocks Rules

 When the option special blocks is selected, the following rules apply:

 - everytime you do x lines, x blocks are replaced by x special blocks on your field,
 - everytime you do x lines with several special blocks, these special blocks
   are added into your inventory and they are multiplied by the number of lines you
   have done
 - the inventory can contain up to 20 special blocks if the height is bigger than 20.
   The inventory size follows the size of the field if the height is smaller than 20.

 Special Blocks effects:

  A: Add line
      A new line with some holes is added at the bottom of the target player's field.

  C: Clear line
      The bottom line of the field is removed.

  B: Block clear
      All the special blocks are replaced by normal ones.

  G: field Gravity
      Each block with a hole under it is moved down. The completed lines at the
      bottom are removed without earning new special blocks.

  N: New field
      All the blocks are removed. A new field is displayed.
  
  R: Random clear block
      10 block positions in the field are cleared. Sometimes they were already clear, 
      other times not...

  O: blOck bOmb
      On the target field, all the blocks around all the O block are randomly
      displayed.

  Q: Quake block
      All the lines are shifted right or left.

  S: Swap Block
      Two fields are swapped.

 You can use the command help in the chat window to get a brief summary of the special
 blocks efects.

5.4 Score Rules

 Two kinds of score are displayed in Teams window: the player score and the team score.
 The scores are updated at the end of each game.
 Only the 3 lasts players scores at the end of the game. The number of points for the 
 last player in game (the winner) is depending on the number of the players playing. 
 He scores 3 points if there is at least 3 players. Otherwise, he scores the number of 
 players. The player next to the winner scores 1 point less him. The 2nd player next
 to the winner scores 2 points less him.
 For the team score it is the same. The number of points for the last team in game is
 depending on the number of teams playing. 3 for the winning team if there is at least 
 3 teams. Otherwise the score is the number of teams in game. The 2nd team scores 1
 point less the winner one and the 3rd team 2 points less.
 Note that both scores (player and team) are related to each player. Even if a player
 change his team, he keeps his team score.
 The difference between the two kind of scores is that a bad player could have a player
 score at 0 if he loses everytime and a team score not equal to 0 if the other players
 in his team have won some games.

6.Theme Files

6.1 Overview

 A theme is a file that allows you to change the appearance of T2net by changing 
 bitmaps and sounds. It's a basic text file with several section (as a .ini file).
 The standard extension for T2net Theme file is '.t2t'.
 The best way to create a new theme is to copy one and modify only the right part of 
 each entry.
 T2net executable path is used to retrieve all the files. If you want to use 
 subdirectories you can but you have to put the name of the subdirectory before the
 filename. The subdirectory has to be created in the T2net executable directory.

6.2 Bitmap Section

 This section contains all bmp files used by T2net.
 The section is [Bitmaps]. Each kind of bitmap use the following description: 
 bitmaptype = bitmap.bmp.

 background is the bitmap for the main window.
 score is the bitmap for the score heading.
 invent is the bitmap for the inventory.
 game is the bitmap for the field

 If you want to have different bitmaps for each team, you have to use bitmap_nb and 
 gamex (with x betwwen 0 and bitmap_nb value).

 bitmap_nb is the number of bitmap used to differentiate team fields.
 game0 is the bitmap for team number 0,
 game1 ............................. 1,
 ...

 For instance if you put bitmap_nb = 3 you shoud have next:
 game0 = team0.bmp
 game1 = team1.bmp
 game2 = team2.bmp

 You have two modes for the pieces: the bitmap mode and the block mode.
 This mode is selected by the T2net user interface (see 3.3.4), so you have to
 fill the two entry because it's the end user that decides what mode he wants.
 With the bitmap mode, all the pieces are using one unique bitmap.
 For this mode you have to use pieces.
 With the block mode one bitmap is containing 5 differents basic blocks.
 The colour of the piece could be different. For this you should use blocks.
 The bitmap you specify (blocks = blocks.bmp) should have 160x32 size (5 times 32*16).

 You also have two modes for letter display: bitmap mode or font mode. 
 This mode is selected by the T2net user interface (see 3.3.4), so you have to
 fill the two entry because it's the end user that decides what mode he wants.
 With the bitmap mode you use blockletters. This bitmap contains the 9 special blocks 
 bitamp and should have 288x32 size (9 times 32*32).
 With the font mode, T2net use an internl font to display the letters. So you just have
 to specify the background bitmap with letters.

6.3 Grid Section

 This section contains type and colour for the grid.
 The section is [Grid].
 grid_width is the width used to draw the lines. This value has to be between 0 and 4.
 grid_type is the kind of the grid.
 0 solid line
 1 dashed line
 2 dotted line
 3 alternated dot and dash
 4 alternated double dot and dash
 1 to 4 type can only be used with width set to 1.

 Next you have to choose the colour for the lines. The choice of the colour is dependant
 on the bitmap field choice so you have as many colour as field bitmap you have in the 
 bitmap section.
 For each bitmap you have to choose red, green and blue components of the line. For 
 instance if you want to have blue lines on bitmap 0 and black lines on bitmap 1:
 grid_red0   = 0
 grid_green0 = 0
 grid_blue0  = 255
 grid_red1   = 0
 grid_green1 = 0
 grid_blue1  = 0

6.4 Text Section

 This section contains colour for text display. These colours have to be choosen according
 to the bitmap where the text is displayed.
 The section is [Text].
 For each colour you have to sceify red, green and blue components of the the text.
 score is the text for the score display (number of lines done).
 text1 is used for caption in the field heading (Lines and Next Piece).
 text2 is used to display score on the field (when this option is selected into T2net 
 window preferences)
 letter is the color of the font for special blocks.

6.5 Sound Section

 Here you find all wav files for each gameplay events and the midi selection.
 The section is [Sounds].
 gamestart is the wav file played when a new game starts.
 gameover is played when you lose.
 gamewon is played when you win.
 piecedown is played when a piece is dropped.
 pieceinplace is played when a piece go alone in place (without a drop).
 bonus is played when you do 4 lines
 ok is used when you press Ok button in the dialog box.
 cancel is udes when you press the cancel button.
 lines is used when you make at least 2 lines.
 chat is used when someone is saying someting in the chat (only during the game and for
 active players).
 midi is used to play a music during the game. Wildcards are accepted. If you put *.mid, 
 all midi files in T2net folder will be played at random.

7.Algorithms

7.1 Overview

 An algorithm is a Windows 32 bit DLL with some required functions.
 These DLLs must be put into the directory specified in T2net 
 (Preferences/Advanced parameters).

 The list of the required functions is:

  T2NetInfo: This function is called one time just after T2net 
             has loaded the DLL. This function is used to give
             to T2net some general information about the 
             Algorithm (Name, Author...).

  T2NetInit: This function is called before each game start.
             This function is useful for the algorithm to know the
             kind of game that is starting and to make some
             initializations.

  T2NetEvent: This function is called every time the algorithm is
              allowed to do an action. The state of the game for
              the algorithm is given and the function must return
              which action the algorithm wants to do (move a 
              piece, play a special block, say a message in the 
              chat...).

 The optional functions are:

  T2NetParam: This function is called by T2net when the user
              press the Param button in front of the selected
              algorithm in the Players/Algo dialog Box.
              This can be used by an algorithm's author to have 
              the possibility to change dynamically some 
              parameters of his algorithm. 

  T2NetEnd:   This function is called at the end of a game.
              The algorithm can retrieve all the information 
              about the game (the winner, the scores...) and 
              can use it for the next game.
              
7.2 Interfaces

7.2.1 T2NetInfo

The prototype is:

void T2NetInfo(T2NetInfoRsp *rsp)

rsp is an output parameter. It's a pointer to a T2NetInfoRsp
structure. This structure is the following:

typedef struct
  {
  LPSTR algoname;
  LPSTR realname;
  LPSTR email;
  LPSTR description;
  LPSTR version;
  LPSTR date;
  LPSTR interfaceversion;
  BOOL  special_blocks;
  BOOL  pentomino;
  } T2NetInfoRsp;         

algoname is a pointer to a string which contains the name of the algorithm.
realname is a pointer to a string which contains the name of the author.
email is a pointer to a string which contains the email of the author.
description is a pointer to a string and is designed to have more information
about the algorithm (but you can put what you want).
version is a pointer to a string which contains the version of the algorithm (you
can put here what you want).
date is a pointer to a string which contains the date of the algorithm creation.
interfaceversion is a pointer to a string which contains the version of the
interface used by the algorithm. This parameter is MANDATORY. You have to put
here the version of the interface you have used for creating the DLL. This version
is displayed into the T2net_it.h file. It is useful for the main application
T2net.exe to know the version of the interface used by the DLLs to detect if
they are up to date or not. If the interfaces are not matching between T2net and
the DLL, an error message is displayed just after the DLL is loaded and the DLL is
unloaded.
special_blocks is a boolean that must be filled by the algorithm to indicate to 
T2net if it supports special_blocks (TRUE: yes, FALSE: no).
pentomino is a boolean that must be filled by the algorithm to indicate to 
T2net if it supports pentomino mode (5 block pieces, TRUE: yes, FALSE: no).

7.2.2 T2NetInit

The prototype is:

void T2NetInit(T2NetInitInd Init)

Init is an input parameter. It is a T2NetInitInd structure:

typedef struct
  {
  short int dx;
  short int dy;
  BOOL  special_blocks;
  BOOL  pentomino;
  team_game_t teams[MAX_PLAYERS];
  short int nb_teams;
  short int num_player;
  short int num_team;
  FARPROC AlgoInfoReq;
  short int algo_delay;
  } T2NetInitInd;

dx is the width of the field.
dy is the height of the field.
special_blocks is a boolean indicating that special blocks will be given during 
the game.
pentomino is a boolean indicating the mode of the game is pentomino (5 block pieces).
teams is a description of all the teams involved in the game.
nb_teams is the number of teams involved in the game.
num_player is the player number of the algorithm.
num_team is the team number of the algorithm.
AlgoInfoReq is a pointer to a function that can be called by the algortithm
during the game to have more information about the game.
algo_delay is the time in ms between two consecutive calls to T2NetEvent
during the game.

7.2.3 T2NetEvent

The prototype is:

void T2NetEvent(T2NetEventReq *Req, T2NetEventRsp *Rsp)

Req is an input parameter. Rsp is an output parameter.
Req is a pointer to a T2NetEventReq structure:

typedef struct
  {
  unsigned char field[MAX_DIMX][MAX_DIMY];
  short int pc;
  short int next_pc;
  short int x;
  short int y;
  short int rot;
  short int nb_inventory;
  short int inventory[MAX_INVENTORY];
  short int level;
  short int late_nb;
  short int miss_nb;
  BOOL  player_alive[MAX_PLAYERS];
  BOOL  pending_msgs;
  BOOL  pending_actions;
  } T2NetEventReq;

field is an array which describes the content of the algorithm field. It's a 2 
dimension array. Each field[x][y] element has one of the following values:

EMPTY_BLOCK: no block at the position x,y,
TAKEN_BLOCK: a block is at the position x,y,
INVENTORY_A: special 'A' block,
INVENTORY_B: special 'B' block,
INVENTORY_C: special 'C' block,
INVENTORY_G: special 'G' block,
INVENTORY_N: special 'N' block,
INVENTORY_O: special 'O' block,
INVENTORY_Q: special 'Q' block,
INVENTORY_R: special 'R' block,
INVENTORY_S: special 'S' block,

pc is the number of the current piece to be placed.
next_pc is the next piece (the future pc).
x is the current x field coordinate of the current piece.
y is the current y field coordinate of the current piece.
rot is the current rotation of the current piece.
nb_inventory is the number of special blocks available into the inventory.
inventory is an array which contains all the available special blocks.
level is the current level.
late_nb is the number of T2NetEvent calls the algorithm has missed since the
last call.
miss_nb is the number of pieces the algorithm has missed since the last call.
player_alive is an array of booleans that indicates the players still alive.
pending_msgs is a boolean indicating that at least one message has been displayed
into the chat and can be retrieved by the algorithm (with the AlgoInfoReq 
function).
pending_actions is a boolean indicating that at least one action has been applied
and can be retrieved by the algorithm (with the AlgoInfoReq function).

Rsp is a pointer to a T2NetEventRsp structure:

typedef struct
  {
  short int action;
  union
    {
    MovePiece      mp;
    PlayInventory  pi;
    Message        msg;
    } utype;
  } T2NetEventRsp;

action is used to indicate which action the algorithm would like to play. 
It's one of the following:

ACTION_NOTHING: nothing to do,
ACTION_MOVE_PIECE for moving the piece,
ACTION_PLAY_INVENTORY for playing the current special block,
ACTION_MESSAGE for sending a message into the chat.

mp is used to move a piece, the structure is:

typedef struct
  {
  short int typemove;
  } MovePiece;

typemove could be one of the following:

MOVE_LEFT: the current piece will move one position left.      
MOVE_RIGHT: the current piece will move one position right.
MOVE_ROT_LEFT: the current piece will rotate one time left.
MOVE_ROT_RIGHT: the current piece will rotate one time right.
MOVE_DOWN: the current piece will move one time down.
MOVE_DROP: the current piece will be dropped at his current position.

pi is used to play the current special block, the structure is:

typedef struct
  {
  short int player;
  } PlayInventory;

player is the number of the player receiving the special block.

msg is used to send a message into the chat, the structure is:

typedef struct
  {
  char txt[MAX_TXT];
  } Message;

txt contains the text of the message. Channel rules are the same as for humans (see 4.1).

7.2.4 T2NetParam

The prototype is:

void T2NetParam(void)

This function has no parameter. This function is called by the Players/Algo
dialog box selection.

7.2.5 T2NetEnd

The prototype is:

void T2NetEnd(T2NetEndReq *Req, T2NetEndRsp *Rsp)

Req is an input parameter. Rsp is an output parameter.

Req is a pointer to a T2NetEndReq structure:

typedef struct
  {
  short int kill_player_order[MAX_PLAYERS];
  short int kill_team_order[MAX_PLAYERS];
  short int players_score[MAX_PLAYERS];
  short int teams_score[MAX_PLAYERS];
  short int players_games[MAX_PLAYERS];
  short int nb_lines[MAX_PLAYERS];
  short int nb_lines_added[MAX_PLAYERS];
  } T2NetEndReq;

kill_player_order contains an ordered winner list of the players.
kill_team_order contains an ordered winner list of the teams.
players_score contains the individual score of each player.
teams_score contains the team score for each player.
nb_lines contains for each player the number of lines he has done.
nb_lines_added contains for each player the number of lines he has added to other players.

Rsp is a pointer to a T2NetEndRsp structure:

typedef struct
  {
  short int action;
  union
    {
    Message        msg;
    } utype;
  } T2NetEndRsp;

action is the kind of action to be performed. Only ACTION_MESSAGE is available.
msg is the structure used to display a message into the chat (same as 6.2.3).

7.2.6 AlgoInfoReq

This is a T2net function that can be called by the algorithm. The pointer to this
function is provided in the T2NetInitInd structure and has to be stored by the
algorithm during the call to T2NetInit for a future use.
This function is used by the algorithm to get extended information on the game.
Extended information is:

 - other player's fields,
 - chat messages,
 - action messages.

When calling this function, the algorithm must use the following prototype:

void InfoFct(T2NetAlgoInfoReq *Inforeq, T2NetAlgoInfoRsp *Inforsp);

Inforeq must be filled by the algorithm. After the call, T2net has filled Inforsp.

The structure of T2NetAlgoInfoReq is:

typedef struct
  {
  short int info;
  union
    {
    GamePlayerReq gp;
    } utype;
  } T2NetAlgoInfoReq;

info is the kind of extended info the algorithm would like to retrieve. It could be:

INFO_GAME to get a player's field,
INFO_MSG to get chat messages,
INFO_ACTION to get action messages.

For player's fields, gp must be filled. It is a GamePlayerReq:

typedef struct
  {
  short int player;
  } GamePlayerReq;

player is the number of the player the algorithm would like to retrieve the field.

The structure of T2NetAlgoInfoRsp is:

typedef struct
  {
  short int info;
  union
    {
    GamePlayerRsp    gp;
    MessagePlayerRsp mp;
    ActionPlayerRsp  ap;
    } utype;
  } T2NetAlgoInfoRsp;

info is the same as for T2NetAlgoInfoReq. T2net does a copy of it.

GamePlayerRsp is the response to an INFO_GAME request:

typedef struct
  {
  short int player;
  char name[NAME_LENGTH];
  unsigned char field[MAX_DIMX][MAX_DIMY];
  } GamePlayerRsp;

player is the number of the player (same as for GamePlayerReq).
name is the name of the player.
field is the description of the player's field as for T2NetEventReq structure (see 6.2.3).

MessagePlayerRsp is the response to a INFO_MSG request:

typedef struct
  {
  short int nb;
  short int first;
  char  messages[MAX_MSG][MAX_TXT];
  short int player_msg[MAX_MSG];
  } MessagePlayerRsp;

nb is the number of messages since last call. Note that nb can be greater
than MAX_MSG. In this case nb-MAX_MSG messages are lost and cannot be retrieved by the 
algorithm.
first is the number of the oldest message in the list.
messages is the list of all the messages.
player_msg is the player who has sent the message.

ActionPlayerRsp is the response to an INFO_ACTION request:

typedef struct
  {
  short int nb;
  short int first;
  t_action  action[MAX_ACTION];
  } ActionPlayerRsp;

nb is the number of actions since last call. Note that nb can be greater than
MAX_ACTION. In this case nb-MAX_ACTION actions are lost and cannot be retrieved by the
algorithm.
first is the oldest action.
action is the list of all the actions. The structure is:

typedef struct
  {
  short int source_player;
  short int target_player;
  char  special_block;
  } t_action;

source_player is the player that has originated the action.
target_player is the player that has reveived the action (0 means all players).
special_block could be one of the following values:

INVENTORY_A: special 'A' block,
INVENTORY_B: special 'B' block,
INVENTORY_C: special 'C' block,
INVENTORY_G: special 'G' block,
INVENTORY_N: special 'N' block,
INVENTORY_O: special 'O' block,
INVENTORY_Q: special 'Q' block,
INVENTORY_R: special 'R' block,
INVENTORY_S: special 'S' block,
LINE_ADDED+x: x lines added to all players.

7.3 Files

 Two files are available to have the C interface for creating algorithms:

  T2net_it.h defines all the define, type and structure needed,
  T2net_ct.h defines the constants needed (mainly the pieces).

7.4 More information

 To get more information (algorithm samples, tutorial, field and pieces description, FAQ)
 a WEB site is available at http://www.chez.com/xunk.
 To submit bugs or other feedback, you can write to XunK@mail.dotcom.fr or 
 glop@mail.dotcom.fr.

8.End-user agreement

THIS SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTIES OF ANY KIND, EITHER 
EXPRESS OR IMPLIED. YOU EXPRESSLY AGREE THAT USE OF THE PROGRAM ARE AT YOUR 
SOLE RISK.
IT IS NOT WARRANTED THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL BE FREE 
OF ERRORS. NO ONE SHALL NOT BE LIABLE FOR ANY INCIDENTAL OR CONSEQUENTIAL 
DAMAGES OF ANY NATURE OR FOR ANY REASON, OR FOR COMMERCIAL LOSSES OF ANY CAUSE.
CONSEQUENTIAL DAMAGES INCLUDE ANY LOSS OF INFORMATION, DAMAGE TO COMPUTER OR 
MONITOR, LOSS OF PROFITS, BUSINESS INTERRUPTIONS AND ANY OTHER MONETARY LOSS.