Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2007, 6:02:07 PM (16 years ago)
Author:
nicolasc
Message:

added copyright notice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ConnectionManager.cc

    r505 r514  
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *
     4 *
     5 *   License notice:
     6 *
     7 *   This program is free software; you can redistribute it and/or
     8 *   modify it under the terms of the GNU General Public License
     9 *   as published by the Free Software Foundation; either version 2
     10 *   of the License, or (at your option) any later version.
     11 *
     12 *   This program is distributed in the hope that it will be useful,
     13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 *   GNU General Public License for more details.
     16 *
     17 *   You should have received a copy of the GNU General Public License
     18 *   along with this program; if not, write to the Free Software
     19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     20 *
     21 *   Author:
     22 *      Oliver Scheuss, (C) 2007
     23 *   Co-authors:
     24 *      ...
     25 *
     26 */
     27
    128//
    229// C++ Interface: ConnectionManager
     
    2451
    2552  boost::thread_group network_threads;
    26  
     53
    2754  ConnectionManager::ConnectionManager(ClientInformation *head){
    2855    quit=false;
     
    5279        return NULL;
    5380  }
    54  
     81
    5582  ENetPacket *ConnectionManager::getPacket(int &clientID){
    5683    ENetAddress address;
     
    82109    return true;
    83110  }
    84  
     111
    85112  bool ConnectionManager::addPacket(ENetPacket *packet, int clientID){
    86113    if(enet_peer_send(head_->findClient(clientID)->getPeer(), clientID, packet)!=0)
     
    88115    return true;
    89116  }
    90  
     117
    91118  bool ConnectionManager::addPacketAll(ENetPacket *packet){
    92119    for(ClientInformation *i=head_->next(); i!=0; i=i->next()){
     
    105132      return false;
    106133  }
    107  
     134
    108135  bool ConnectionManager::sendPackets(){
    109136    ENetEvent event;
     
    155182    enet_host_destroy(server);
    156183  }
    157  
     184
    158185  void ConnectionManager::disconnectClients(){
    159186    ENetEvent event;
     
    190217//     return clientDisconnect(*peer);
    191218//   }
    192  
    193  
    194  
     219
     220
     221
    195222  bool ConnectionManager::clientDisconnect(ENetPeer *peer){
    196223    return head_->removeClient(peer);
     
    205232    return true;
    206233  }
    207  
     234
    208235  int ConnectionManager::getClientID(ENetPeer peer){
    209236    return getClientID(peer.address);
    210237  }
    211  
     238
    212239  int ConnectionManager::getClientID(ENetAddress address){
    213240    return head_->findClient(&address)->getID();
    214241  }
    215  
     242
    216243  ENetPeer *ConnectionManager::getClientPeer(int clientID){
    217244    return head_->findClient(clientID)->getPeer();
    218245  }
    219  
     246
    220247  void ConnectionManager::syncClassid(int clientID){
    221248    int i=0;
     
    235262    sendPackets();
    236263  }
    237  
     264
    238265}
Note: See TracChangeset for help on using the changeset viewer.