AllSrvModuleIDL.idl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. import "..\inc\AGCIDL.idl";
  2. //import "oaidl.idl"; // not needed if including AGCIDL.h
  3. //import "ocidl.idl";
  4. /////////////////////////////////////////////////////////////////////////////
  5. // {secret}
  6. // DISPID Enumeration
  7. //
  8. // Notes:
  9. // Never remove one of these enumeration values without replacing it
  10. // with a dispid_Reservedx value to take its place, where x is the next
  11. // reserved index not in use.
  12. //
  13. // Always add new values to the end of the enumeration so that these values
  14. // will never change.
  15. //
  16. enum dispid_AdminIDL
  17. {
  18. dispid_AdminIDL_Begin = dispid_AGCIDL_End,
  19. dispid_GamesAdd,
  20. dispid_SessionInfo,
  21. dispid_Sessions,
  22. dispid_SessionServer,
  23. dispid_SessionGames,
  24. dispid_SessionRegisterForEvent,
  25. dispid_SessionUnregisterForEvent,
  26. dispid_EventActivated,
  27. dispid_WhoStartedServer,
  28. dispid_ActivateAllEvents,
  29. dispid_DeactivateAllEvents,
  30. dispid_PlayerCount,
  31. dispid_MissionCount,
  32. dispid_SendMsg,
  33. dispid_Users,
  34. dispid_Version,
  35. dispid_Stop,
  36. dispid_Pause,
  37. dispid_LookupUser,
  38. dispid_FindUser,
  39. dispid_ProcessID,
  40. dispid_OnEvent,
  41. dispid_EventLog,
  42. dispid_MachineName,
  43. dispid_PerfCounter1,
  44. dispid_PerfCounter2,
  45. dispid_PerfCounter3,
  46. dispid_LobbyServer,
  47. dispid_LobbyMode,
  48. dispid_PerfCounters,
  49. dispid_AdminIDL_End = dispid_AdminIDL_Begin + 0x1000
  50. };
  51. /////////////////////////////////////////////////////////////////////////////
  52. // Forward Declarations
  53. //
  54. interface IAdminSession;
  55. interface IAdminSessionEvents;
  56. dispinterface _IAdminSessionEvents;
  57. interface IAdminSessionHost;
  58. interface IAdminSessionSite;
  59. interface IAdminServer;
  60. interface IAdminShip;
  61. interface IAdminGame;
  62. interface IAdminGames;
  63. interface IAdminServer;
  64. interface IAdminUser;
  65. interface IAdminUsers;
  66. /////////////////////////////////////////////////////////////////////////////
  67. //
  68. [
  69. uuid(4C3EB21E-2A97-11d3-8B66-00C04F681633),
  70. helpstring("AdminUserID type.")
  71. ]
  72. typedef short AdminUserID;
  73. /////////////////////////////////////////////////////////////////////////////
  74. //
  75. [
  76. object,
  77. uuid(8D9BE088-DDA4-11d2-8B46-00C04F681633),
  78. dual,
  79. helpstring("IAdminSession Interface"),
  80. pointer_default(unique)
  81. ]
  82. interface IAdminSession : IDispatch
  83. {
  84. [propput, helpstring("Gets/sets the session information object.")]
  85. HRESULT SessionInfo([in] ITCSessionInfo* pSessionInfo);
  86. [propget, id(dispid_SessionInfo)]
  87. HRESULT SessionInfo([out, retval] ITCSessionInfo** ppSessionInfo);
  88. [propget, id(dispid_Sessions), helpstring("Gets the collection of connected sessions.")]
  89. HRESULT SessionInfos([out, retval] ITCSessionInfos** ppSessionInfos);
  90. [propget, id(dispid_SessionServer), helpstring("Returns the server object.")]
  91. HRESULT Server([out, retval] IAdminServer** ppServer);
  92. [id(dispid_SessionRegisterForEvent), helpstring("Use this to activate event firing for events of a certain type; Use uniqueID optionally to limit event firing.")]
  93. HRESULT ActivateEvents(AGCEventID AGCEvent, [in, defaultvalue(-1)] AGCUniqueID uniqueID);
  94. [id(dispid_SessionUnregisterForEvent), helpstring("Use this to deactivate event firing for events of a certain type; Use uniqueObjectID optionally to limit event firing.")]
  95. HRESULT DeactivateEvents(AGCEventID AGCEvent, [in, defaultvalue(-1)] AGCUniqueID uniqueObjectID);
  96. [propget, id(dispid_EventActivated), helpstring("Use this to find out of an event of a certain type is firing")]
  97. HRESULT IsEventActivated([in] AGCEventID AGCEvent, [in, defaultvalue(-1)] AGCUniqueID uniqueID, [out, retval] BOOL* pVal);
  98. [id(dispid_ActivateAllEvents), helpstring("Use this to turn on all available events for this session.")]
  99. HRESULT ActivateAllEvents();
  100. [id(dispid_DeactivateAllEvents), helpstring("Use this to turn off all active events for this session.")]
  101. HRESULT DeactivateAllEvents();
  102. [propget, id(dispid_ProcessID), helpstring("Gets the process ID of the server, meaningful only on the local machine.")]
  103. HRESULT ProcessID([out, retval] long* pdwProcessID);
  104. [propget, id(dispid_Version)]
  105. HRESULT Version([out, retval] IAGCVersionInfo** ppVersion);
  106. [id(dispid_Stop), helpstring("Use this to kill the server")]
  107. HRESULT Stop();
  108. [id(dispid_Pause), helpstring("Use this to pause the server. When paused, no new users may join and once everyone logs off, the server shuts down. This method does nothing if the server is already paused.")]
  109. HRESULT Pause();
  110. [propget, id(dispid_WhoStartedServer), helpstring("Use this to find out which session caused the server to launch. This is NULL is COM did not start it.")]
  111. HRESULT WhoStartedServer([out, retval] IAdminSession** pIAdminSession);
  112. [propget, id(dispid_EventLog), helpstring("Gets the event log object.")]
  113. HRESULT EventLog([out, retval] IAGCEventLogger** ppEventLogger);
  114. [propget, id(dispid_PerfCounters), helpstring("Gets a collection of current performance counters.")]
  115. HRESULT PerfCounters([out, retval] IAGCEvent** ppPerfCounters);
  116. [helpstring("Causes an AdminChat event to be fired.")]
  117. HRESULT SendAdminChat([in] BSTR bstrText, [in] long nUserID, [in] DATE dateOriginal);
  118. [helpstring("Use this to continue a paused the server. This method does nothing if the server is not paused.")]
  119. HRESULT Continue();
  120. }; // End: interface IAdminSession : IDispatch
  121. /////////////////////////////////////////////////////////////////////////////
  122. // IAdminSessionHost Interface
  123. [
  124. object, oleautomation, pointer_default(unique),
  125. uuid(CD7D4875-3D61-4cc4-83C1-48F698ED45F5),
  126. helpstring("IAdminSessionHost interface")
  127. ]
  128. interface IAdminSessionHost : IUnknown
  129. {
  130. HRESULT GetIdentity([in] long nCookie, [out, retval] IUnknown** ppIdentity);
  131. }; // END: interface IAdminSessionHost : IUnknown
  132. /////////////////////////////////////////////////////////////////////////////
  133. // IAdminSessionClass Interface
  134. [
  135. object, oleautomation, pointer_default(unique),
  136. uuid(B3339C1B-D267-420b-B3D7-59F127CDD9CF),
  137. helpstring("IAdminSessionClass interface")
  138. ]
  139. interface IAdminSessionClass : IUnknown
  140. {
  141. [helpstring("Creates an AdminSession class.")]
  142. HRESULT CreateSession([in] IAdminSessionHost* pHost,
  143. [out, retval] IAdminSession** ppSession);
  144. }; // END: interface IAdminSessionClass : IUnknown
  145. /////////////////////////////////////////////////////////////////////////////
  146. //
  147. [
  148. object, oleautomation, pointer_default(unique), nonextensible,
  149. uuid(DE3ED156-76A0-4a8e-8CFE-9ED26C3B0A5E),
  150. helpstring("IAdminSessionEvents Interface")
  151. ]
  152. interface IAdminSessionEvents : IUnknown
  153. {
  154. [id(dispid_OnEvent), helpstring("Called when an event is fired for this session.")]
  155. HRESULT OnEvent([in] IAGCEvent* pEvent);
  156. }; // End: interface IAdminSessionEvents : IUnknown
  157. /////////////////////////////////////////////////////////////////////////////
  158. //
  159. [
  160. uuid(6A9E632E-1889-11d3-8B61-00C04F681633),
  161. helpstring("_IAdminSessionEvents Interface")
  162. ]
  163. dispinterface _IAdminSessionEvents
  164. {
  165. interface IAdminSessionEvents;
  166. }; // End: dispinterface _IAdminSessionEvents
  167. /////////////////////////////////////////////////////////////////////////////
  168. //
  169. [
  170. object,
  171. uuid(986E689A-2DB4-11d3-8B66-00C04F681633),
  172. dual,
  173. helpstring("IAdminShip Interface"),
  174. pointer_default(unique)
  175. ]
  176. interface IAdminShip : IAGCShip
  177. {
  178. [propget, id(500), helpstring("Returns the User who is piloting this ship.")]
  179. HRESULT User([out, retval] IAdminUser** ppUser);
  180. };
  181. /////////////////////////////////////////////////////////////////////////////
  182. //
  183. [
  184. object,
  185. uuid(8FC514F8-E6CE-11D2-8B4B-00C04F681633),
  186. dual,
  187. helpstring("IAdminGame Interface"),
  188. pointer_default(unique)
  189. ]
  190. interface IAdminGame : IAGCGame
  191. {
  192. [id(102), helpstring("method SendMsg to everyone in game")]
  193. HRESULT SendMsg(BSTR bstrMessage);
  194. [id(108), helpstring("Terminates this game and then deletes itself")]
  195. HRESULT Kill();
  196. [propget, id(109), helpstring("Returns a Users collection of the people in the game.")]
  197. HRESULT Users([out, retval] IAdminUsers** ppUsers);
  198. [propget, id(112), helpstring("Returns the User who is the game owner.")]
  199. HRESULT GameOwnerUser([out, retval] IAdminUser** ppUser);
  200. [id(113), helpstring("Changes a game's stage from AGCGameStage_NotStarted to AGCGameStage_Started")]
  201. HRESULT StartGame();
  202. [propget, id(114), helpstring("Returns description of the game which is unique among all games.")]
  203. HRESULT Description([out, retval] BSTR* pbstrDescription);
  204. [id(115), helpstring("Begins the countdown of the game. Once countdown hits zero, the game starts. The starting countdown amount is specified as a game parameter called DefaultCountdown.")]
  205. HRESULT StartCountdown();
  206. [id(116), helpstring("Changes a team's name. Use game param, LockTeamSettings to ensure it stays that way. (SetTeamName overrides LockTeamSettings.)")]
  207. HRESULT SetTeamName([in] int iSideID, [in] BSTR bstrName);
  208. [id(117), helpstring("Changes a team's default tech bit which is normally based on its civid. The only has an effect if done before the game starts (and before the countdown).")]
  209. HRESULT OverrideTechBit([in] int iSideID, [in] int nTechBitID, [in] BOOL bNewSetting);
  210. [id(118), helpstring("Sets the mml file(s) to display when the user clicks on 'details' in the games list. The files are seperated by spaces, and are assumed to be in the directory specified by ZoneEventDetailsURL in the config file. The mml file should always be the last one in the list.")]
  211. HRESULT SetDetailsFiles([in] BSTR bstrName);
  212. [id(119), helpstring("Assigns everyone in the game to a random team except the team leaders.")]
  213. HRESULT RandomizeTeams();
  214. }; // End: interface IAdminGame : IAGCGame
  215. /////////////////////////////////////////////////////////////////////////////
  216. // The IAdminGames interface is used to enumerate a collection of
  217. // Game Objects.
  218. //
  219. // Through this interface, the collection can be enumerated using the Count
  220. // and Item properties. The Item property can be used to retrieve an item by
  221. // its 0-based index.
  222. //
  223. // *When To Implement*
  224. //
  225. // Implement this object on a collection of game objects.
  226. //
  227. // *When To Use*
  228. //
  229. // Use IAdminGames to enumerate a collection object provided by a
  230. // game object. This allows a client to determine what other clients, if
  231. // any, are also connected to the host of the session object.
  232. //
  233. // See Also: IAdminGame
  234. [
  235. object, dual, pointer_default(unique),
  236. uuid(3ACE4410-E6D3-11D2-8B4B-00C04F681633),
  237. helpstring("IAdminGames interface")
  238. ]
  239. interface IAdminGames : IAGCCollection
  240. {
  241. ///////////////////////////////////////////////////////////////////////////
  242. // Parameters:
  243. // index - A *VARIANT* which is coerced to type *VT_I4*. Specifies the
  244. // 0-relative index of the item which is to be retrieved.
  245. // ppGame - Address of an IAdminGame interface pointer that
  246. // receives the item specified by /index/.
  247. //
  248. // Return Value: One of the following values or an RPC error code if an
  249. // error occurred in the remoting layer:
  250. //
  251. // S_OK - The function was successful.
  252. // E_POINTER - The specified pointer is invalid.
  253. // E_INVALIDARG - The specified index is out of range or is a
  254. // *VARIANT* type not supported by this interface.
  255. //
  256. // See Also: IAdminGame
  257. [propget, id(DISPID_VALUE), helpstring("Returns a Game from the collection, or NULL if the game does not exist. Takes an argument, index, which must be the index into the collection.")]
  258. HRESULT Item([in] VARIANT* pvIndex, [out, retval] IAdminGame** ppGame);
  259. [id(dispid_GamesAdd), helpstring("method Add")]
  260. HRESULT Add(IAGCGameParameters* pGameParameters);
  261. }; // END: interface IAdminGames : ITCCollection
  262. /////////////////////////////////////////////////////////////////////////////
  263. //
  264. [
  265. object,
  266. uuid(20721450-E7C0-11D2-8B4B-00C04F681633),
  267. dual,
  268. helpstring("IAdminServer Interface"),
  269. pointer_default(unique)
  270. ]
  271. interface IAdminServer : IDispatch
  272. {
  273. [propget, id(dispid_SessionGames), helpstring("Gets the collection of active games on this server.")]
  274. HRESULT Games([out, retval] IAdminGames** ppGames);
  275. [propget, id(dispid_PlayerCount), helpstring("property PlayerCount")]
  276. HRESULT PlayerCount([out, retval] long *pVal);
  277. [propget, id(dispid_MissionCount), helpstring("property MissionCount")]
  278. HRESULT MissionCount([out, retval] long *pVal);
  279. [id(dispid_SendMsg), helpstring("method SendMsg to everyone on the server")]
  280. HRESULT SendMsg(BSTR bstrMessage);
  281. [propget, id(dispid_Users), helpstring("Returns a Users collection of the people on the server.")]
  282. HRESULT Users([out, retval] IAdminUsers** ppUsers);
  283. [propget, id(dispid_LookupUser), helpstring("Finds and Returns the User based on AGC id -OR- NULL if not found. This is faster than FindUser")]
  284. HRESULT LookupUser([in] AGCUniqueID id, [out, retval] IAdminUser** ppUser);
  285. [propget, id(dispid_FindUser), helpstring("Finds and Returns the User based on name -OR- NULL if not found. This is slower and less reliable than LookupUser")]
  286. HRESULT FindUser([in] BSTR bstrName, [out, retval] IAdminUser** ppUser);
  287. [propget, id(dispid_MachineName), helpstring("prop MachineName returns name of computer running AllSrv")]
  288. HRESULT MachineName([out, retval] BSTR * pbstrMachineName);
  289. [propget, id(dispid_PerfCounter1), helpstring("prop PacketsIn; number of messages received by server; monitor this as it changes of over time to determine server burden.")]
  290. HRESULT PacketsIn([out, retval] long * pVal);
  291. [propget, id(dispid_PerfCounter2), helpstring("prop PlayersOnline, number of users logged onto the game server.")]
  292. HRESULT PlayersOnline([out, retval] long * pVal);
  293. [propget, id(dispid_PerfCounter3), helpstring("prop TimeInnerLoop, milliseconds spent by server in inner loop; this slows how much load server has.")]
  294. HRESULT TimeInnerLoop([out, retval] long * pVal);
  295. [propput, helpstring("Gets/Sets the Lobby server onto which this server publishes its games.")]
  296. HRESULT LobbyServer([in] BSTR bstrLobbyServer);
  297. [propget, id(dispid_LobbyServer)]
  298. HRESULT LobbyServer([out, retval] BSTR* pbstrLobbyServer);
  299. [propput, helpstring("For standalone server only. Gets/sets the Lobby Mode; true means games will be public, false means private.")]
  300. HRESULT PublicLobby([in] VARIANT_BOOL bPublic);
  301. [propget, id(dispid_LobbyMode)]
  302. HRESULT PublicLobby([out, retval] VARIANT_BOOL* pbPublic);
  303. [helpstring("Create the default set of games (standalone only).")]
  304. HRESULT CreateDefaultGames();
  305. }; // End: interface IAdminServer : IDispatch
  306. /////////////////////////////////////////////////////////////////////////////
  307. //
  308. [
  309. object,
  310. uuid(D5C9AD80-EBA4-11D2-8B4B-00C04F681633),
  311. dual,
  312. helpstring("IAdminUser Interface"),
  313. pointer_default(unique)
  314. ]
  315. interface IAdminUser : IDispatch
  316. {
  317. [propget, helpstring("Gets the user's name.")]
  318. HRESULT Name([out, retval] BSTR* pbstr);
  319. [helpstring("method SendMsg to specific player")]
  320. HRESULT SendMsg(BSTR bstrMessage);
  321. [propget, helpstring("returns true if player is ready to play (from within in lobby)")]
  322. HRESULT isReady([out, retval] VARIANT_BOOL *pVal);
  323. [propput]
  324. HRESULT isReady([in] VARIANT_BOOL Val);
  325. [propget, helpstring("returns the AGC Ship that the player is piloting, or NULL if none")]
  326. HRESULT Ship([out, retval] IAdminShip** ppAdminShip);
  327. [helpstring("method Boot: logoff user")]
  328. HRESULT Boot();
  329. [propget, helpstring("Returns the user id of the user")]
  330. HRESULT UserID([out, retval] AdminUserID *userid);
  331. [propget, helpstring("Returns the AGC unique id of the user")]
  332. HRESULT UniqueID([out, retval] AGCUniqueID *uniqueID);
  333. [propget, helpstring("Returns an AGCEvent object used to store the current statistics of the player.")]
  334. HRESULT PlayerStats([out, retval] IAGCEvent** ppStats);
  335. }; // End: interface IAdminUser : IDispatch
  336. /////////////////////////////////////////////////////////////////////////////
  337. //
  338. [
  339. object,
  340. uuid(F9E52A79-EBA4-11D2-8B4B-00C04F681633),
  341. dual,
  342. helpstring("IAdminUsers Interface"),
  343. pointer_default(unique)
  344. ]
  345. interface IAdminUsers : ITCCollection
  346. {
  347. [propget, id(DISPID_VALUE), helpstring("Returns a User from the collection, or NULL if the game does not exist. Takes an argument, index, which must be the index into the collection.")]
  348. HRESULT Item([in] VARIANT index, [out, retval] IAdminUser** ppUser);
  349. };
  350. /////////////////////////////////////////////////////////////////////////////
  351. //
  352. [
  353. uuid(BB5FC41C-DDA4-11d2-8B46-00C04F681633),
  354. version(1.0),
  355. helpstring("AllSrv 1.0 Type Library")
  356. ]
  357. library ALLEGIANCESERVERLib
  358. {
  359. importlib("stdole32.tlb");
  360. importlib("stdole2.tlb");
  361. importlib("agc.tlb");
  362. ///////////////////////////////////////////////////////////////////////////
  363. // {secret}
  364. [
  365. hidden, noncreatable, uuid(8A1E3F7F-7A21-4fbf-9B39-D02CDB0D5402)
  366. ]
  367. coclass AdminInterfaces
  368. {
  369. /////////////////////////////////////////////////////////////////////////
  370. // Reference these (interfaces) so that they get into the typelib
  371. interface IAdminSession;
  372. interface IAdminSessionEvents;
  373. dispinterface _IAdminSessionEvents;
  374. interface IAdminSessionClass;
  375. interface IAdminServer;
  376. interface IAdminShip;
  377. interface IAdminGame;
  378. interface IAdminGames;
  379. interface IAdminServer;
  380. interface IAdminUser;
  381. interface IAdminUsers;
  382. };
  383. ///////////////////////////////////////////////////////////////////////////
  384. //
  385. [
  386. uuid(AAA8270F-DDA4-11d2-8B46-00C04F681633),
  387. helpstring("AdminSession Class")
  388. ]
  389. coclass AdminSession
  390. {
  391. [default] interface IAdminSession;
  392. [default, source] dispinterface _IAdminSessionEvents;
  393. [defaultvtable, source] interface IAdminSessionEvents;
  394. };
  395. ///////////////////////////////////////////////////////////////////////////
  396. //
  397. [
  398. noncreatable,
  399. uuid(3E389806-2DB4-11d3-8B66-00C04F681633),
  400. helpstring("AdminShip Class")
  401. ]
  402. coclass AdminShip
  403. {
  404. [default] interface IAdminShip;
  405. };
  406. ///////////////////////////////////////////////////////////////////////////
  407. //
  408. [
  409. noncreatable,
  410. uuid(9F17114A-E6CE-11D2-8B4B-00C04F681633),
  411. helpstring("AdminGame Class")
  412. ]
  413. coclass AdminGame
  414. {
  415. [default] interface IAdminGame;
  416. };
  417. ///////////////////////////////////////////////////////////////////////////
  418. //
  419. [
  420. noncreatable,
  421. uuid(67757064-E6FC-11D2-8B4B-00C04F681633),
  422. helpstring("AdminGames Class")
  423. ]
  424. coclass AdminGames
  425. {
  426. [default] interface IAdminGames;
  427. };
  428. ///////////////////////////////////////////////////////////////////////////
  429. //
  430. [
  431. noncreatable,
  432. uuid(5B5ED2A6-E7C0-11D2-8B4B-00C04F681633),
  433. helpstring("AdminServer Class")
  434. ]
  435. coclass AdminServer
  436. {
  437. [default] interface IAdminServer;
  438. };
  439. ///////////////////////////////////////////////////////////////////////////
  440. //
  441. [
  442. noncreatable,
  443. uuid(E71EA5B8-EBA4-11D2-8B4B-00C04F681633),
  444. helpstring("AdminUser Class")
  445. ]
  446. coclass AdminUser
  447. {
  448. [default] interface IAdminUser;
  449. };
  450. ///////////////////////////////////////////////////////////////////////////
  451. //
  452. [
  453. noncreatable,
  454. uuid(0BD51B94-EBA5-11D2-8B4B-00C04F681633),
  455. helpstring("AdminUsers Class")
  456. ]
  457. coclass AdminUsers
  458. {
  459. [default] interface IAdminUsers;
  460. };
  461. };
  462. /////////////////////////////////////////////////////////////////////////////
  463. cpp_quote("#if defined(__cplusplus) && _MSC_VER >= 1100")
  464. cpp_quote(" extern \"C++\"")
  465. cpp_quote(" {")
  466. cpp_quote(" /////////////////////////////////////////////////////////////////////////")
  467. cpp_quote(" // Smart Pointer Declarations")
  468. cpp_quote("")
  469. cpp_quote(" #include <comdef.h>")
  470. cpp_quote("")
  471. cpp_quote(" #ifndef TC_COM_SMARTPTR_TYPEDEF")
  472. cpp_quote(" #define TC_COM_SMARTPTR_TYPEDEF(Interface) \\")
  473. cpp_quote(" _COM_SMARTPTR_TYPEDEF(Interface, __uuidof(Interface))")
  474. cpp_quote(" #endif // TC_COM_SMARTPTR_TYPEDEF")
  475. cpp_quote("")
  476. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminSession);")
  477. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminSessionEvents);")
  478. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminSessionHost);")
  479. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminSessionClass);")
  480. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminServer);")
  481. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminShip);")
  482. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminGame);")
  483. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminGames);")
  484. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminServer);")
  485. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminUser);")
  486. cpp_quote(" TC_COM_SMARTPTR_TYPEDEF(IAdminUsers);")
  487. cpp_quote("")
  488. cpp_quote(" } // extern \"C++\"")
  489. cpp_quote("#endif // defined(__cplusplus) && _MSC_VER >= 1100")
  490. cpp_quote("")
  491. cpp_quote("/////////////////////////////////////////////////////////////////////////////")
  492. cpp_quote("// AllSrv Existence")
  493. cpp_quote("#define szAllSrvRunning TEXT(\"{5B5ED2A6-E7C0-11D2-8B4B-00C04F681633}_Running\")")
  494. cpp_quote("#define szAllSrvRunningGlobal (TEXT(\"Global\\\\\") szAllSrvRunning)")
  495. cpp_quote("")
  496. cpp_quote("BOOL IsAllSrvRunning()")
  497. cpp_quote("{")
  498. cpp_quote(" // Open the mutex using the global name first")
  499. cpp_quote(" HANDLE hMutex = ::OpenMutex(SYNCHRONIZE, false, szAllSrvRunningGlobal);")
  500. cpp_quote(" if (!hMutex)")
  501. cpp_quote(" hMutex = ::OpenMutex(SYNCHRONIZE, false, szAllSrvRunning);")
  502. cpp_quote(" BOOL bRunning = NULL != hMutex;")
  503. cpp_quote(" if (bRunning)")
  504. cpp_quote(" ::CloseHandle(hMutex);")
  505. cpp_quote(" return bRunning;")
  506. cpp_quote("}")
  507. cpp_quote("")