created additional structures + handled being hit
This commit is contained in:
parent
34938eed49
commit
45618e6934
19
server.c
19
server.c
|
@ -19,7 +19,22 @@ typedef struct
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
float z;
|
float z;
|
||||||
|
} TPosition;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
float w;
|
||||||
|
} TRotation;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
TPosition position;
|
||||||
|
TRotation rotation;
|
||||||
char shoot;
|
char shoot;
|
||||||
|
char hit;
|
||||||
} TFloat;
|
} TFloat;
|
||||||
|
|
||||||
void Error(int err);
|
void Error(int err);
|
||||||
|
@ -164,9 +179,9 @@ void *dataProcessHandler(void *data)
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (recvfrom(info->socket, &floats, 13, 0, (struct sockaddr *)&tmp, &addrLen) != 13)
|
if (recvfrom(info->socket, &floats, 30, 0, (struct sockaddr *)&tmp, &addrLen) != 30)
|
||||||
continue;
|
continue;
|
||||||
sendto(info->socket, &floats, 13, 0, (struct sockaddr *)&info->address, sizeof(info->address));
|
sendto(info->socket, &floats, 30, 0, (struct sockaddr *)&info->address, sizeof(info->address));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue