/* 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: Patrick Boenzli */ #define DEBUG_MODULE_NETWORK #include "shared_network_data.h" #include "netdefs.h" #include "state.h" #include "network_stream.h" #include "debug.h" ObjectListDefinition(SharedNetworkData); SharedNetworkData* SharedNetworkData::singletonRef = NULL; /** * Standard constructor */ SharedNetworkData::SharedNetworkData() { /* set the class id for the base object */ this->registerObject(this, SharedNetworkData::_objectList); this->nodeType = NET_MASTER_SERVER; this->hostID = -1; this->defaultSyncStream = NULL; // setUniqueID( maxCon+2 ) because we need one id for every handshake // and one for handshake to reject client maxCon+1 this->newUniqueID = 2; } /** * Standard destructor */ SharedNetworkData::~SharedNetworkData() { SharedNetworkData::singletonRef = NULL; } /** @return true if this user is connected to the local host */ bool SharedNetworkData::isUserLocal( int userID) { return this->defaultSyncStream->isUserLocal(userID); } /** @returns true if this user is a master server */ bool SharedNetworkData::isUserMasterServer( int userID ) { return this->defaultSyncStream->isUserMasterServer(userID); } /** @returns true if this user is a proxy server */ bool SharedNetworkData::isUserProxyServerActive( int userID ) { return this->defaultSyncStream->isUserProxyServerActive(userID); } /** @returns true if this user is a client */ bool SharedNetworkData::isUserClient( int userID ) { return this->defaultSyncStream->isUserClient(userID); }