mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 17:52:26 +02:00
add the base of the assignment-server
This commit is contained in:
parent
e59dbfd99b
commit
b9c1525321
4 changed files with 49 additions and 0 deletions
|
@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8)
|
|||
project(hifi)
|
||||
|
||||
add_subdirectory(animation-server)
|
||||
add_subdirectory(assignment-server)
|
||||
add_subdirectory(avatar-mixer)
|
||||
add_subdirectory(audio-mixer)
|
||||
add_subdirectory(domain-server)
|
||||
|
|
13
assignment-server/CMakeLists.txt
Normal file
13
assignment-server/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(TARGET_NAME assignment-server)
|
||||
|
||||
set(ROOT_DIR ..)
|
||||
set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
|
||||
|
||||
include(${MACRO_DIR}/SetupHifiProject.cmake)
|
||||
setup_hifi_project(${TARGET_NAME})
|
||||
|
||||
# link in the shared library
|
||||
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
|
||||
link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR})
|
33
assignment-server/src/main.cpp
Normal file
33
assignment-server/src/main.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// main.cpp
|
||||
// assignment-server
|
||||
//
|
||||
// Created by Stephen Birarda on 7/1/13.
|
||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <PacketHeaders.h>
|
||||
#include <UDPSocket.h>
|
||||
|
||||
const int ASSIGNMENT_SERVER_LISTEN_PORT = 7007;
|
||||
const int MAX_PACKET_SIZE_BYTES = 1400;
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
|
||||
sockaddr_in senderSocket;
|
||||
char senderData[MAX_PACKET_SIZE_BYTES] = {};
|
||||
ssize_t receivedBytes = 0;
|
||||
|
||||
UDPSocket serverSocket(ASSIGNMENT_SERVER_LISTEN_PORT);
|
||||
|
||||
while (true) {
|
||||
if (serverSocket.receive((sockaddr*) &senderSocket, &senderData, &receivedBytes)) {
|
||||
if (senderData[0] == PACKET_HEADER_REQUEST_ASSIGNMENT) {
|
||||
// for now just send back a dummy assignment packet
|
||||
serverSocket.send((sockaddr*) &senderSocket, &PACKET_HEADER_SEND_ASSIGNMENT, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,8 @@ const PACKET_HEADER PACKET_HEADER_TRANSMITTER_DATA_V2 = 'T';
|
|||
const PACKET_HEADER PACKET_HEADER_ENVIRONMENT_DATA = 'e';
|
||||
const PACKET_HEADER PACKET_HEADER_DOMAIN_LIST_REQUEST = 'L';
|
||||
const PACKET_HEADER PACKET_HEADER_DOMAIN_REPORT_FOR_DUTY = 'C';
|
||||
const PACKET_HEADER PACKET_HEADER_REQUEST_ASSIGNMENT = 'r';
|
||||
const PACKET_HEADER PACKET_HEADER_SEND_ASSIGNMENT = 's';
|
||||
|
||||
|
||||
// These are supported Z-Command
|
||||
|
|
Loading…
Reference in a new issue