Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 5, 2008, 11:32:42 PM (16 years ago)
Author:
scheusso
Message:

we use enetcallback for destroying packets now (unfortunately there are still some problems)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/packet/Chat.cc

    r1705 r1711  
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *                    > www.orxonox.net <
     4 *
     5 *
     6 *   License notice:
     7 *
     8 *   This program is free software; you can redistribute it and/or
     9 *   modify it under the terms of the GNU General Public License
     10 *   as published by the Free Software Foundation; either version 2
     11 *   of the License, or (at your option) any later version.
     12 *
     13 *   This program is distributed in the hope that it will be useful,
     14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 *   GNU General Public License for more details.
     17 *
     18 *   You should have received a copy of the GNU General Public License
     19 *   along with this program; if not, write to the Free Software
     20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     21 *
     22 *   Author:
     23 *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
     24 *   Co-authors:
     25 *      ...
     26 *
     27 */
     28
    129#include "Chat.h"
    2 #include "Packet.h"
     30#include <assert.h>
    331
    432namespace network {
     
    1139
    1240Chat::Chat( std::string& message, int clientID )
    13  : PacketContent()
     41 : Packet()
    1442{
    1543  flags_ = flags_ | PACKET_FLAGS_CHAT;
     
    2351
    2452Chat::Chat( unsigned char *data, int clientID )
    25   : PacketContent(data, clientID)
     53  : Packet(data, clientID)
    2654{
    2755  messageLength_ = *(unsigned int *)&data[ _MESSAGELENGTH ];
     
    3260}
    3361
    34 unsigned char *Chat::getData(){
    35   return data_;
    36 }
    37 
    3862unsigned int Chat::getSize() const{
    3963  return _MESSAGE + messageLength_;
     
    4266bool Chat::process(){
    4367  //TODO: change this !!!
     68  assert(0);
     69  delete this;
    4470  return true;
    4571}
Note: See TracChangeset for help on using the changeset viewer.