diff --git a/Code/Network/NetworkDependencies/Connection.cpp b/Code/Network/NetworkDependencies/Connection.cpp index bddfe850..0dd2da98 100644 --- a/Code/Network/NetworkDependencies/Connection.cpp +++ b/Code/Network/NetworkDependencies/Connection.cpp @@ -98,13 +98,10 @@ bool Connection::Send(const unsigned char message[]) { int nBytes; unsigned long messageSize = strlen((char*)message); -<<<<<<< HEAD - if((nBytes = send(mySocket, (char*)message , messageSize, 0)) == SOCKET_ERROR) -======= + messageSize = 18; nBytes = send(mySocket, (char*)message , messageSize, 0); if(nBytes == SOCKET_ERROR) ->>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af { //Send failed! return false; diff --git a/Code/Network/NetworkDependencies/Connection.h b/Code/Network/NetworkDependencies/Connection.h index 3246f431..109d761c 100644 --- a/Code/Network/NetworkDependencies/Connection.h +++ b/Code/Network/NetworkDependencies/Connection.h @@ -23,15 +23,10 @@ namespace Oyster virtual bool InitiateServer( unsigned short port ); virtual void Disconnect(); -<<<<<<< HEAD - virtual bool Send(const unsigned char message[]); - virtual int Recieve(char unsigned message[]); -======= virtual bool Send(const unsigned char message[]); virtual int Recieve(unsigned char message[]); ->>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af virtual int Listen(); private: diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp index a558e7f5..a48a990e 100644 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp +++ b/Code/Network/OysterNetworkClient/ClientMain.cpp @@ -31,15 +31,7 @@ int main() //Connect to server client.Connect(9876, "127.0.0.1"); - unsigned char* recvBuffer = new unsigned char[255]; - -<<<<<<< HEAD - client.Send(recvBuffer); - - //chat(client); -======= chat(client); ->>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af //Recieve message //client.Recv(msgRecv); @@ -66,18 +58,13 @@ void ShutdownSockets() void chat(Client client) { -<<<<<<< HEAD - unsigned char msgRecv[255] = "\0"; - unsigned char msgSend[255] = "\0"; -======= Oyster::Network::Translator *t = new Oyster::Network::Translator(); unsigned char msgRecv[255] = "\0"; string msgSend = ""; - ProtocolHeader header; + ProtocolHeader* header; ProtocolTest test; ->>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af bool chatDone = false; @@ -87,30 +74,16 @@ void chat(Client client) header = t->Translate(msgRecv); - switch(header.packageType) + switch(header->packageType) { case package_type_header: break; - case package_type_test: cout <<"Client 2: " <<((ProtocolTest*)&header)->textMessage <>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af } test.packageType = package_type_test; diff --git a/Code/Network/OysterNetworkServer/ServerMain.cpp b/Code/Network/OysterNetworkServer/ServerMain.cpp index 2f301c63..a75c4228 100644 --- a/Code/Network/OysterNetworkServer/ServerMain.cpp +++ b/Code/Network/OysterNetworkServer/ServerMain.cpp @@ -40,12 +40,8 @@ int main() Client client2(clientSocket); cout << "Second client connected." << endl; -<<<<<<< HEAD client1.Send((unsigned char*)"Hej"); ProtocolHeader* header = NULL; -======= - client1.Send((unsigned char*) "Hej"); ->>>>>>> 4142688f6c4a63aa97341205588ad6cace0f43af while(1) {