]> icculus.org git repositories - taylor/freespace2.git/blob - include/multi_pmsg.h
embed standalone web in executable
[taylor/freespace2.git] / include / multi_pmsg.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Network/multi_pmsg.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * $Log$
16  * Revision 1.2  2002/06/09 04:41:14  relnev
17  * added copyright header
18  *
19  * Revision 1.1.1.1  2002/05/03 03:28:12  root
20  * Initial import.
21  * 
22  * 
23  * 2     10/07/98 10:53a Dave
24  * Initial checkin.
25  * 
26  * 1     10/07/98 10:50a Dave
27  * 
28  * 6     5/08/98 5:05p Dave
29  * Go to the join game screen when quitting multiplayer. Fixed mission
30  * text chat bugs. Put mission type symbols on the create game list.
31  * Started updating standalone gui controls.
32  * 
33  * 5     4/22/98 4:59p Allender
34  * new multiplayer dead popup.  big changes to the comm menu system for
35  * team vs. team.  Start of debriefing stuff for team vs. team  Make form
36  * on my wing work with individual ships who have high priority orders
37  * 
38  * 4     4/02/98 5:50p Dave
39  * Put in support for standard comm messages to get sent to netplayers as
40  * well as ai ships. Make critical button presses not get evaluated on the
41  * observer.
42  * 
43  * 3     3/27/98 11:57a Dave
44  * Put in expression checking for text messages.
45  * 
46  * 2     3/25/98 2:16p Dave
47  * Select random default image for newly created pilots. Fixed several
48  * multi-pause messaging bugs. Begin work on online help for multiplayer
49  * keys.
50  * 
51  * 1     3/19/98 5:04p Dave
52  *  
53  * 
54  * $NoKeywords: $
55  */
56
57 #ifndef _MULTIPLAYER_MESSAGING_HEADER_FILE
58 #define _MULTIPLAYER_MESSAGING_HEADER_FILE
59
60
61 // ----------------------------------------------------------------------------------
62 // MULTI MESSAGING DEFINES/VARS
63 //
64
65 struct net_player;
66 struct ai_info;
67 struct header;
68
69 // messaging modes
70 // netgame messaging settings
71 #define MULTI_MSG_NONE                                          -1                                                      // not in messaging mode (send to no one)
72 #define MULTI_MSG_ALL                                           0                                                       // all players in the game
73 #define MULTI_MSG_FRIENDLY                                      1                                                       // friendly ships
74 #define MULTI_MSG_HOSTILE                                       2                                                       // hostile ships
75 #define MULTI_MSG_TARGET                                        3                                                       // to whatever is my targeted ship (if a player)
76 #define MULTI_MSG_EXPR                                          4                                                       // send to all players whose callsigns match the expr
77
78 // max length for an entered text message
79 #define MULTI_MSG_MAX_TEXT_LEN                  255                                             
80
81
82 // ----------------------------------------------------------------------------------
83 // MULTI MESSAGING FUNCTIONS
84 //
85
86 // called when a messaging key has been detected as being pressed
87 void multi_msg_key_down(int mode);
88
89 // returns true when messaging system has determined that we should be messaging with voice
90 int multi_msg_voice_record();
91
92 // general processing function to do things like timing keydown, etc. call from multi_do_frame()
93 void multi_msg_process();
94
95 // get the current messaging mode
96 int multi_msg_mode();
97
98 // maybe process a keypress in text messaging mode, return true if the key was processed
99 int multi_msg_text_process(int k);
100
101 // return 0 or 1 if in text chat mode or not
102 int multi_msg_text_mode();
103
104 // return 0 or 1 if there is multi text to be rendered (filling in txt if necessary)
105 int multi_msg_message_text(char *txt, const int txt_len);
106
107 // display ingame,inmission message text
108 void multi_msg_display_mission_text(const char *msg, int player_index);
109
110 // if the passed net_player's callsign matches the reg expression of the passed expr
111 int multi_msg_matches_expr(net_player *player, const char *expr);
112
113 // if text input mode is active, clear it
114 void multi_msg_text_flush();
115
116
117 // -----------------------------------------------------------------------------------
118 // MULTI SQUADMATE MESSAGING FUNCTIONS
119 //
120
121 // evaluate if a wing SQUADMATE MESSAGE command should be sent to a player
122 // return 0 if at least one ai ship got the order, 1 if only players
123 int multi_msg_eval_wing_squadmsg(int wingnum,int command,ai_info *aif,int player_num);
124
125 // evaluate if a ship SQUADMATE MESSAGE command should be sent to a player
126 // return 0 if not sent to a netplayer, 1 if it was
127 int multi_msg_eval_ship_squadmsg(int shipnum,int command,ai_info *aif, int player_num);
128
129 // process incoming squadmate messaging info 
130 void multi_msg_process_squadmsg_packet(unsigned char *data, header *hinfo);
131
132 #endif
133