/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Christoph Renner rennerc@ee.ethz.ch co-programmer: Patrick Boenzli boenzlip@orxonox.ethz.ch June 2006: finishing work on the network stream for pps presentation (rennerc@ee.ethz.ch) July 2006: some code rearangement and integration of the proxy server mechanism (boenzlip@ee.ethz.ch) */ #define DEBUG_MODULE_NETWORK #include "peer_info.h" /** * constructor */ PeerInfo::PeerInfo() { this->clear(); } /** * clearint and initializing the peer info */ void PeerInfo::clear() { this->userId = 0; this->nodeType = NET_CLIENT; this->socket = NULL; this->handshake = NULL; this->lastAckedState = 0; this->lastRecvedState = 0; this->connectionMonitor = NULL; this->ip = IP(0,0); } const std::string& PeerInfo::getNodeTypeString() const { return PeerInfo::nodeTypeToString( this->nodeType ); // the above does the same, and is faster in it. (there is no case where node is uninit i hope!) } const std::string& PeerInfo::nodeTypeToString(unsigned int type) { return PeerInfo::nodeNames[type]; } const std::string PeerInfo::nodeNames[] = { "maser server", "proxy server active", "proxy server passive", "client", "node is not initialized" };