SESSION.H 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: /counterstrike/SESSION.H 4 3/10/97 6:23p Steve_tall $ */
  19. /***************************************************************************
  20. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  21. * *
  22. * Project Name : Command & Conquer *
  23. * *
  24. * File Name : SESSION.H *
  25. * *
  26. * Programmer : Bill R. Randolph *
  27. * *
  28. * Start Date : 11/30/95 *
  29. * *
  30. * Last Update : November 30, 1995 [BRR] *
  31. * *
  32. * The purpose of this class is to contain those variables & routines *
  33. * specifically related to a multiplayer game. *
  34. * *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef SESSION_H
  37. #define SESSION_H
  38. #include "ipxaddr.h"
  39. #include "msglist.h"
  40. #include "connect.h"
  41. //---------------------------------------------------------------------------
  42. // Forward declarations
  43. //---------------------------------------------------------------------------
  44. class AircraftClass;
  45. class AnimClass;
  46. class BuildingClass;
  47. class BulletClass;
  48. class InfantryClass;
  49. class UnitClass;
  50. class PhoneEntryClass;
  51. class CellClass;
  52. //---------------------------------------------------------------------------
  53. // Defines
  54. //---------------------------------------------------------------------------
  55. //...........................................................................
  56. // Various limiting values
  57. //...........................................................................
  58. #define MPLAYER_BUILD_LEVEL_MAX 10 // max build level in multiplay
  59. #define MAX_MPLAYER_COLORS 8 // max # of colors
  60. //...........................................................................
  61. // Max sizes of packets we want to send
  62. // The IPX packet's size is IPX's max size (546), rounded down to accommodate
  63. // the max number of events possible.
  64. //...........................................................................
  65. #define MAX_IPX_PACKET_SIZE (((546 - sizeof(CommHeaderType)) / \
  66. sizeof(EventClass) ) * sizeof(EventClass))
  67. #define MAX_SERIAL_PACKET_SIZE 256
  68. //...........................................................................
  69. // Max length of player names fields; attempt to use the constant for the
  70. // HouseClass, if it's been defined; otherwise, define it myself.
  71. //...........................................................................
  72. #ifdef HOUSE_NAME_MAX
  73. #define MPLAYER_NAME_MAX HOUSE_NAME_MAX
  74. #else
  75. #define MPLAYER_NAME_MAX 12 // max length of a player's name
  76. #endif
  77. //...........................................................................
  78. // Values to control the multiplayer score screen
  79. //...........................................................................
  80. #define MAX_MULTI_NAMES 8 // max # names (rows) on the score screen
  81. #define MAX_MULTI_GAMES 4 // max # games (columns) on the score screen
  82. //...........................................................................
  83. // Min value for MaxAhead, for both net & modem; only applies for
  84. // COMM_PROTOCOL_MULTI_E_COMP.
  85. //...........................................................................
  86. #define MODEM_MIN_MAX_AHEAD 5
  87. #define NETWORK_MIN_MAX_AHEAD 2
  88. //...........................................................................
  89. // Send period (in frames) for COMM_PROTOCOL_MULTI_E_COMP and above
  90. //...........................................................................
  91. #define DEFAULT_FRAME_SEND_RATE 3
  92. //...........................................................................
  93. // Modem-specific constants
  94. //...........................................................................
  95. #define PORTBUF_MAX 64 // dialog field sizes
  96. #define IRQBUF_MAX 3
  97. #define BAUDBUF_MAX 7
  98. #define INITSTRBUF_MAX 41
  99. #define CWAITSTRBUF_MAX 16
  100. #define CREDITSBUF_MAX 5
  101. #define PACKET_TIMING_TIMEOUT 40 // ticks b/w sending a timing packet
  102. #define MODEM_NAME_MAX PORTBUF_MAX - 1 // Max length of modem name in list box
  103. //---------------------------------------------------------------------------
  104. // Enums
  105. //---------------------------------------------------------------------------
  106. //...........................................................................
  107. // Types of games; used to tell which protocol we're using
  108. //...........................................................................
  109. typedef enum GameEnum {
  110. GAME_NORMAL, // not multiplayer
  111. GAME_MODEM, // modem game
  112. GAME_NULL_MODEM, // NULL-modem
  113. GAME_IPX, // IPX Network game
  114. GAME_INTERNET, // Internet H2H
  115. GAME_SKIRMISH, // 1 plr vs. AI's
  116. GAME_TEN, // TEN Network game
  117. GAME_MPATH // MPath Network game
  118. } GameType;
  119. //...........................................................................
  120. // Various Modem-specific enums
  121. //...........................................................................
  122. typedef enum DetectPortType {
  123. PORT_VALID = 0,
  124. PORT_INVALID,
  125. PORT_IRQ_INUSE
  126. } DetectPortType;
  127. typedef enum DialStatusType {
  128. DIAL_CONNECTED = 0,
  129. DIAL_NO_CARRIER,
  130. DIAL_BUSY,
  131. DIAL_ERROR,
  132. DIAL_NO_DIAL_TONE,
  133. DIAL_CANCELED
  134. } DialStatusType;
  135. typedef enum DialMethodType {
  136. DIAL_TOUCH_TONE = 0,
  137. DIAL_PULSE,
  138. DIAL_METHODS
  139. } DialMethodType;
  140. typedef enum CallWaitStringType {
  141. CALL_WAIT_TONE_1 = 0,
  142. CALL_WAIT_TONE_2,
  143. CALL_WAIT_PULSE,
  144. CALL_WAIT_CUSTOM,
  145. CALL_WAIT_STRINGS_NUM
  146. } CallWaitStringType;
  147. typedef enum ModemGameType {
  148. MODEM_NULL_HOST = 0,
  149. MODEM_NULL_JOIN,
  150. MODEM_DIALER,
  151. MODEM_ANSWERER
  152. } ModemGameType;
  153. //...........................................................................
  154. // Commands sent over the serial Global Channel
  155. //...........................................................................
  156. typedef enum SerialCommandType {
  157. SERIAL_CONNECT = 100, // Are you there? Hello? McFly?
  158. SERIAL_GAME_OPTIONS = 101, // Hey, dudes, here's some new game options
  159. SERIAL_SIGN_OFF = 102, // Bogus, dudes, my boss is coming; I'm outta here!
  160. SERIAL_GO = 103, // OK, dudes, jump into the game loop!
  161. SERIAL_MESSAGE = 104, // Here's a message
  162. SERIAL_TIMING = 105, // timimg packet
  163. SERIAL_SCORE_SCREEN = 106, // player at score screen
  164. SERIAL_LOADGAME = 107, // Start the game, loading a saved game first
  165. SERIAL_LAST_COMMAND, // last command
  166. SERIAL_REQ_SCENARIO = 1000, // Reqest that host sends the scenario file to the other players.
  167. SERIAL_FILE_INFO = 1001, // Info about the file that is going to be transferred
  168. SERIAL_FILE_CHUNK = 1002, // A chunk of scenario
  169. SERIAL_READY_TO_GO = 1003, // Sent in response to a 'GO' command
  170. SERIAL_NO_SCENARIO = 1004 // Scenario isnt available on remote machine so we cant play
  171. } SerialCommandType;
  172. //...........................................................................
  173. // Commands sent over the network Global Channel
  174. //...........................................................................
  175. typedef enum NetCommandType {
  176. NET_QUERY_GAME, // Hey, what games are out there?
  177. NET_ANSWER_GAME, // Yo, Here's my game's name!
  178. NET_QUERY_PLAYER, // Hey, what players are in this game?
  179. NET_ANSWER_PLAYER, // Yo, I'm in that game!
  180. NET_CHAT_ANNOUNCE, // I'm at the chat screen
  181. NET_CHAT_REQUEST, // Respond with a CHAT_ANNOUNCE, please.
  182. NET_QUERY_JOIN, // Hey guys, can I play too?
  183. NET_CONFIRM_JOIN, // Well, OK, if you really want to.
  184. NET_REJECT_JOIN, // No, you can't join; sorry, dude.
  185. NET_GAME_OPTIONS, // Hey, dudes, here's some new game options
  186. NET_SIGN_OFF, // Bogus, dudes, my boss is coming; I'm outta here!
  187. NET_GO, // OK, jump into the game loop!
  188. NET_MESSAGE, // Here's a message
  189. NET_PING, // I'm pinging you to take a time measurement
  190. NET_LOADGAME, // start a game by loading a saved game
  191. NET_REQ_SCENARIO =1000,// Reqest that host sends the scenario file to the other players.
  192. NET_FILE_INFO =1001,// Info about the file that is going to be transferred
  193. NET_FILE_CHUNK =1002,// A chunk of scenario
  194. NET_READY_TO_GO =1003,// Sent in response to a 'GO' command
  195. NET_NO_SCENARIO =1004 // Scenario isnt available on remote machine so we cant play
  196. } NetCommandType;
  197. //---------------------------------------------------------------------------
  198. // Structures
  199. //---------------------------------------------------------------------------
  200. //...........................................................................
  201. // An entry on the score screen is defined by this structure
  202. //...........................................................................
  203. typedef struct {
  204. char Name[MPLAYER_NAME_MAX];
  205. int Wins;
  206. int Kills[MAX_MULTI_GAMES];
  207. PlayerColorType Color;
  208. } MPlayerScoreType;
  209. //...........................................................................
  210. // Settings for the serial port
  211. //...........................................................................
  212. typedef struct {
  213. int Port;
  214. int IRQ;
  215. int Baud;
  216. DialMethodType DialMethod;
  217. int InitStringIndex;
  218. int CallWaitStringIndex;
  219. char CallWaitString[ CWAITSTRBUF_MAX ];
  220. bool Compression;
  221. bool ErrorCorrection;
  222. bool HardwareFlowControl;
  223. char ModemName [ MODEM_NAME_MAX ];
  224. } SerialSettingsType;
  225. //...........................................................................
  226. // This is a "node", used for the lists of available games & players. The
  227. // 'Game' structure is used for games; the 'Player' structure for players.
  228. //...........................................................................
  229. typedef struct NodeNameTag {
  230. char Name[MPLAYER_NAME_MAX]; // player or game name
  231. IPXAddressClass Address;
  232. #if(TEN)
  233. int TenAddress;
  234. #endif
  235. #if(MPATH)
  236. int MPathAddress;
  237. #endif
  238. union {
  239. struct {
  240. unsigned char IsOpen; // is the game open?
  241. unsigned long LastTime; // last time we heard from this guy
  242. } Game;
  243. struct {
  244. HousesType House; // "ActLike" House of this player
  245. PlayerColorType Color; // Color of this player
  246. HousesType ID; // Actual House of this player
  247. int ProcessTime; // Length of time to process players main loop
  248. } Player;
  249. struct {
  250. unsigned long LastTime; // last time we heard from this guy
  251. unsigned char LastChance; // we're about to remove him from the list
  252. PlayerColorType Color; // chat player's color
  253. } Chat;
  254. };
  255. } NodeNameType;
  256. //...........................................................................
  257. // Packet sent over the serial Global Channel
  258. //...........................................................................
  259. typedef struct {
  260. SerialCommandType Command; // One of the enum's defined above
  261. char Name[MPLAYER_NAME_MAX]; // Player or Game Name
  262. unsigned char ID; // unique ID of sender of message
  263. union {
  264. struct {
  265. HousesType House; // player's House
  266. PlayerColorType Color; // player's color or SIGNOFF ID
  267. unsigned long MinVersion; // min version this game supports
  268. unsigned long MaxVersion; // max version this game supports
  269. char Scenario[DESCRIP_MAX]; // Scenario name
  270. unsigned int Credits; // player's credits
  271. unsigned int IsBases : 1; // 1 = bases are allowed
  272. unsigned int IsTiberium : 1; // 1 = tiberium is allowed
  273. unsigned int IsGoodies : 1; // 1 = goodies are allowed
  274. unsigned int IsGhosties : 1; // 1 = ghosts are allowed
  275. unsigned int OfficialScenario : 1; // Is this scenario an official Westwood one?
  276. int CheatCheck; // Unique ID of "rules.ini" file.
  277. unsigned char BuildLevel; // buildable level
  278. unsigned char UnitCount; // max # units
  279. unsigned char AIPlayers; // # of AI players allowed
  280. int Seed; // random number seed
  281. SpecialClass Special; // command-line options
  282. unsigned int GameSpeed; // Game Speed
  283. unsigned long ResponseTime; // packet response time
  284. unsigned int FileLength; // Length of scenario file to expect from host.
  285. #ifdef WOLAPI_INTEGRATION
  286. char ShortFileName[13]; // Name of scenario file to expect from host
  287. #else
  288. char ShortFileName[12]; // Name of scenario file to expect from host
  289. #endif
  290. unsigned char FileDigest[32]; // Digest of scenario file to expect from host
  291. // ajw - This is not necessarily null-terminated.
  292. } ScenarioInfo;
  293. struct {
  294. char Message[MAX_MESSAGE_LENGTH]; // inter-player message
  295. PlayerColorType Color; // player's color or SIGNOFF ID
  296. } Message;
  297. struct {
  298. PlayerColorType Color; // player's color or SIGNOFF ID
  299. } Chat;
  300. };
  301. } SerialPacketType;
  302. //...........................................................................
  303. // Other packet sent over the serial global channel (for file transfers)
  304. //...........................................................................
  305. #define MAX_SEND_FILE_PACKET_SIZE MAX_SERIAL_PACKET_SIZE - 64
  306. typedef struct {
  307. SerialCommandType Command; // Enum defined above. Should be a file transfer enum.
  308. unsigned short BlockNumber; // Index position of this file chunk in the file
  309. unsigned short BlockLength; // Length of data in the RawData buffer
  310. unsigned char RawData [MAX_SEND_FILE_PACKET_SIZE];
  311. } RemoteFileTransferType;
  312. //...........................................................................
  313. // Packet sent over the network Global Channel
  314. //...........................................................................
  315. typedef struct GlobalPacketType {
  316. NetCommandType Command; // One of the enum's defined above
  317. char Name[MPLAYER_NAME_MAX]; // Player or Game Name
  318. union {
  319. struct {
  320. unsigned int IsOpen : 1; // 1 = game is open for joining
  321. } GameInfo;
  322. struct {
  323. HousesType House; // player's House
  324. PlayerColorType Color; // player's color
  325. unsigned long NameCRC; // CRC of player's game's name
  326. unsigned long MinVersion; // game's min supported version
  327. unsigned long MaxVersion; // game's max supported version
  328. int CheatCheck; // Unique ID of "rules.ini" file.
  329. } PlayerInfo;
  330. struct {
  331. char Scenario[DESCRIP_MAX]; // Scenario Name
  332. unsigned int Credits; // player's credits
  333. unsigned int IsBases : 1; // 1 = bases are allowed
  334. unsigned int IsTiberium : 1; // 1 = tiberium is allowed
  335. unsigned int IsGoodies : 1; // 1 = goodies are allowed
  336. unsigned int IsGhosties : 1; // 1 = ghosts are allowed
  337. unsigned int OfficialScenario :1;// Is this scenario an official Westwood one?
  338. unsigned char BuildLevel; // buildable level
  339. unsigned char UnitCount; // max # units
  340. unsigned char AIPlayers; // # of AI players allowed
  341. int Seed; // random number seed
  342. SpecialClass Special; // command-line options
  343. unsigned int GameSpeed; // Game Speed
  344. unsigned long Version; // version # common to all players
  345. unsigned int FileLength; // Length of scenario file to expect from host.
  346. #ifdef WOLAPI_INTEGRATION
  347. char ShortFileName[13]; // Name of scenario file to expect from host
  348. #else
  349. char ShortFileName[12]; // Name of scenario file to expect from host
  350. #endif
  351. unsigned char FileDigest[32]; // Digest of scenario file to expect from host
  352. // ajw - This is not necessarily null-terminated.
  353. } ScenarioInfo;
  354. struct {
  355. char Buf[MAX_MESSAGE_LENGTH]; // inter-user message
  356. PlayerColorType Color; // color of sender of message
  357. unsigned long NameCRC; // CRC of sender's Game Name
  358. } Message;
  359. struct {
  360. int OneWay; // one-way response time
  361. } ResponseTime;
  362. struct {
  363. int Why; // why were we rejected from the game?
  364. } Reject;
  365. struct {
  366. unsigned long ID; // unique ID for this chat node
  367. PlayerColorType Color; // my color
  368. } Chat;
  369. };
  370. } GlobalPacketType;
  371. //...........................................................................
  372. // For finding sync bugs; filled in by the engine when certain conditions
  373. // are met; the pointers allow examination of objects in the debugger.
  374. //...........................................................................
  375. typedef struct {
  376. union {
  377. AircraftClass *Aircraft;
  378. AnimClass *Anim;
  379. BuildingClass *Building;
  380. BulletClass *Bullet;
  381. InfantryClass *Infantry;
  382. UnitClass *Unit;
  383. void *All;
  384. } Ptr;
  385. } TrapObjectType;
  386. /*
  387. ** This is the identifier for a multiplayer mission. This can be used to
  388. ** identify the filename of the mission as well as display the mission in a
  389. ** mission selection list.
  390. */
  391. class MultiMission
  392. {
  393. public:
  394. MultiMission(char const * filename = NULL, char const * description = NULL, char const *digest = NULL, bool official = true, bool expansion = false);
  395. void Set_Description(char const * description);
  396. void Set_Filename(char const * filename);
  397. void Set_Digest(char const * digest);
  398. void Set_Official(bool official);
  399. void Set_Expansion(bool expansion);
  400. void Draw_It(int index, int x, int y, int width, int height, bool selected, TextPrintType flags) const;
  401. char const * Description(void) const {return(ScenarioDescription);}
  402. char const * Get_Filename(void) const {return(Filename);}
  403. char const * Get_Digest(void) const {return(Digest);}
  404. bool Get_Official(void) { return (IsOfficial); }
  405. bool Get_Expansion(void) { return (IsExpansion); } // Implied "IsCounterstrike". No longer used. -ajw
  406. private:
  407. char ScenarioDescription[DESCRIP_MAX];
  408. char Filename[_MAX_FNAME+_MAX_EXT];
  409. char Digest[32];
  410. bool IsOfficial;
  411. bool IsExpansion;
  412. };
  413. typedef struct {
  414. int ScenarioIndex; //Used on host machine only as index into scenario list
  415. int Bases;
  416. int Credits;
  417. int Tiberium;
  418. int Goodies;
  419. int Ghosts;
  420. int UnitCount;
  421. int AIPlayers; // # of AI players allowed to be built
  422. char ScenarioDescription [DESCRIP_MAX]; //Used on client machines only
  423. } GameOptionsType;
  424. //---------------------------------------------------------------------------
  425. // Class Definition
  426. //---------------------------------------------------------------------------
  427. class SessionClass
  428. {
  429. //------------------------------------------------------------------------
  430. // Public interface
  431. //------------------------------------------------------------------------
  432. public:
  433. //.....................................................................
  434. // Constructor/Destructor
  435. //.....................................................................
  436. SessionClass(void);
  437. ~SessionClass(void);
  438. //.....................................................................
  439. // Initialization
  440. //.....................................................................
  441. void One_Time(void);
  442. void Init(void);
  443. //.....................................................................
  444. // Reads/writes to the INI file
  445. //.....................................................................
  446. void Read_MultiPlayer_Settings (void);
  447. void Write_MultiPlayer_Settings (void);
  448. void Read_Scenario_Descriptions (void);
  449. void Free_Scenario_Descriptions(void);
  450. //.....................................................................
  451. // Utility functions
  452. //.....................................................................
  453. int Create_Connections(void);
  454. bool Am_I_Master(void);
  455. unsigned long Compute_Unique_ID(void);
  456. #if(TEN)
  457. int Create_TEN_Connections(void);
  458. #endif // TEN
  459. #if(MPATH)
  460. int Create_MPATH_Connections(void);
  461. #endif // MPATH
  462. //.....................................................................
  463. // File I/O
  464. //.....................................................................
  465. int Save(Pipe & file) const;
  466. int Load(Straw & file);
  467. int Save(CCFileClass & file);
  468. int Load(CCFileClass & file);
  469. //.....................................................................
  470. // Debugging / Sync Bugs
  471. //.....................................................................
  472. void Trap_Object(void);
  473. //---------------------------------------------------------------------
  474. // Public Data
  475. //---------------------------------------------------------------------
  476. //.....................................................................
  477. // The type of session being played
  478. //.....................................................................
  479. GameType Type;
  480. //.....................................................................
  481. // The current communications protocol
  482. //.....................................................................
  483. CommProtocolType CommProtocol;
  484. //.....................................................................
  485. // Game options
  486. //.....................................................................
  487. GameOptionsType Options;
  488. //.....................................................................
  489. // Unique workstation ID, for detecting my own packets
  490. //.....................................................................
  491. unsigned long UniqueID;
  492. //.....................................................................
  493. // Player's local options
  494. //.....................................................................
  495. char Handle[MPLAYER_NAME_MAX]; // player name
  496. PlayerColorType PrefColor; // preferred color index
  497. PlayerColorType ColorIdx; // actual color index
  498. HousesType House; // GDI / NOD
  499. int ObiWan; // 1 = player can see all
  500. int Solo; // 1 = player can play alone
  501. //.....................................................................
  502. // Max allowable # of players & actual # of (human) players
  503. //.....................................................................
  504. int MaxPlayers;
  505. int NumPlayers;
  506. //.....................................................................
  507. // Frame-sync'ing timing variables
  508. // 'MaxAhead' is the number of frames ahead of this one to execute
  509. // a given packet. It's set by the RESPONSE_TIME event.
  510. // 'FrameSendRate' is the # frames between data packets
  511. //.....................................................................
  512. unsigned long MaxAhead;
  513. unsigned long FrameSendRate;
  514. int DesiredFrameRate;
  515. int ProcessTimer;
  516. int ProcessTicks;
  517. int ProcessFrames;
  518. //.....................................................................
  519. // This flag is set when we've loaded a multiplayer game.
  520. //.....................................................................
  521. int LoadGame;
  522. //.....................................................................
  523. // This flag is set when the modem game saves the game due to a lost
  524. // connection.
  525. //.....................................................................
  526. int EmergencySave;
  527. //.....................................................................
  528. // List of scenarios & their file numbers
  529. //.....................................................................
  530. DynamicVectorClass<MultiMission *> Scenarios;
  531. // DynamicVectorClass <char *> Scenarios;
  532. // DynamicVectorClass <int> Filenum;
  533. char ScenarioFileName[_MAX_FNAME+_MAX_EXT+1]; //File name of scenario to load
  534. char ScenarioDigest [32]; //Digest of scenario to load
  535. unsigned int ScenarioFileLength;
  536. bool ScenarioIsOfficial;
  537. char ScenarioRequests[20]; //Which players requested scenario files
  538. int RequestCount;
  539. IPXAddressClass HostAddress;
  540. //.....................................................................
  541. // This is the multiplayer messaging system
  542. //.....................................................................
  543. MessageListClass Messages;
  544. IPXAddressClass MessageAddress;
  545. char LastMessage[MAX_MESSAGE_LENGTH];
  546. unsigned WWChat : 1; // 1 = go into special WW Chat mode
  547. //.....................................................................
  548. // This is the multiplayer scorekeeping system
  549. //.....................................................................
  550. MPlayerScoreType Score[MAX_MULTI_NAMES];
  551. int GamesPlayed; // # games played this run
  552. int NumScores; // # active entries in MPlayerScore
  553. int Winner; // index of winner of last game
  554. int CurGame; // index of current game being played
  555. //.....................................................................
  556. // Static arrays
  557. //.....................................................................
  558. static char Descriptions[100][40];
  559. static int CountMin[2];
  560. static int CountMax[2];
  561. static char * GlobalPacketNames[];
  562. static char * SerialPacketNames[];
  563. //.....................................................................
  564. // For Recording & Playing back a file
  565. //.....................................................................
  566. CCFileClass RecordFile;
  567. unsigned Record : 1;
  568. unsigned Play : 1;
  569. unsigned Attract : 1;
  570. //.....................................................................
  571. // IPX-specific variables
  572. //.....................................................................
  573. int IsBridge; // 1 = we're crossing a bridge
  574. IPXAddressClass BridgeNet; // address of bridge
  575. bool NetStealth; // makes us invisible
  576. bool NetProtect; // keeps others from messaging us
  577. bool NetOpen; // 1 = game is open for joining
  578. char GameName[MPLAYER_NAME_MAX]; // game's name
  579. GlobalPacketType GPacket; // global packet
  580. int GPacketlen; // global packet length
  581. IPXAddressClass GAddress; // address of sender
  582. unsigned short GProductID; // product ID of sender
  583. char MetaPacket[MAX_IPX_PACKET_SIZE]; // packet building buffer
  584. int MetaSize; // size of MetaPacket
  585. DynamicVectorClass <NodeNameType *> Games; // list of games
  586. DynamicVectorClass <NodeNameType *> Players; // list of players
  587. DynamicVectorClass <NodeNameType *> Chat; // list of chat nodes
  588. //.....................................................................
  589. // Modem-specific variables
  590. //.....................................................................
  591. unsigned ModemService : 1; // 1 = service modem in Call_Back
  592. int CurPhoneIdx; // phone listing index
  593. SerialSettingsType SerialDefaults; // default serial settings
  594. ModemGameType ModemType; // caller or answerer?
  595. DynamicVectorClass<PhoneEntryClass *> PhoneBook;
  596. DynamicVectorClass <char *> InitStrings;
  597. static char * DialMethodCheck[ DIAL_METHODS ];
  598. static char * CallWaitStrings[ CALL_WAIT_STRINGS_NUM ];
  599. //.....................................................................
  600. // For finding Sync Bugs
  601. //.....................................................................
  602. long TrapFrame; // frame # to start trapping 'TrapObject'
  603. RTTIType TrapObjType; // type of object to trap
  604. TrapObjectType TrapObject; // ptr to object to trap (watch)
  605. COORDINATE TrapCoord; // coord of object, 0 = ignore
  606. TARGET TrapTarget; // Target # of object, 0 = ignore
  607. CellClass * TrapCell; // Ptr to cell to trap (watch)
  608. int TrapCheckHeap; // true = check the heap as of TrapFrame
  609. long TrapPrintCRC; // Frame # to print CRC state file
  610. #if(TEN)
  611. //
  612. // TEN-specific variables
  613. //
  614. char *TenPacket;
  615. int TenSize;
  616. int TenMessageAddress;
  617. int TenAddress;
  618. int TenPlayerID;
  619. char OptionsFile[256];
  620. int AllowSolo;
  621. int NetResponseTime;
  622. #endif // TEN
  623. #if(MPATH)
  624. //
  625. // MPATH-specific variables
  626. //
  627. char *MPathPacket;
  628. int MPathSize;
  629. int MPathMessageAddress;
  630. int MPathAddress;
  631. char OptionsFile[256];
  632. int AllowSolo;
  633. int NetResponseTime;
  634. #endif // MPATH
  635. };
  636. #endif // SESSION_H
  637. /*************************** end of session.h ******************************/