SESSION.H 28 KB

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