home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / games / CM / CyclingManagerDemoCangas.exe / CyclingManagerDemo / scripts / main.cnh < prev   
Text File  |  2001-07-18  |  7KB  |  325 lines

  1.  // func void PageInit()
  2. typedef func void TYPE_PageInit();
  3. var TYPE_PageInit PageInit;
  4.  
  5. // func void DialogInit()
  6. typedef func void TYPE_DialogInit();
  7. var TYPE_DialogInit DialogInit;
  8.  
  9. // func i32x manager (i32x _iComponentID, i32x _iEventID)
  10. typedef func i32x TYPE_manager (i32x _iComponentID, i32x _iEventID);
  11. var TYPE_manager manager;
  12.  
  13. //func void QuitGame_MessageBoxCallback(i32x _iResult)
  14. typedef func void TYPE_QuitGame_MessageBoxCallback(i32x _iResult);
  15. var TYPE_QuitGame_MessageBoxCallback QuitGame_MessageBoxCallback;
  16.  
  17. // func void main ()
  18. typedef func void TYPE_main ();
  19. var TYPE_main main;
  20.  
  21. // func void SetLanguage(i32x _iLanguage)
  22. typedef func void TYPE_SetLanguage(i32x _iLanguage);
  23. var TYPE_SetLanguage SetLanguage;
  24.  
  25. // func i32x GetLanguage()
  26. typedef func i32x TYPE_GetLanguage();
  27. var TYPE_GetLanguage GetLanguage;
  28.  
  29. // func void init ()
  30. typedef func void TYPE_init ();
  31. var TYPE_init init;
  32.  
  33. // func void vCreateLocalDatabaseJoins()
  34. typedef func void TYPE_vCreateLocalDatabaseJoins ();
  35. var TYPE_vCreateLocalDatabaseJoins vCreateLocalDatabaseJoins;
  36.  
  37. // func void vDestroyLocalDatabaseJoins()
  38. typedef func void TYPE_vDestroyLocalDatabaseJoins ();
  39. var TYPE_vDestroyLocalDatabaseJoins vDestroyLocalDatabaseJoins;
  40.  
  41. //func i32x Is3DDeviceInitProblem()
  42. typedef func i32x TYPE_Is3DDeviceInitProblem ();
  43. var TYPE_Is3DDeviceInitProblem Is3DDeviceInitProblem;
  44.  
  45. // ******************************
  46. // * structures
  47. // ******************************
  48.  
  49. // lobby config
  50. typedef struct stLobbyConfig
  51. {
  52.     szx            m_szIP;
  53.     i32x        m_iUserPort;
  54.     i32x        m_iGamePort;
  55.     Net_Client    m_oServer;
  56. } stLobbyConfig;
  57.  
  58. // MenuServer config
  59. typedef struct stGameConfig
  60. {
  61.     i32x m_iLogued;    ///< true if a game is launched false else
  62.     i32x m_iSinglePlayer;
  63.     i32x m_iInternet;
  64.     i32x m_iInternetServer;
  65.     i32x m_iNumConnections;
  66.     i32x m_iReady;            // Ready to launch race
  67.     i32x m_iGameOver;
  68.     
  69.  
  70.     // Game administrator login
  71.     szx    m_szAdminLogin;
  72.  
  73.     i32x m_iPhaseID;
  74.     // seem to be obsolete ()page training only)
  75.     i32x m_iStartingTime;
  76.     i32x m_iVirtualDay;            // Julian day
  77.  
  78.     i32x m_iMDay;                // Day of month
  79.     i32x m_iMonth;                // month
  80.     i32x m_iYear;                // season
  81.  
  82.     i32x m_iCalendarMode;        // Auto/manual
  83.     i32x m_iGameMode;            // Season/Tour/SingleRace
  84.     i32x m_iCurrentRaceID;        // current race ID
  85.     i32x m_iCurrentStageID;        // current stage ID
  86.     i32x m_iLastStageID;        // Last stage id raced by ms
  87. } stGameConfig;
  88.  
  89. // Menu server connection parameters
  90. typedef struct stConnection
  91. {
  92.     szx            m_szIP;
  93.     i32x        m_iPort;
  94.     Net_Client    m_oServer;
  95. } stConnection;
  96.  
  97. // inrace server status
  98. typedef struct stInRaceServer
  99. {
  100.     i32x    m_iCanStartRace;
  101.     szx        m_szRServerIP;    
  102.     i32x    m_iRServerPort;
  103.     szx        m_szResolServerPass;
  104. } stInRaceServer;
  105.  
  106. // user status
  107. typedef struct stUser
  108. {
  109.     // Login parameter
  110.     szx m_szLogin;
  111.     szx m_szPass;
  112.  
  113.     // Language
  114.     i32x m_iLanguage;
  115.  
  116.     // Mp3 Volume
  117.     f32x m_fMp3Volume;
  118.  
  119.     // gateway
  120.     szx m_szGatewayAuthorization;
  121.     
  122.     // Manager parameters
  123.     i32x m_iCurrentSlotId;    // Save slot id
  124.     i32x m_iUserMode;
  125.  
  126.     i32x m_iMyID;            // User ID
  127.     i32x m_iMyManagerID;    // Manager ID
  128.     i32x m_iMyTeamID;        // Team ID
  129.     i32x m_iMyInRaceTeamID;    // In Race teamID
  130. } stUser;
  131.  
  132. // database access
  133. typedef struct stMenuJoins
  134. {
  135.     i32x m_iCyclistTeamID;
  136.     i32x m_jCyclist_szLastName;
  137.     i32x m_jCyclist_szFirstName;
  138.  
  139.     i32x m_iTeamID;
  140.     i32x m_iTeamManagerID;
  141.     i32x m_iTeamName;
  142.     i32x m_iTeamAbrev;
  143.     i32x m_iTeam_iUserID;
  144.  
  145.     i32x m_iManager_iUserID;
  146.  
  147.     i32x m_jUser_iId;
  148.     i32x m_jUser_szLogin;
  149.     i32x m_jUser_szPseudo;
  150.     i32x m_jUser_iManager;
  151.     i32x m_jUser_szTeamAbrev;
  152.     i32x m_jUser_szTeamName;
  153.     i32x m_jUser_iConnected;
  154.     i32x m_jUser_iReady;
  155.     i32x m_jUser_iActive;
  156.     
  157.     i32x m_jGuest_iId;
  158.     i32x m_jGuest_szLogin;
  159.     i32x m_jGuest_iFree;
  160.  
  161.     i32x m_iStageTimeTrial;
  162.     i32x m_iStage_iProfileMshId;
  163.     i32x m_iStage_iSplineMshId;
  164.     i32x m_iStage_iNameId;
  165.     i32x m_iStage_iNumSprints;
  166.     i32x m_iStage_fLength;
  167.     i32x m_iStage_fSplineLength;
  168.     i32x m_iStage_fSplineStart;
  169.     
  170.     i32x m_iSprint_iId;
  171.     i32x m_iSprint_fPosition;
  172.     i32x m_iSprint_iStageId;
  173.     i32x m_iSprint_iType;
  174.     i32x m_iSprint_szName;
  175.  
  176.     i32x m_iMsh_szFilename;
  177.     i32x m_iMsh_iDirectoryId;
  178.  
  179.  
  180.     i32x m_iDirectory_szName;
  181.  
  182. } stMenuJoins;
  183.  
  184.  
  185. // database access
  186. typedef struct stGatewayJoins
  187. {
  188.     i32x m_iGame_szDescJoin;
  189.     i32x m_iGame_iID;
  190.     i32x iGameMode;
  191.     i32x szAdmin;
  192.     i32x iUserId;
  193.     i32x iUserName;
  194.     i32x iUserGameId;
  195.     i32x iNumConnected;
  196.     i32x bHasPassword;
  197.     i32x szIP;
  198.     i32x iPort;
  199.  
  200. } stGatewayJoins;
  201.  
  202. // local database access
  203. typedef struct stLocalJoins
  204. {
  205.     i32x m_iUser_szName;
  206.  
  207.     i32x m_iGameMenuString;
  208.     i32x m_iLocalizedString;
  209.     i32x m_iFormattedString;
  210.  
  211.     i32x m_iGateway_iId;
  212.     i32x m_iGateway_szIp;
  213.     i32x m_iGateway_iValid;
  214.  
  215.     i32x m_iSSlot_iId;
  216.     i32x m_iSSlot_iDate;
  217.     i32x m_iSSlot_iGameMode;
  218.     i32x m_iSSlot_iStageId;
  219.     i32x m_iSSlot_szDatabase;
  220.     i32x m_iSSlot_bFirstLaunch;
  221.     i32x m_iSSlot_bGameOver;
  222.  
  223.     i32x m_iMSlot_iId;
  224.     i32x m_iMSlot_iDate;
  225.     i32x m_iMSlot_iGameMode;
  226.     i32x m_iMSlot_iStageId;
  227.     i32x m_iMSlot_szDatabase;
  228.     i32x m_iMSlot_bFirstLaunch;
  229.     i32x m_iMSlot_szName;
  230.     i32x m_iMSlot_szPass;
  231.     i32x m_iMSlot_bGameOver;
  232.  
  233.     i32x m_iRace_iId;
  234.     i32x m_iRace_iNameId;
  235.     i32x m_iRace_iStageNumber;
  236.     i32x m_iRace_iDay;
  237.     i32x m_iRace_iCountryId;
  238.     i32x m_iRace_iUciClassStrId;
  239.  
  240.     i32x m_iStage_iId;
  241.     i32x m_iStage_iType;
  242.     i32x m_iStage_iNameId;
  243.     i32x m_iStage_iRaceId;
  244.     i32x m_iStage_iRaceNameId;
  245.     i32x m_iStage_fLength;
  246.     i32x m_iStage_iDay;
  247.     i32x m_iStage_iNumber;
  248.     i32x m_iStage_szRelief;
  249.  
  250.     i32x m_iCountry_iTgaId;
  251.  
  252.     i32x m_iTga_szDirectory;
  253.     i32x m_iTga_szName;
  254.  
  255. } stLocalJoins;
  256.  
  257. // *********************************************
  258. // * constants
  259. // *********************************************
  260.  
  261. var szx G_szVersion;
  262. var szx g_szInternetConfig;
  263.  
  264. // Race modes
  265. var i32x G_iRaceModeNormal            = 0;
  266. var i32x G_iRaceModeTimeTrial        = 1;
  267. var i32x G_iRaceModeTeamTimeTrial    = 2;
  268.  
  269. var i32x g_InRaceClient_DEF_InvalidGroup = 255;
  270.  
  271. // Windows position
  272. var i32x g_iWindowPositionX = 143;
  273. var i32x g_iWindowPositionY = 39;
  274.  
  275. // NULL variables
  276. var Net_Client g_poNullClient;
  277. var szx g_szNull;
  278. var component g_poNullComponent;
  279.  
  280.  
  281. // User Mode
  282. var i32x G_iGuestUser            = 0;
  283. var i32x G_iRegisteredUser        = 1;
  284.  
  285. // guest status
  286. var i32x g_iGUEST_STATUS_Free  = 0;
  287. var i32x g_iGUEST_STATUS_Guest = 1;
  288. var i32x g_iGUEST_STATUS_User  = 2;
  289.  
  290. // Game server phase
  291. var i32x G_iPhase_Management    = 0;
  292. var i32x G_iPhase_PreRace        = 1;
  293. var i32x G_iPhase_InRace        = 2;
  294.  
  295. var i32x G_iEscape_Exit            = 0;
  296. var i32x G_iEscape_Login        = 1;
  297. var i32x G_iEscape_Management    = 2;
  298. var i32x G_iEscape_SkipIntro    = 3;
  299.  
  300. // Version of the client: debug or final
  301. var i32x G_iDebugVersion = 0;
  302.  
  303.  
  304. // debug : special demo : Load slot 1 and exit after podium
  305. var i32x G_iDemoVersion = 1;
  306.  
  307. //special looprun : Load slot 1 and then run all races in loop
  308. var i32x G_iLoopRunVersion = 0;
  309. var i32x G_iLoopRunNumLoopMenu = 0;
  310.  
  311.  
  312. // *********************************************
  313. // * variables
  314. // *********************************************
  315.  
  316.  
  317. var stGameConfig    g_oGameConfig;
  318. var stConnection    g_oMenuServer;
  319. var stLobbyConfig    g_oLobby;
  320. var stInRaceServer    g_oInRaceServer;
  321. var stUser            g_oUser;
  322. var stMenuJoins        g_oMenuJoins;
  323. var stGatewayJoins    g_oGatewayJoins;
  324. var stLocalJoins    g_oLocalJoins;
  325.