/* 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 co-programmer: */ /* this is for debug output. It just says, that all calls to PRINT() belong to the DEBUG_MODULE_NETWORK module For more information refere to https://www.orxonox.net/cgi-bin/trac.cgi/wiki/DebugOutput */ #define DEBUG_MODULE_NETWORK #include "handshake.h" #include Handshake::Handshake( bool server, int clientId, int networkGameManagerId ) : Synchronizeable() { /* set the class id for the base object */ this->setClassID(CL_HANDSHAKE, "Handshake"); this->setIsServer(server); this->localState.hostId = clientId; this->localState.networkManagerId = networkGameManagerId; orxId_handler = registerVarId( new SynchronizeableInt( &localState.orxId, &remoteState.orxId, "orxonoxId" ) ); version_handler = registerVarId( new SynchronizeableInt( &localState.version, &remoteState.version, "version" ) ); netManId_handler = registerVarId( new SynchronizeableInt( &localState.networkManagerId, &remoteState.networkManagerId, "networkManagerId" ) ); hostId_handler = registerVarId( new SynchronizeableInt( &localState.hostId, &remoteState.hostId, "hostId" ) ); completed_handler = registerVarId( new SynchronizeableInt( &localState.completed, &remoteState.completed, "completed" ) ); error_handler = registerVarId( new SynchronizeableInt( &localState.error, &remoteState.error, "error" ) ); errorString_handler = registerVarId( new SynchronizeableString( &localState.errorString, &remoteState.errorString, "errorString" ) ); this->setSynchronized(true); PRINTF(5)("Handshake created clientId = %d\n", clientId); } /** * handler for changes in synced vars * @param id id's which have changed */ void Handshake::varChangeHandler( std::list< int > & id ) { }