Connection.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Connection.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Network
  18. {
  19. /// <summary>
  20. /// %Connection to a remote network host.
  21. /// </summary>
  22. public unsafe partial class Connection : UrhoObject
  23. {
  24. unsafe partial void OnConnectionCreated ();
  25. [Preserve]
  26. public Connection (IntPtr handle) : base (handle)
  27. {
  28. OnConnectionCreated ();
  29. }
  30. [Preserve]
  31. protected Connection (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnConnectionCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Connection_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Connection_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Connection_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Connection_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Connection_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Connection));
  54. return new StringHash (Connection_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Connection_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Connection));
  61. return Marshal.PtrToStringAnsi (Connection_GetTypeNameStatic ());
  62. }
  63. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  64. internal static extern void Connection_SendMessage (IntPtr handle, int msgID, bool reliable, bool inOrder, byte* data, uint numBytes, uint contentID);
  65. /// <summary>
  66. /// Send a message.
  67. /// </summary>
  68. public void SendMessage (int msgID, bool reliable, bool inOrder, byte* data, uint numBytes, uint contentID = 0)
  69. {
  70. Runtime.ValidateRefCounted (this);
  71. Connection_SendMessage (handle, msgID, reliable, inOrder, data, numBytes, contentID);
  72. }
  73. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  74. internal static extern void Connection_SetScene (IntPtr handle, IntPtr newScene);
  75. /// <summary>
  76. /// Assign scene. On the server, this will cause the client to load it.
  77. /// </summary>
  78. private void SetScene (Scene newScene)
  79. {
  80. Runtime.ValidateRefCounted (this);
  81. Connection_SetScene (handle, (object)newScene == null ? IntPtr.Zero : newScene.Handle);
  82. }
  83. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  84. internal static extern void Connection_SetPosition (IntPtr handle, ref Urho.Vector3 position);
  85. /// <summary>
  86. /// Set the observer position for interest management, to be sent to the server.
  87. /// </summary>
  88. private void SetPosition (Urho.Vector3 position)
  89. {
  90. Runtime.ValidateRefCounted (this);
  91. Connection_SetPosition (handle, ref position);
  92. }
  93. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  94. internal static extern void Connection_SetRotation (IntPtr handle, ref Urho.Quaternion rotation);
  95. /// <summary>
  96. /// Set the observer rotation for interest management, to be sent to the server. Note: not used by the NetworkPriority component.
  97. /// </summary>
  98. private void SetRotation (Urho.Quaternion rotation)
  99. {
  100. Runtime.ValidateRefCounted (this);
  101. Connection_SetRotation (handle, ref rotation);
  102. }
  103. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  104. internal static extern void Connection_SetConnectPending (IntPtr handle, bool connectPending);
  105. /// <summary>
  106. /// Set the connection pending status. Called by Network.
  107. /// </summary>
  108. private void SetConnectPending (bool connectPending)
  109. {
  110. Runtime.ValidateRefCounted (this);
  111. Connection_SetConnectPending (handle, connectPending);
  112. }
  113. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  114. internal static extern void Connection_SetLogStatistics (IntPtr handle, bool enable);
  115. /// <summary>
  116. /// Set whether to log data in/out statistics.
  117. /// </summary>
  118. private void SetLogStatistics (bool enable)
  119. {
  120. Runtime.ValidateRefCounted (this);
  121. Connection_SetLogStatistics (handle, enable);
  122. }
  123. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  124. internal static extern void Connection_Disconnect (IntPtr handle, int waitMSec);
  125. /// <summary>
  126. /// Disconnect. If wait time is non-zero, will block while waiting for disconnect to finish.
  127. /// </summary>
  128. public void Disconnect (int waitMSec = 0)
  129. {
  130. Runtime.ValidateRefCounted (this);
  131. Connection_Disconnect (handle, waitMSec);
  132. }
  133. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  134. internal static extern void Connection_SendServerUpdate (IntPtr handle);
  135. /// <summary>
  136. /// Send scene update messages. Called by Network.
  137. /// </summary>
  138. public void SendServerUpdate ()
  139. {
  140. Runtime.ValidateRefCounted (this);
  141. Connection_SendServerUpdate (handle);
  142. }
  143. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  144. internal static extern void Connection_SendClientUpdate (IntPtr handle);
  145. /// <summary>
  146. /// Send latest controls from the client. Called by Network.
  147. /// </summary>
  148. public void SendClientUpdate ()
  149. {
  150. Runtime.ValidateRefCounted (this);
  151. Connection_SendClientUpdate (handle);
  152. }
  153. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  154. internal static extern void Connection_SendRemoteEvents (IntPtr handle);
  155. /// <summary>
  156. /// Send queued remote events. Called by Network.
  157. /// </summary>
  158. public void SendRemoteEvents ()
  159. {
  160. Runtime.ValidateRefCounted (this);
  161. Connection_SendRemoteEvents (handle);
  162. }
  163. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  164. internal static extern void Connection_SendPackages (IntPtr handle);
  165. /// <summary>
  166. /// Send package files to client. Called by network.
  167. /// </summary>
  168. public void SendPackages ()
  169. {
  170. Runtime.ValidateRefCounted (this);
  171. Connection_SendPackages (handle);
  172. }
  173. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  174. internal static extern void Connection_ProcessPendingLatestData (IntPtr handle);
  175. /// <summary>
  176. /// Process pending latest data for nodes and components.
  177. /// </summary>
  178. public void ProcessPendingLatestData ()
  179. {
  180. Runtime.ValidateRefCounted (this);
  181. Connection_ProcessPendingLatestData (handle);
  182. }
  183. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  184. internal static extern IntPtr Connection_GetScene (IntPtr handle);
  185. /// <summary>
  186. /// Return the scene used by this connection.
  187. /// </summary>
  188. private Scene GetScene ()
  189. {
  190. Runtime.ValidateRefCounted (this);
  191. return Runtime.LookupObject<Scene> (Connection_GetScene (handle));
  192. }
  193. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  194. internal static extern byte Connection_GetTimeStamp (IntPtr handle);
  195. /// <summary>
  196. /// Return the controls timestamp, sent from client to server along each control update.
  197. /// </summary>
  198. private byte GetTimeStamp ()
  199. {
  200. Runtime.ValidateRefCounted (this);
  201. return Connection_GetTimeStamp (handle);
  202. }
  203. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  204. internal static extern Urho.Vector3 Connection_GetPosition (IntPtr handle);
  205. /// <summary>
  206. /// Return the observer position sent by the client for interest management.
  207. /// </summary>
  208. private Urho.Vector3 GetPosition ()
  209. {
  210. Runtime.ValidateRefCounted (this);
  211. return Connection_GetPosition (handle);
  212. }
  213. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  214. internal static extern Urho.Quaternion Connection_GetRotation (IntPtr handle);
  215. /// <summary>
  216. /// Return the observer rotation sent by the client for interest management.
  217. /// </summary>
  218. private Urho.Quaternion GetRotation ()
  219. {
  220. Runtime.ValidateRefCounted (this);
  221. return Connection_GetRotation (handle);
  222. }
  223. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  224. internal static extern bool Connection_IsClient (IntPtr handle);
  225. /// <summary>
  226. /// Return whether is a client connection.
  227. /// </summary>
  228. private bool IsClient ()
  229. {
  230. Runtime.ValidateRefCounted (this);
  231. return Connection_IsClient (handle);
  232. }
  233. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  234. internal static extern bool Connection_IsConnected (IntPtr handle);
  235. /// <summary>
  236. /// Return whether is fully connected.
  237. /// </summary>
  238. private bool IsConnected ()
  239. {
  240. Runtime.ValidateRefCounted (this);
  241. return Connection_IsConnected (handle);
  242. }
  243. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  244. internal static extern bool Connection_IsConnectPending (IntPtr handle);
  245. /// <summary>
  246. /// Return whether connection is pending.
  247. /// </summary>
  248. private bool IsConnectPending ()
  249. {
  250. Runtime.ValidateRefCounted (this);
  251. return Connection_IsConnectPending (handle);
  252. }
  253. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  254. internal static extern bool Connection_IsSceneLoaded (IntPtr handle);
  255. /// <summary>
  256. /// Return whether the scene is loaded and ready to receive server updates.
  257. /// </summary>
  258. private bool IsSceneLoaded ()
  259. {
  260. Runtime.ValidateRefCounted (this);
  261. return Connection_IsSceneLoaded (handle);
  262. }
  263. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  264. internal static extern bool Connection_GetLogStatistics (IntPtr handle);
  265. /// <summary>
  266. /// Return whether to log data in/out statistics.
  267. /// </summary>
  268. private bool GetLogStatistics ()
  269. {
  270. Runtime.ValidateRefCounted (this);
  271. return Connection_GetLogStatistics (handle);
  272. }
  273. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  274. internal static extern IntPtr Connection_GetAddress (IntPtr handle);
  275. /// <summary>
  276. /// Return remote address.
  277. /// </summary>
  278. private string GetAddress ()
  279. {
  280. Runtime.ValidateRefCounted (this);
  281. return Marshal.PtrToStringAnsi (Connection_GetAddress (handle));
  282. }
  283. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  284. internal static extern ushort Connection_GetPort (IntPtr handle);
  285. /// <summary>
  286. /// Return remote port.
  287. /// </summary>
  288. private ushort GetPort ()
  289. {
  290. Runtime.ValidateRefCounted (this);
  291. return Connection_GetPort (handle);
  292. }
  293. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  294. internal static extern float Connection_GetRoundTripTime (IntPtr handle);
  295. /// <summary>
  296. /// Return the connection's round trip time in milliseconds.
  297. /// </summary>
  298. private float GetRoundTripTime ()
  299. {
  300. Runtime.ValidateRefCounted (this);
  301. return Connection_GetRoundTripTime (handle);
  302. }
  303. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  304. internal static extern float Connection_GetLastHeardTime (IntPtr handle);
  305. /// <summary>
  306. /// Return the time since last received data from the remote host in milliseconds.
  307. /// </summary>
  308. private float GetLastHeardTime ()
  309. {
  310. Runtime.ValidateRefCounted (this);
  311. return Connection_GetLastHeardTime (handle);
  312. }
  313. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  314. internal static extern float Connection_GetBytesInPerSec (IntPtr handle);
  315. /// <summary>
  316. /// Return bytes received per second.
  317. /// </summary>
  318. private float GetBytesInPerSec ()
  319. {
  320. Runtime.ValidateRefCounted (this);
  321. return Connection_GetBytesInPerSec (handle);
  322. }
  323. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  324. internal static extern float Connection_GetBytesOutPerSec (IntPtr handle);
  325. /// <summary>
  326. /// Return bytes sent per second.
  327. /// </summary>
  328. private float GetBytesOutPerSec ()
  329. {
  330. Runtime.ValidateRefCounted (this);
  331. return Connection_GetBytesOutPerSec (handle);
  332. }
  333. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  334. internal static extern float Connection_GetPacketsInPerSec (IntPtr handle);
  335. /// <summary>
  336. /// Return packets received per second.
  337. /// </summary>
  338. private float GetPacketsInPerSec ()
  339. {
  340. Runtime.ValidateRefCounted (this);
  341. return Connection_GetPacketsInPerSec (handle);
  342. }
  343. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  344. internal static extern float Connection_GetPacketsOutPerSec (IntPtr handle);
  345. /// <summary>
  346. /// Return packets sent per second.
  347. /// </summary>
  348. private float GetPacketsOutPerSec ()
  349. {
  350. Runtime.ValidateRefCounted (this);
  351. return Connection_GetPacketsOutPerSec (handle);
  352. }
  353. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  354. internal static extern IntPtr Connection_ToString (IntPtr handle);
  355. /// <summary>
  356. /// Return an address:port string.
  357. /// </summary>
  358. public string ToDebugString ()
  359. {
  360. Runtime.ValidateRefCounted (this);
  361. return Marshal.PtrToStringAnsi (Connection_ToString (handle));
  362. }
  363. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  364. internal static extern uint Connection_GetNumDownloads (IntPtr handle);
  365. /// <summary>
  366. /// Return number of package downloads remaining.
  367. /// </summary>
  368. private uint GetNumDownloads ()
  369. {
  370. Runtime.ValidateRefCounted (this);
  371. return Connection_GetNumDownloads (handle);
  372. }
  373. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  374. internal static extern IntPtr Connection_GetDownloadName (IntPtr handle);
  375. /// <summary>
  376. /// Return name of current package download, or empty if no downloads.
  377. /// </summary>
  378. private string GetDownloadName ()
  379. {
  380. Runtime.ValidateRefCounted (this);
  381. return Marshal.PtrToStringAnsi (Connection_GetDownloadName (handle));
  382. }
  383. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  384. internal static extern float Connection_GetDownloadProgress (IntPtr handle);
  385. /// <summary>
  386. /// Return progress of current package download, or 1.0 if no downloads.
  387. /// </summary>
  388. private float GetDownloadProgress ()
  389. {
  390. Runtime.ValidateRefCounted (this);
  391. return Connection_GetDownloadProgress (handle);
  392. }
  393. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  394. internal static extern void Connection_SendPackageToClient (IntPtr handle, IntPtr package);
  395. /// <summary>
  396. /// Trigger client connection to download a package file from the server. Can be used to download additional resource packages when client is already joined in a scene. The package must have been added as a requirement to the scene the client is joined in, or else the eventual download will fail.
  397. /// </summary>
  398. public void SendPackageToClient (PackageFile package)
  399. {
  400. Runtime.ValidateRefCounted (this);
  401. Connection_SendPackageToClient (handle, (object)package == null ? IntPtr.Zero : package.Handle);
  402. }
  403. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  404. internal static extern void Connection_ConfigureNetworkSimulator (IntPtr handle, int latencyMs, float packetLoss);
  405. /// <summary>
  406. /// Set network simulation parameters. Called by Network.
  407. /// </summary>
  408. public void ConfigureNetworkSimulator (int latencyMs, float packetLoss)
  409. {
  410. Runtime.ValidateRefCounted (this);
  411. Connection_ConfigureNetworkSimulator (handle, latencyMs, packetLoss);
  412. }
  413. public override StringHash Type {
  414. get {
  415. return UrhoGetType ();
  416. }
  417. }
  418. public override string TypeName {
  419. get {
  420. return GetTypeName ();
  421. }
  422. }
  423. [Preserve]
  424. public static StringHash TypeStatic {
  425. get {
  426. return GetTypeStatic ();
  427. }
  428. }
  429. public static string TypeNameStatic {
  430. get {
  431. return GetTypeNameStatic ();
  432. }
  433. }
  434. /// <summary>
  435. /// Return the scene used by this connection.
  436. /// Or
  437. /// Assign scene. On the server, this will cause the client to load it.
  438. /// </summary>
  439. public Scene Scene {
  440. get {
  441. return GetScene ();
  442. }
  443. set {
  444. SetScene (value);
  445. }
  446. }
  447. /// <summary>
  448. /// Return the observer position sent by the client for interest management.
  449. /// Or
  450. /// Set the observer position for interest management, to be sent to the server.
  451. /// </summary>
  452. public Urho.Vector3 Position {
  453. get {
  454. return GetPosition ();
  455. }
  456. set {
  457. SetPosition (value);
  458. }
  459. }
  460. /// <summary>
  461. /// Return the observer rotation sent by the client for interest management.
  462. /// Or
  463. /// Set the observer rotation for interest management, to be sent to the server. Note: not used by the NetworkPriority component.
  464. /// </summary>
  465. public Urho.Quaternion Rotation {
  466. get {
  467. return GetRotation ();
  468. }
  469. set {
  470. SetRotation (value);
  471. }
  472. }
  473. /// <summary>
  474. /// Return whether connection is pending.
  475. /// Or
  476. /// Set the connection pending status. Called by Network.
  477. /// </summary>
  478. public bool ConnectPending {
  479. get {
  480. return IsConnectPending ();
  481. }
  482. set {
  483. SetConnectPending (value);
  484. }
  485. }
  486. /// <summary>
  487. /// Return whether to log data in/out statistics.
  488. /// Or
  489. /// Set whether to log data in/out statistics.
  490. /// </summary>
  491. public bool LogStatistics {
  492. get {
  493. return GetLogStatistics ();
  494. }
  495. set {
  496. SetLogStatistics (value);
  497. }
  498. }
  499. /// <summary>
  500. /// Return the controls timestamp, sent from client to server along each control update.
  501. /// </summary>
  502. public byte TimeStamp {
  503. get {
  504. return GetTimeStamp ();
  505. }
  506. }
  507. /// <summary>
  508. /// Return whether is a client connection.
  509. /// </summary>
  510. public bool Client {
  511. get {
  512. return IsClient ();
  513. }
  514. }
  515. /// <summary>
  516. /// Return whether is fully connected.
  517. /// </summary>
  518. public bool Connected {
  519. get {
  520. return IsConnected ();
  521. }
  522. }
  523. /// <summary>
  524. /// Return whether the scene is loaded and ready to receive server updates.
  525. /// </summary>
  526. public bool SceneLoaded {
  527. get {
  528. return IsSceneLoaded ();
  529. }
  530. }
  531. /// <summary>
  532. /// Return remote address.
  533. /// </summary>
  534. public string Address {
  535. get {
  536. return GetAddress ();
  537. }
  538. }
  539. /// <summary>
  540. /// Return remote port.
  541. /// </summary>
  542. public ushort Port {
  543. get {
  544. return GetPort ();
  545. }
  546. }
  547. /// <summary>
  548. /// Return the connection's round trip time in milliseconds.
  549. /// </summary>
  550. public float RoundTripTime {
  551. get {
  552. return GetRoundTripTime ();
  553. }
  554. }
  555. /// <summary>
  556. /// Return the time since last received data from the remote host in milliseconds.
  557. /// </summary>
  558. public float LastHeardTime {
  559. get {
  560. return GetLastHeardTime ();
  561. }
  562. }
  563. /// <summary>
  564. /// Return bytes received per second.
  565. /// </summary>
  566. public float BytesInPerSec {
  567. get {
  568. return GetBytesInPerSec ();
  569. }
  570. }
  571. /// <summary>
  572. /// Return bytes sent per second.
  573. /// </summary>
  574. public float BytesOutPerSec {
  575. get {
  576. return GetBytesOutPerSec ();
  577. }
  578. }
  579. /// <summary>
  580. /// Return packets received per second.
  581. /// </summary>
  582. public float PacketsInPerSec {
  583. get {
  584. return GetPacketsInPerSec ();
  585. }
  586. }
  587. /// <summary>
  588. /// Return packets sent per second.
  589. /// </summary>
  590. public float PacketsOutPerSec {
  591. get {
  592. return GetPacketsOutPerSec ();
  593. }
  594. }
  595. /// <summary>
  596. /// Return number of package downloads remaining.
  597. /// </summary>
  598. public uint NumDownloads {
  599. get {
  600. return GetNumDownloads ();
  601. }
  602. }
  603. /// <summary>
  604. /// Return name of current package download, or empty if no downloads.
  605. /// </summary>
  606. public string DownloadName {
  607. get {
  608. return GetDownloadName ();
  609. }
  610. }
  611. /// <summary>
  612. /// Return progress of current package download, or 1.0 if no downloads.
  613. /// </summary>
  614. public float DownloadProgress {
  615. get {
  616. return GetDownloadProgress ();
  617. }
  618. }
  619. }
  620. }