c_api_lan.h - Engine C API Reference

c_api_lan.h
  1. #pragma once
  2. #include "c_api_types.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. enum LanCApi_LanLobbyState { LAN_LB_CREATING, LAN_LB_JOINING, LAN_LB_JOINED, LAN_LB_FAILED };
  7. struct LanCApi
  8. {
  9. void (*init_client) (uint64_t network_config_id64, unsigned port, uint64_t peer_id);
  10. void (*shutdown_client) ();
  11. LanLobbyPtr (*create_lobby) (unsigned port, unsigned max_members);
  12. LanLobbyPtr (*join_lobby) (const char* server_address, unsigned port);
  13. void (*leave_lobby) (LanLobbyPtr);
  14. enum LanCApi_LanLobbyState (*state) (LanLobbyPtr);
  15. void (*set_data) (LanLobbyPtr, const char* key, const char* value);
  16. const char* (*data) (ConstLanLobbyPtr, const char* key);
  17. void (*set_game_session_host) (LanLobbyPtr, uint64_t peer_id64);
  18. void (*set_game_session_host_to_none) (LanLobbyPtr);
  19. uint64_t (*game_session_host) (ConstLanLobbyPtr);
  20. uint64_t (*lobby_host) (ConstLanLobbyPtr);
  21. unsigned (*num_members) (ConstLanLobbyPtr);
  22. uint64_t (*member) (ConstLanLobbyPtr, unsigned index);
  23. void (*kick) (LanLobbyPtr, uint64_t peer_id64);
  24. void (*set_member_data) (LanLobbyPtr, const char* key, const char* value);
  25. const char* (*own_data) (LanLobbyPtr, const char* key);
  26. const char* (*member_data) (LanLobbyPtr, uint64_t peer_id64, const char* key);
  27. LanLobbyBrowserPtr (*lobby_browser) ();
  28. struct SocketAddressWrapper (*lobby_address) (ConstLanLobbyBrowserPtr, unsigned index);
  29. unsigned (*num_lobbies) (ConstLanLobbyBrowserPtr);
  30. const char* (*lobby_data) (LanLobbyBrowserPtr, unsigned index, const char* key);
  31. void (*refresh) (LanLobbyBrowserPtr, unsigned port);
  32. int (*is_refreshing) (ConstLanLobbyBrowserPtr);
  33. };
  34. #ifdef __cplusplus
  35. }
  36. #endif