Changeset 1709 for code/branches/network/src
- Timestamp:
- Sep 4, 2008, 10:47:04 PM (16 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Server.cc
r1705 r1709 265 265 COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->getFailures() << std::endl; 266 266 temp->addFailure(); 267 /*if(temp->getFailures() > 0 )268 disconnectClient(temp);*/269 //std::cout << "added gamestate" << std::endl;270 267 }else 271 268 temp->resetFailures(); -
code/branches/network/src/network/packet/Packet.cc
r1705 r1709 9 9 #include "Chat.h" 10 10 #include "ClassID.h" 11 #include "Gamestate.h" 11 12 #include "network/Host.h" 12 13 #include "core/CoreIncludes.h" … … 39 40 clientID_ = ClientInformation::findClient(&peer->address)->getID(); 40 41 packetContent_ = createPacketContent(packet); 41 delete packet;42 enet_packet_destroy(packet); 42 43 delete peer; 43 44 } … … 88 89 case ENUM::Gamestate: 89 90 // TODO: remove brackets 90 // packetContent_ = new Gamestate( data);91 packetContent_ = new Gamestate( data, true, clientID_ ); 91 92 break; 92 93 default: -
code/branches/network/src/network/packet/Packet.h
r1705 r1709 60 60 Packet(PacketContent *content); 61 61 Packet(ENetPacket *packet, ENetPeer *peer); 62 ~Packet();62 virtual ~Packet(); 63 63 64 64 int getClientID(){ return clientID_; } -
code/branches/network/src/network/packet/Welcome.cc
r1705 r1709 1 1 #include "Welcome.h" 2 2 #include "Packet.h" 3 #include <assert.h> 3 4 4 5 namespace network { … … 14 15 { 15 16 flags_ = flags_ | PACKET_FLAGS_CLASSID; 17 assert(getSize()); 16 18 data_=new unsigned char[ getSize() ]; 17 if(!data_) 18 return; 19 assert(data_); 19 20 *(packet::ENUM::Type *)&data_[ _PACKETID ] = packet::ENUM::Welcome; 20 21 *(unsigned int *)&data_[ _CLIENTID ] = clientID; -
code/branches/network/src/network/packet/Welcome.h
r1705 r1709 42 42 Welcome( unsigned int clientID, unsigned int shipID ); 43 43 Welcome( unsigned char* data, int clientID ); 44 ~Welcome();44 virtual ~Welcome(); 45 45 46 46 unsigned char *getData();
Note: See TracChangeset
for help on using the changeset viewer.