FS2_Open
Open source remastering of the Freespace 2 engine
multi_pmsg.cpp
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 
13 #include <ctype.h>
14 
15 #include "network/multi_pmsg.h"
16 #include "network/multi.h"
17 #include "network/multimsgs.h"
18 #include "network/multiutil.h"
19 #include "network/multi_kick.h"
20 #include "gamesnd/gamesnd.h"
21 #include "hud/hudmessage.h"
22 #include "hud/hudsquadmsg.h"
23 #include "io/key.h"
24 #include "io/timer.h"
25 #include "playerman/player.h"
26 #include "ship/ship.h"
27 #include "object/object.h"
28 #include "parse/parselo.h"
29 #include "sound/fsspeech.h"
30 
31 
32 
33 // ----------------------------------------------------------------------------------
34 // MULTI MESSAGING DEFINES/VARS
35 //
36 
37 // if a key is down less than this time, fire up the test messaging system, otherwise fire up the voice messaging system
38 #define MULTI_MSG_KEYDOWN_WAIT 325 // in ms
39 
40 // sound to play before displaying incoming text messages in-mission
41 #define MULTI_MSG_TEXT_SOUND SND_CUE_VOICE
42 
43 // max length of a string we'll allow players to send
44 #define MULTI_MSG_MAX_LEN 75
45 
46 // current message processing mode
48 
49 // timestamp for timing keydown
50 int Multi_msg_stamp = -1;
51 
52 // flag indicating if there is _still_ a key down for the current message mode
54 
55 // timestamp set when we leave messaging mode, use to keep eating keys for a short period of time
57 
58 // text message input vars
61 
62 // command defines - all these commands must be followed by a ":" so that we can easily tokenize and recognize
63 // it as a command instead of a word. they also must be immediately at the beginning of a text string
64 // SO : kick dave would not work
65 // kick: dave would work
66 // Finally, if no command is found but there is a ":", it uses the text before the : as an expression to
67 // lookup players to route the text to
68 #define MULTI_MSG_CMD_COUNT 1 // # of commands
69 #define MULTI_MSG_CMD_KICK 0 // kick command
70 
71 //XSTR:OFF
72 char *Multi_msg_commands[MULTI_MSG_CMD_COUNT] = { // commands themselves
73  "kick"
74 };
75 //XSTR:ON
76 
77 // process an entered line of text and maybe perform a command on it (return 1 if an action was performed, 0 if not)
78 int multi_msg_check_command(char *str);
79 
80 // perform the passed command (MULTI_MSG_CMD_* define) with the passed string argument
81 void multi_msg_perform_command(int command,char *param);
82 
83 
84 // ----------------------------------------------------------------------------------
85 // MULTI MESSAGING FUNCTIONS
86 //
87 
88 // called when a messaging key has been detected as being pressed
90 {
91  // keep eating keys for a short period of time
93  return;
94  }
95 
96  // if our player flags are marked as being in msg mode, don't do anything
98  return;
99  }
100 
101  // if there already is a keydown
103  // if it is the same as the current mode, set the "still down" flag
104  if((mode == Multi_msg_mode) && !Multi_msg_text_enter){
106  }
107 
108  // return here
109  return;
110  }
111 
112  // otherwise set the message mode and set the timestamp
116 }
117 
118 // returns true when messaging system has determined that we should be messaging with voice
120 {
122 }
123 
124 // general processing function to do things like timing keydown, etc. call from multi_do_frame()
126 {
127  // keep eating keys for a short period of time
129  Multi_msg_eat_stamp = -1;
130  return;
131  }
132 
133  // if we don't currently have a valid mode set, don't do anything
135  return;
136  }
137 
138  // if the key has been released
140  // if the timestamp had not yet elapsed, fire up the text messaging system
141  // this is the equivalent of a (TAP)
143  // fire up text messaging system here
146  } else {
148  Multi_msg_stamp = -1;
149  }
150  }
151 
152  // unset the repeat flag every frame
154 }
155 
156 // get the current messaging mode
158 {
159  return Multi_msg_mode;
160 }
161 
162 // return 0 or 1 if in text chat mode or not
164 {
165  return Multi_msg_text_enter;
166 }
167 
168 // process a text string entered by the local player
170 {
171  int player_index;
172 
173  // if its a 0 length string, don't do anything
174  if(strlen(Multi_msg_text) <= 0){
175  return;
176  }
177 
178  // evaluate any special commands here
180  return;
181  }
182 
183  // get the player if in MSG_TARGET mode
185  if(Player_ai->target_objnum != -1){
187  if(player_index != -1){
188  // send the chat packet
190 
191  // echo the message locally
193  }
194  }
195  }
196  // all other modes
197  else {
198  // send the chat packet
200 
201  // echo the message locally
203  }
204 }
205 
206 // maybe process a keypress in text messaging mode, return true if the key was processed
208 {
209  char str[2];
210 
211  // keep eating keys for a short period of time
213  return 1;
214  }
215 
216  // if we're not in text message mode, return 0
218  return 0;
219  }
220 
221  switch(k){
222  // cancel the message
223  case KEY_ESC:
225  break;
226 
227  // send the message
228  case KEY_ENTER:
231  break;
232 
233  // backspace
234  case KEY_BACKSP:
235  if(Multi_msg_text[0] != '\0'){
236  Multi_msg_text[strlen(Multi_msg_text)-1] = '\0';
237  }
238  break;
239 
240  // ignore these individual keys
241  case KEY_LSHIFT + KEY_SHIFTED:
242  case KEY_RSHIFT + KEY_SHIFTED:
243  case KEY_LALT + KEY_SHIFTED:
244  case KEY_RALT + KEY_SHIFTED:
245  case KEY_LCTRL + KEY_SHIFTED:
246  case KEY_RCTRL + KEY_SHIFTED:
247  break;
248 
249  // stick other printable characters onto the text
250  default :
251  // if we're not already at the maximum length
252  if(strlen(Multi_msg_text) < MULTI_MSG_MAX_LEN){
253  str[0] = (char)key_to_ascii(k);
254  str[1] = '\0';
255  strcat_s(Multi_msg_text,str);
256  }
257  break;
258  }
259 
260  return 1;
261 }
262 
263 // return 0 or 1 if there is multi text to be rendered (filling in txt if necessary)
265 {
266  // if we're not in text message mode, return 0
268  return 0;
269  }
270 
271  // put the target of the message at the front of the string
272  switch(Multi_msg_mode){
273  // messaging all players
274  case MULTI_MSG_ALL:
275  strcpy(txt, XSTR("ALL : ",694));
276  break;
277 
278  // messaging friendly players
279  case MULTI_MSG_FRIENDLY:
280  strcpy(txt,XSTR("FRIENDLY : ",695));
281  break;
282 
283  // messaging hostile players
284  case MULTI_MSG_HOSTILE:
285  strcpy(txt,XSTR("HOSTILE : ",696));
286  break;
287 
288  // messaging targeted ship
289  case MULTI_MSG_TARGET:
290  strcpy(txt,XSTR("TARGET : ",697));
291  break;
292 
293  default :
294  Int3();
295  }
296  strcat(txt,Multi_msg_text);
297  strcat(txt,"_");
298  return 1;
299 }
300 
301 // display ingame,inmission message text
302 void multi_msg_display_mission_text(const char *msg, int player_index)
303 {
304  // play a cue voice sound and text to speech if not from this player
305  if(Net_players[player_index].player_id != MY_NET_PLAYER_NUM) {
308  }
309 
310  if(MULTI_STANDALONE(Net_players[player_index])){
311  HUD_sourced_printf(HUD_SOURCE_NETPLAYER,"%s %s",XSTR("<SERVER>", 698), msg);
312  } else {
313  HUD_sourced_printf(HUD_SOURCE_NETPLAYER,"%s: %s", Net_players[player_index].m_player->callsign, msg);
314  }
315 }
316 
317 // if the passed net_player's callsign matches the reg expression of the passed expr
318 int multi_msg_matches_expr(net_player *np, const char *expr)
319 {
320  // some error checking
321  if((np == NULL) || (expr == NULL) || (strlen(expr) <= 0)){
322  return 0;
323  }
324 
325  return stricmp(expr, np->m_player->callsign) ? 0 : 1 ;
326 }
327 
328 // if text input mode is active, clear it
330 {
333  Multi_msg_stamp = -1;
334 
335  // keep eating keys for a short period of time and unset any used control bits
338  key_flush();
339 }
340 
341 
342 // -----------------------------------------------------------------------------------
343 // MULTI MESSAGE COMMAND FUNCTIONS
344 //
345 
346 // process an entered line of text and maybe perform a command on it (return 1 if an action was performed, 0 if not)
348 {
349  int idx;
350  char *prefix = NULL, *predicate = NULL, param[MULTI_MSG_MAX_TEXT_LEN+1];
351  char temp_str[MULTI_MSG_MAX_TEXT_LEN+1];
352 
353  // look for a colon
354  if(strstr(str,":") == NULL){
355  return 0;
356  }
357 
358  // we don't want to modify the original string, which strtok() does
359  strcpy_s(temp_str, str);
360 
361  // try and find a command prefix
362  prefix = strtok(temp_str, ":");
363  if (prefix == NULL)
364  return 0;
365 
366  // get all the text after the message
367  predicate = strtok(NULL, NOX("\n\0"));
368  if (predicate == NULL)
369  return 0;
370 
371  // store the text as the actual parameter
372  strcpy_s(param, predicate);
374 
375  // go through all existing commands and see what we can do
376  for(idx=0;idx<MULTI_MSG_CMD_COUNT;idx++){
377  if(!stricmp(prefix,Multi_msg_commands[idx])){
378  // perform the command
379  multi_msg_perform_command(idx,param);
380 
381  // return true
382  return 1;
383  }
384  }
385 
386 
387  // apply the results as a general expression, if we're in message all mode
389  strcpy_s(Multi_msg_text,param);
390 
391  // send the chat packet
393 
394  // echo the message locally
396 
397  // return true
398  return 1;
399  }
400 
401 
402  // no commands performed
403  return 0;
404 }
405 
406 // perform the passed command (MULTI_MSG_CMD_* define) with the passed string argument
407 void multi_msg_perform_command(int command,char *param)
408 {
409  // we may eventually want to split each of these cases into its own function to make things neater
410  switch(command){
411  // kick a player
412  case MULTI_MSG_CMD_KICK:
413  int np_index = multi_find_player_by_callsign(param);
414  if(np_index != -1){
415  multi_kick_player(np_index);
416  }
417  break;
418  }
419 }
420 
421 
422 // -----------------------------------------------------------------------------------
423 // MULTI SQUADMATE MESSAGING FUNCTIONS
424 //
425 
426 //XSTR:OFF
427 
429  "None",
430  "Engine",
431  "Turret",
432  "Bridge",
433  "Radar",
434  "Navigation",
435  "Communication",
436  "Weapons",
437  "Sensors",
438  "Solar Array",
439  "Unknown"
440 };
441 
442 //XSTR:ON
443 
444 // display a squadmsg order directed towards _me_
445 void multi_msg_show_squadmsg(net_player *source,int command,ushort target_sig,int subsys_type)
446 {
447  char hud_string[255];
448  char temp_string[100];
449  int should_display;
450  object *target_obj;
451 
452  // clear the strings
453  memset(hud_string,0,255);
454  memset(temp_string,0,100);
455 
456  // add the message header
457  sprintf(hud_string,XSTR("ORDER FROM <%s> : ",699),source->m_player->callsign);
458 
459  // get the target obj if possible
460  target_obj = NULL;
461  target_obj = multi_get_network_object(target_sig);
462 
463  should_display = 1;
464 
465  // add the command specific text
466  switch(command){
467  // attack my target
468  case ATTACK_TARGET_ITEM :
469  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP)){
470  sprintf(temp_string,XSTR("Attack %s",700),Ships[target_obj->instance].ship_name);
471  strcat_s(hud_string,temp_string);
472  } else {
473  should_display = 0;
474  }
475  break;
476 
477  // disable my target
478  case DISABLE_TARGET_ITEM:
479  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP)){
480  sprintf(temp_string,XSTR("Disable %s",701),Ships[target_obj->instance].ship_name);
481  strcat_s(hud_string,temp_string);
482  } else {
483  should_display = 0;
484  }
485  break;
486 
487  // protect my target
488  case PROTECT_TARGET_ITEM:
489  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP)){
490  sprintf(temp_string,XSTR("Protect %s",702),Ships[target_obj->instance].ship_name);
491  strcat_s(hud_string,temp_string);
492  } else {
493  should_display = 0;
494  }
495  break;
496 
497  // ignore my target
498  case IGNORE_TARGET_ITEM:
499  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP)){
500  sprintf(temp_string,XSTR("Ignore %s",703),Ships[target_obj->instance].ship_name);
501  strcat_s(hud_string,temp_string);
502  } else {
503  should_display = 0;
504  }
505  break;
506 
507  // disarm my target
508  case DISARM_TARGET_ITEM:
509  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP)){
510  sprintf(temp_string,XSTR("Disarm %s",704),Ships[target_obj->instance].ship_name);
511  strcat_s(hud_string,temp_string);
512  } else {
513  should_display = 0;
514  }
515  break;
516 
517  // disable subsystem on my target
519  if((target_obj != NULL) && (target_obj->type == OBJ_SHIP) && (subsys_type != -1) && (subsys_type != 0)){
520  sprintf(temp_string,XSTR("Disable subsystem %s on %s",705),Multi_msg_subsys_name[subsys_type],Ships[target_obj->instance].ship_name);
521  strcat_s(hud_string,temp_string);
522  } else {
523  should_display = 0;
524  }
525  break;
526 
527  // form on my wing
528  case FORMATION_ITEM:
529  strcat_s(hud_string,XSTR("Form on my wing",706));
530  break;
531 
532  // cover me
533  case COVER_ME_ITEM:
534  strcat_s(hud_string,XSTR("Cover me",707));
535  break;
536 
537  // engage enemy
538  case ENGAGE_ENEMY_ITEM:
539  strcat_s(hud_string,XSTR("Engage enemy!",708));
540  break;
541 
542  default :
543  should_display =0;
544  break;
545  }
546 
547  // print it out
548  if(should_display){
549  HUD_printf(hud_string);
550  }
551 }
552 
553 // evaluate if the given netplayer exists in the passed wingnum
555 {
556  int idx;
557 
558  // if this guy doesn't have a valid ship, bail
559  if((pl->m_player->objnum == -1) || (Objects[pl->m_player->objnum].type != OBJ_SHIP)){
560  return 0;
561  }
562 
563  // look through all ships in the wing
564  for(idx=0;idx<Wings[wingnum].current_count;idx++){
565  // if we found a match
566  if(Wings[wingnum].ship_index[idx] == Objects[pl->m_player->objnum].instance){
567  return 1;
568  }
569  }
570 
571  return 0;
572 }
573 
574 // evaluate if the given netplayer is flying the passed shipnum
576 {
577  // if we found a matching ship
578  if((pl->m_player->objnum != -1) && (Objects[pl->m_player->objnum].type == OBJ_SHIP) && (shipnum == Objects[pl->m_player->objnum].instance)){
579  return 1;
580  }
581 
582  // not a matching ship
583  return 0;
584 }
585 
586 // send a squadmsg packet to a player
587 void multi_msg_send_squadmsg_packet(net_player *target,net_player *source,int command,ushort net_sig,int subsys_type)
588 {
589  ubyte data[100];
590  char s_val;
591  int packet_size;
592 
593  Assert(source != NULL);
594  Assert(target != NULL);
595  if((source == NULL) || (target == NULL)){
596  return;
597  }
598 
599  // build the header
601 
602  // add the command and targeting data
603  ADD_INT(command);
604 
605  // add the id of the guy sending the order
606  ADD_SHORT(source->player_id);
607 
608  // net signature
609  ADD_USHORT(net_sig);
610 
611  // targeted subsytem (or -1 if none)
612  s_val = (char)subsys_type;
613  ADD_DATA(s_val);
614 
615  // send to the player
616  multi_io_send_reliable(target, data, packet_size);
617 }
618 
619 // evaluate if a wing SQUADMATE MESSAGE command should be sent to a player
620 // return 0 if at least one ai ship got the order, 1 if only players
621 int multi_msg_eval_wing_squadmsg(int wingnum,int command,ai_info *aif, int player_num)
622 {
623  int idx;
624  ushort net_sig;
625  int subsys_type;
626  int sent_count;
627 
628  // get the index of the sender
629  if(player_num == -1)
630  player_num = MY_NET_PLAYER_NUM;
631 
632  // get the target information
633  if(aif->target_objnum == -1){
634  net_sig = 0;
635  } else {
636  net_sig = Objects[aif->target_objnum].net_signature;
637  }
638  subsys_type = -1;
639  if((aif->targeted_subsys == NULL) || (aif->targeted_subsys->system_info == NULL)){
640  subsys_type = -1;
641  } else {
642  subsys_type = aif->targeted_subsys->system_info->type;
643  }
644 
645  // go through all netplayers and find all matched
646  sent_count = Wings[wingnum].current_count;
647  for(idx=0;idx<MAX_PLAYERS;idx++){
649  // if he is in the wing, send him the message
650  if(multi_msg_player_in_wing(wingnum,&Net_players[idx])){
651  // if this was the sender himself, just decrement the count
652  if(idx == player_num){
653  sent_count--;
654  continue;
655  }
656 
657  // if its me, just display locally
658  if(&Net_players[idx] == Net_player){
659  multi_msg_show_squadmsg(&Net_players[player_num],command,net_sig,subsys_type);
660  sent_count--;
661  }
662  // otherwise send it to who is supposed to get it
663  else {
664  multi_msg_send_squadmsg_packet(&Net_players[idx],&Net_players[player_num],command,net_sig,subsys_type);
665  sent_count--;
666  }
667  }
668  }
669  }
670 
671  // if all the ships which got the message were players, return 1
672  return !sent_count;
673 }
674 
675 // evaluate if a ship SQUADMATE MESSAGE command should be sent to a player
676 // return 0 if not sent to a netplayer, 1 if it was
677 int multi_msg_eval_ship_squadmsg(int shipnum,int command,ai_info *aif, int player_num)
678 {
679  int idx;
680  ushort net_sig;
681  int subsys_type;
682 
683  // get the index of the sender
684  if ( player_num == -1 )
685  player_num = MY_NET_PLAYER_NUM;
686 
687  // get the target information
688  if(aif->target_objnum == -1){
689  net_sig = 0;
690  } else {
691  net_sig = Objects[aif->target_objnum].net_signature;
692  }
693  subsys_type = -1;
694  if((aif->targeted_subsys == NULL) || (aif->targeted_subsys->system_info == NULL)){
695  subsys_type = -1;
696  } else {
697  subsys_type = aif->targeted_subsys->system_info->type;
698  }
699 
700  // go through all netplayers and find all matched
701  for(idx=0;idx<MAX_PLAYERS;idx++){
702  if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(Net_players[idx]) && (idx != player_num)){
703  // if he is in the ship, send him the message
704  if(multi_msg_player_in_ship(shipnum,&Net_players[idx])){
705  // if its me, just display locall
706  if(&Net_players[idx] == Net_player){
707  multi_msg_show_squadmsg(&Net_players[player_num],command,net_sig,subsys_type);
708 
709  return 1;
710  }
711  // otherwise send it to who is supposed to get it
712  else {
713  multi_msg_send_squadmsg_packet(&Net_players[idx],&Net_players[player_num],command,net_sig,subsys_type);
714  return 1;
715  }
716  }
717  }
718  }
719 
720  // this will let the messaging system show a response to the sender of the packet
721  return 0;
722 }
723 
724 // process incoming squadmate messaging info
725 void multi_msg_process_squadmsg_packet(unsigned char *data, header *hinfo)
726 {
727  int command;
728  ushort net_sig;
729  short source_id;
730  int source_index;
731  char s_val;
732  int offset = HEADER_LENGTH;
733 
734  // get all packet data
735  GET_INT(command);
736  GET_SHORT(source_id);
737  GET_USHORT(net_sig);
738  GET_DATA(s_val);
739  PACKET_SET_SIZE();
740 
741  // determine who the order is from
742  source_index = find_player_id(source_id);
743  if(source_index == -1){
744  nprintf(("Network","Received squadmsg order packet from unknown player!!\n"));
745  return;
746  }
747 
748  // display the squadmessage somehow
749  multi_msg_show_squadmsg(&Net_players[source_index],command,net_sig,(int)s_val);
750 }
#define KEY_LCTRL
Definition: key.h:140
int timestamp(int delta_ms)
Definition: timer.cpp:226
wing Wings[MAX_WINGS]
Definition: ship.cpp:128
#define MY_NET_PLAYER_NUM
Definition: multi.h:127
#define GET_DATA(d)
Definition: multimsgs.h:47
model_subsystem * system_info
Definition: ship.h:314
ai_info * Player_ai
Definition: ai.cpp:24
int multi_msg_matches_expr(net_player *np, const char *expr)
Definition: multi_pmsg.cpp:318
int flags
Definition: player.h:104
void multi_msg_key_down(int mode)
Definition: multi_pmsg.cpp:89
#define PROTECT_TARGET_ITEM
Definition: hudsquadmsg.h:41
#define MULTI_MSG_FRIENDLY
Definition: multi_pmsg.h:28
net_player * Net_player
Definition: multi.cpp:94
SCP_vector< game_snd > Snds
Definition: gamesnd.cpp:19
#define PACKET_SET_SIZE()
Definition: multimsgs.h:57
player * m_player
Definition: multi.h:459
int Multi_msg_text_enter
Definition: multi_pmsg.cpp:59
#define ADD_DATA(d)
Definition: multimsgs.h:37
#define MULTI_STANDALONE(np)
Definition: multi.h:139
Assert(pm!=NULL)
int target_objnum
Definition: ai.h:339
ushort net_signature
Definition: object.h:163
void multi_msg_display_mission_text(const char *msg, int player_index)
Definition: multi_pmsg.cpp:302
#define MULTI_MSG_KEYDOWN_WAIT
Definition: multi_pmsg.cpp:38
void multi_msg_eval_text_msg()
Definition: multi_pmsg.cpp:169
#define KEY_LSHIFT
Definition: key.h:134
void multi_io_send_reliable(net_player *pl, ubyte *data, int len)
Definition: multimsgs.cpp:459
int find_player_id(short player_id)
Definition: multiutil.cpp:465
#define SQUADMSG_PLAYER
Definition: multi.h:236
#define COVER_ME_ITEM
Definition: hudsquadmsg.h:44
ship_subsys * targeted_subsys
Definition: ai.h:472
GLenum mode
Definition: Glext.h:5794
void key_flush()
Definition: key.cpp:356
Definition: ai.h:329
#define Int3()
Definition: pstypes.h:292
void HUD_sourced_printf(int source, const char *format,...)
Definition: hudmessage.cpp:571
int key_to_ascii(int keycode)
Definition: key.cpp:336
int packet_size
Definition: multi_sexp.cpp:41
void multi_msg_text_flush()
Definition: multi_pmsg.cpp:329
char callsign[CALLSIGN_LEN+1]
Definition: player.h:91
#define MULTI_MSG_CMD_KICK
Definition: multi_pmsg.cpp:69
int multi_msg_eval_wing_squadmsg(int wingnum, int command, ai_info *aif, int player_num)
Definition: multi_pmsg.cpp:621
#define MULTI_MSG_NONE
Definition: multi_pmsg.h:26
#define MULTI_MSG_MAX_LEN
Definition: multi_pmsg.cpp:44
#define ADD_INT(d)
Definition: multimsgs.h:40
#define DISARM_TARGET_ITEM
Definition: hudsquadmsg.h:40
#define IGNORE_TARGET_ITEM
Definition: hudsquadmsg.h:42
int instance
Definition: object.h:150
#define ATTACK_TARGET_ITEM
Definition: hudsquadmsg.h:38
GLintptr offset
Definition: Glext.h:5497
void multi_kick_player(int player_index, int ban, int reason)
Definition: multi_kick.cpp:82
#define ENGAGE_ENEMY_ITEM
Definition: hudsquadmsg.h:45
void multi_msg_send_squadmsg_packet(net_player *target, net_player *source, int command, ushort net_sig, int subsys_type)
Definition: multi_pmsg.cpp:587
#define nprintf(args)
Definition: pstypes.h:239
#define BUILD_HEADER(t)
Definition: multimsgs.h:36
void send_game_chat_packet(net_player *from, const char *msg, int msg_mode, net_player *to, const char *expr, int server_msg)
Definition: multimsgs.cpp:615
void multi_msg_show_squadmsg(net_player *source, int command, ushort target_sig, int subsys_type)
Definition: multi_pmsg.cpp:445
#define KEY_SHIFTED
Definition: key.h:62
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
#define KEY_ENTER
Definition: key.h:125
char * Multi_msg_subsys_name[SUBSYSTEM_MAX]
Definition: multi_pmsg.cpp:428
#define KEY_RCTRL
Definition: key.h:141
int snd_play(game_snd *gs, float pan, float vol_scale, int priority, bool is_voice_msg)
Definition: sound.cpp:517
#define DISABLE_TARGET_ITEM
Definition: hudsquadmsg.h:39
#define MAX_PLAYERS
Definition: pstypes.h:32
short player_id
Definition: multi.h:460
int current_count
Definition: ship.h:1530
#define ADD_SHORT(d)
Definition: multimsgs.h:38
#define KEY_RALT
Definition: key.h:138
#define MULTI_MSG_CMD_COUNT
Definition: multi_pmsg.cpp:68
#define KEY_BACKSP
Definition: key.h:126
void fsspeech_play(int type, const char *text)
Definition: fsspeech.h:44
int multi_msg_eval_ship_squadmsg(int shipnum, int command, ai_info *aif, int player_num)
Definition: multi_pmsg.cpp:677
int idx
Definition: multiui.cpp:761
#define MULTI_MSG_TEXT_SOUND
Definition: multi_pmsg.cpp:41
int multi_find_player_by_callsign(const char *callsign)
Definition: multiutil.cpp:1291
int multi_msg_check_command(char *str)
Definition: multi_pmsg.cpp:347
object Objects[MAX_OBJECTS]
Definition: object.cpp:62
unsigned char ubyte
Definition: pstypes.h:62
#define MULTI_MSG_ALL
Definition: multi_pmsg.h:27
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
int objnum
Definition: player.h:124
#define MULTI_MSG_HOSTILE
Definition: multi_pmsg.h:29
#define NOX(s)
Definition: pstypes.h:473
#define OBJ_SHIP
Definition: object.h:32
int Multi_msg_eat_stamp
Definition: multi_pmsg.cpp:56
#define ADD_USHORT(d)
Definition: multimsgs.h:39
int multi_msg_voice_record()
Definition: multi_pmsg.cpp:119
ship Ships[MAX_SHIPS]
Definition: ship.cpp:122
int Multi_msg_repeat_flag
Definition: multi_pmsg.cpp:53
GLfloat param
Definition: Glext.h:5373
void multi_msg_process_squadmsg_packet(unsigned char *data, header *hinfo)
Definition: multi_pmsg.cpp:725
int multi_msg_player_in_ship(int shipnum, net_player *pl)
Definition: multi_pmsg.cpp:575
int multi_msg_player_in_wing(int wingnum, net_player *pl)
Definition: multi_pmsg.cpp:554
#define MULTI_MSG_EXPR
Definition: multi_pmsg.h:31
#define strcat_s(...)
Definition: safe_strings.h:68
#define KEY_ESC
Definition: key.h:124
#define MULTI_MSG_MAX_TEXT_LEN
Definition: multi_pmsg.h:34
#define MULTI_CONNECTED(np)
Definition: multi.h:136
player * Player
#define GET_USHORT(d)
Definition: multimsgs.h:49
GLenum target
Definition: Glext.h:6872
Definition: multi.h:385
unsigned short ushort
Definition: pstypes.h:63
int HEADER_LENGTH
Definition: multi.cpp:106
int multi_msg_text_process(int k)
Definition: multi_pmsg.cpp:207
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
#define KEY_LALT
Definition: key.h:137
#define timestamp_elapsed(stamp)
Definition: timer.h:102
char * Multi_msg_commands[MULTI_MSG_CMD_COUNT]
Definition: multi_pmsg.cpp:72
char Multi_msg_text[MULTI_MSG_MAX_TEXT_LEN+1]
Definition: multi_pmsg.cpp:60
#define MULTI_MSG_TARGET
Definition: multi_pmsg.h:30
object * multi_get_network_object(ushort net_signature)
Definition: multiutil.cpp:220
void drop_leading_white_space(char *str)
Definition: parselo.cpp:115
int Multi_msg_stamp
Definition: multi_pmsg.cpp:50
GLsizei GLsizei GLchar * source
Definition: Glext.h:5625
#define GET_SHORT(d)
Definition: multimsgs.h:48
void HUD_printf(const char *format,...)
Definition: hudmessage.cpp:527
#define GET_INT(d)
Definition: multimsgs.h:50
#define DISABLE_SUBSYSTEM_ITEM
Definition: hudsquadmsg.h:59
void multi_msg_perform_command(int command, char *param)
Definition: multi_pmsg.cpp:407
#define SUBSYSTEM_MAX
Definition: model.h:64
#define FORMATION_ITEM
Definition: hudsquadmsg.h:43
char type
Definition: object.h:146
int multi_msg_message_text(char *txt)
Definition: multi_pmsg.cpp:264
int multi_find_player_by_object(object *objp)
Definition: multiutil.cpp:500
void control_config_clear_used_status()
#define HUD_SOURCE_NETPLAYER
Definition: hudmessage.h:28
net_player Net_players[MAX_PLAYERS]
Definition: multi.cpp:93
int multi_msg_text_mode()
Definition: multi_pmsg.cpp:163
#define PLAYER_FLAGS_MSG_MODE
Definition: player.h:37
#define stricmp(s1, s2)
Definition: config.h:271
void multi_msg_process()
Definition: multi_pmsg.cpp:125
char ship_name[NAME_LENGTH]
Definition: ship.h:604
int multi_msg_mode()
Definition: multi_pmsg.cpp:157
#define strcpy_s(...)
Definition: safe_strings.h:67
#define KEY_RSHIFT
Definition: key.h:135
int Multi_msg_mode
Definition: multi_pmsg.cpp:47