2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

56 рядки
1.1 KiB

  1. #ifndef IZ_APP_NET_H
  2. #define IZ_APP_NET_H
  3. #include "net/IZ_net.h"
  4. #include "IZ_subsystem.h"
  5. typedef enum {
  6. IZ_MESSAGE_KIND_ACTION_SYNC = 0,
  7. IZ_MESSAGE_KIND_STATE_SYNC = 1,
  8. } IZ_AppMessageKind;
  9. typedef struct {
  10. u8 index: 3;
  11. u8 state: 5;
  12. u16 value;
  13. } IZ_AppPlayerActionSyncMessage;
  14. typedef struct {
  15. u8 player_index: 3;
  16. f32 x;
  17. f32 y;
  18. f32 right;
  19. f32 up;
  20. } IZ_AppPlayerState;
  21. typedef struct {
  22. u8 message_kind; // player
  23. u64 client_elapsed_time; // for synchronization
  24. } IZ_AppMessageHeader;
  25. typedef struct {
  26. u8 player_actions_count;
  27. IZ_AppPlayerActionSyncMessage player[];
  28. } IZ_AppPlayerActionSection;
  29. typedef struct {
  30. IZ_AppMessageHeader header;
  31. IZ_AppPlayerActionSection action;
  32. } IZ_AppActionSyncMessage;
  33. typedef struct {
  34. IZ_AppMessageHeader header;
  35. IZ_AppPlayerState player_state[IZ_PLAYERS];
  36. IZ_AppPlayerActionSection player_actions;
  37. } IZ_AppStateSyncMessage;
  38. struct IZ_App;
  39. void IZ_AppBindConnection(struct IZ_App*, struct lws*);
  40. void IZ_AppHandleOutboundNetworking(struct IZ_App*);
  41. IZ_ProcedureResult IZ_AppRunNetworkingThread(struct IZ_App*);
  42. #endif