2017-04-11 17:12:34 +00:00
|
|
|
/**************************
|
|
|
|
* Plane *
|
|
|
|
***************************
|
|
|
|
* Designed & Developed by *
|
|
|
|
* Adrien Marquès *
|
|
|
|
* <xdrm-brackets> *
|
|
|
|
***************************
|
|
|
|
* doowap31@gmail.com *
|
|
|
|
**************************/
|
2017-04-03 16:04:57 +00:00
|
|
|
#ifndef _PLANE_H_
|
|
|
|
#define _PLANE_H_
|
|
|
|
|
2017-04-08 17:25:44 +00:00
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2017-04-03 16:04:57 +00:00
|
|
|
#include "lib/header.h"
|
2017-04-18 08:36:32 +00:00
|
|
|
#include "lib/network/udp/server.h"
|
2017-04-08 17:25:44 +00:00
|
|
|
#include "lib/network/tcp/client.h"
|
|
|
|
|
2017-04-03 16:04:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define ALTMAX 20000
|
|
|
|
#define ALTMIN 0
|
|
|
|
|
|
|
|
#define VITMAX 1000
|
|
|
|
#define VITMIN 200
|
|
|
|
|
|
|
|
#define PAUSE 2
|
|
|
|
|
|
|
|
struct coord {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int z;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct control {
|
|
|
|
int cap;
|
|
|
|
int speed;
|
|
|
|
};
|
|
|
|
|
2017-04-12 07:57:59 +00:00
|
|
|
#define PLANE_DATA_LEN (sizeof(char)*6+sizeof(int)*5)
|
|
|
|
struct plane_data{
|
|
|
|
char code[6];
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int z;
|
|
|
|
int cap;
|
|
|
|
int spd;
|
|
|
|
};
|
|
|
|
|
2017-05-03 13:45:19 +00:00
|
|
|
#define REQ_FBK 0x01
|
2017-04-28 12:54:02 +00:00
|
|
|
#define REQ_CAP 0x02
|
|
|
|
#define REQ_SPD 0x04
|
|
|
|
#define REQ_ALT 0x08
|
|
|
|
|
|
|
|
struct sgca_req{
|
|
|
|
char flags;
|
|
|
|
int z;
|
|
|
|
int cap;
|
|
|
|
int spd;
|
|
|
|
};
|
|
|
|
|
2017-04-26 12:25:05 +00:00
|
|
|
#define BINDHDR_LEN ( sizeof(char)+sizeof(in_addr_t)+sizeof(unsigned short) )
|
2017-04-25 09:54:15 +00:00
|
|
|
#define BINDHEAD_UDP 0x01 // is terminal (ask for UDP socket)
|
|
|
|
#define BINDHEAD_TCP 0x02 // is plane (ask for TCP socket)
|
|
|
|
#define BINDHEAD_CTL 0x04 // is ctrlTerm (else: viewTerm)
|
2017-04-12 07:57:59 +00:00
|
|
|
|
|
|
|
struct bind_header{
|
|
|
|
char flags;
|
2017-04-26 12:25:05 +00:00
|
|
|
in_addr_t addr;
|
2017-04-13 18:01:56 +00:00
|
|
|
unsigned short port;
|
2017-04-12 07:57:59 +00:00
|
|
|
};
|
|
|
|
|
2017-04-03 16:04:57 +00:00
|
|
|
#endif
|