Connection.cs 868 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Urho.Network {
  4. public partial class Connection {
  5. public void SendMessage (int msgId, bool reliable, bool inOrder, byte [] buffer, uint contentId = 0)
  6. {
  7. unsafe {
  8. fixed (byte *p = &buffer[0])
  9. Connection_SendMessage (handle, msgId, reliable, inOrder, p, (uint) buffer.Length, contentId);
  10. }
  11. }
  12. [DllImport (Consts.NativeImport, CallingConvention=CallingConvention.Cdecl)]
  13. extern static IntPtr Connection_GetControls (IntPtr handle);
  14. [DllImport (Consts.NativeImport, CallingConvention=CallingConvention.Cdecl)]
  15. extern static IntPtr Connection_SetControls (IntPtr handle, IntPtr controlHandle);
  16. public Controls Controls {
  17. get {
  18. return new Controls (this, Connection_GetControls (handle));
  19. }
  20. set {
  21. Connection_SetControls (handle, value.handle);
  22. }
  23. }
  24. }
  25. }