Updated the server to use the packet methods

This commit is contained in:
Kayne Ruse
2014-08-28 21:48:29 +10:00
parent ac799bc583
commit 164247de4f
5 changed files with 50 additions and 49 deletions
+3 -4
View File
@@ -21,8 +21,7 @@
*/
#include "server_application.hpp"
//for PACKET_BUFFER_SIZE
#include "serial.hpp"
#include "serial_packet.hpp"
//utility functions
#include "sql_utility.hpp"
@@ -179,7 +178,7 @@ void ServerApplication::Quit() {
//-------------------------
void ServerApplication::HandlePacket(SerialPacket* const argPacket) {
switch(argPacket->type) {
switch(argPacket->GetType()) {
//basic connections
case SerialPacketType::BROADCAST_REQUEST:
HandleBroadcastRequest(static_cast<SerialPacket*>(argPacket));
@@ -225,7 +224,7 @@ void ServerApplication::HandlePacket(SerialPacket* const argPacket) {
//handle errors
default: {
std::string msg = "Unknown SerialPacketType encountered in the server: ";
msg += to_string_custom(static_cast<int>(argPacket->type));
msg += to_string_custom(static_cast<int>(argPacket->GetType()));
throw(std::runtime_error(msg));
}
break;