NetworkingExampleGlobals.h 534 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #define MAX_PLAYERS 4
  3. #define PLAYER_SHOOT 32
  4. #define SERVER_INFO 42
  5. #define CLIENT_READY 43
  6. #define PLAYER_JOIN 44
  7. typedef struct {
  8. float posX;
  9. float posY;
  10. float angle;
  11. char state;
  12. int clientID;
  13. }ServerClientInfo;
  14. #define NOT_TURNING 0
  15. #define TURNING_LEFT 1
  16. #define TURNING_RIGHT 2
  17. typedef struct {
  18. char thrusting;
  19. char turning_state;
  20. } ClientData;
  21. typedef struct {
  22. ServerClientInfo players[MAX_PLAYERS];
  23. } ServerState;
  24. typedef struct {
  25. char motd[256];
  26. ServerState initialServerState;
  27. } ServerInfo;