Changeset 2908 for code/branches/questsystem5/src/network
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/network/ChatListener.cc
r2907 r2908 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/Core.h" 32 33 33 34 namespace orxonox -
code/branches/questsystem5/src/network/Client.cc
r2907 r2908 45 45 #include "Host.h" 46 46 #include "synchronisable/Synchronisable.h" 47 #include "core/Clock.h"48 47 #include "core/CoreIncludes.h" 49 48 #include "packet/Packet.h" … … 139 138 * @param time 140 139 */ 141 void Client:: update(const Clock&time){140 void Client::tick(float time){ 142 141 // COUT(3) << "."; 143 142 if(client_connection.isConnected() && isSynched_){ -
code/branches/questsystem5/src/network/Client.h
r2907 r2908 76 76 //bool sendChat(packet::Chat *chat); 77 77 78 void update(const Clock&time);78 void tick(float time); 79 79 80 80 private: -
code/branches/questsystem5/src/network/ClientConnectionListener.cc
r2907 r2908 1 /*2 * ORXONOX - the hottest 3D action shooter ever to exist3 * > www.orxonox.net <4 *5 *6 * License notice:7 *8 * This program is free software; you can redistribute it and/or9 * modify it under the terms of the GNU General Public License10 * as published by the Free Software Foundation; either version 211 * 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 of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.21 *22 * Author:23 * Oliver Scheuss24 * Co-authors:25 * ...26 *27 */28 29 1 #include "ClientConnectionListener.h" 30 2 #include "core/CoreIncludes.h" 31 #include "core/ GameMode.h"3 #include "core/Core.h" 32 4 33 5 namespace orxonox{ … … 39 11 40 12 void ClientConnectionListener::getConnectedClients(){ 41 if( GameMode::showsGraphics())13 if(Core::showsGraphics()) 42 14 this->clientConnected(0); //server client id 43 15 ClientInformation *client = ClientInformation::getBegin(); -
code/branches/questsystem5/src/network/ConnectionManager.cc
r2907 r2908 48 48 #include <boost/thread/recursive_mutex.hpp> 49 49 50 #include "util/Debug.h"51 50 #include "util/Math.h" 52 51 #include "util/Sleep.h" -
code/branches/questsystem5/src/network/Server.cc
r2907 r2908 51 51 #include "ClientInformation.h" 52 52 #include "util/Sleep.h" 53 #include "core/Clock.h"54 53 #include "core/ConsoleCommand.h" 55 54 #include "core/CoreIncludes.h" … … 150 149 * @param time time since last tick 151 150 */ 152 void Server:: update(const Clock&time) {151 void Server::tick(float time) { 153 152 processQueue(); 154 153 //this steers our network frequency 155 timeSinceLastUpdate_+=time .getDeltaTime();154 timeSinceLastUpdate_+=time; 156 155 if(timeSinceLastUpdate_>=NETWORK_PERIOD){ 157 156 timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD; -
code/branches/questsystem5/src/network/Server.h
r2907 r2908 53 53 const int CLIENTID_SERVER = 0; 54 54 const unsigned int NETWORK_FREQUENCY = 25; 55 const float NETWORK_PERIOD = 1. f/NETWORK_FREQUENCY;55 const float NETWORK_PERIOD = 1./NETWORK_FREQUENCY; 56 56 57 57 /** … … 71 71 bool processChat(const std::string& message, unsigned int playerID); 72 72 bool queuePacket(ENetPacket *packet, int clientID); 73 void update(const Clock&time);73 void tick(float time); 74 74 unsigned int getPing(unsigned int clientID); 75 75 double getPacketLoss(unsigned int clientID); -
code/branches/questsystem5/src/network/TrafficControl.cc
r2907 r2908 30 30 31 31 #include "synchronisable/Synchronisable.h" 32 #include "core/CoreIncludes.h"33 32 #include "core/ConfigValueIncludes.h" 34 33 -
code/branches/questsystem5/src/network/packet/Gamestate.cc
r2907 r2908 34 34 #include "../synchronisable/Synchronisable.h" 35 35 #include "../TrafficControl.h" 36 #include "core/ GameMode.h"36 #include "core/Core.h" 37 37 #include "core/CoreIncludes.h" 38 38 #include "core/Iterator.h" … … 162 162 if(!s) 163 163 { 164 if (! GameMode::isMaster())164 if (!Core::isMaster()) 165 165 { 166 166 Synchronisable::fabricate(mem, mode); -
code/branches/questsystem5/src/network/packet/Gamestate.h
r2907 r2908 35 35 #include "Packet.h" 36 36 #include "network/TrafficControl.h" 37 #include <string.h>37 #include "core/CoreIncludes.h" 38 38 #include <map> 39 39 #include <list> 40 #include <cassert>41 40 #ifndef NDEBUG 42 41 #include "util/CRC32.h" -
code/branches/questsystem5/src/network/synchronisable/NetworkCallback.h
-
code/branches/questsystem5/src/network/synchronisable/Synchronisable.cc
-
code/branches/questsystem5/src/network/synchronisable/Synchronisable.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/network/synchronisable/SynchronisableVariable.cc
r2907 r2908 30 30 #include <cstring> 31 31 #include "util/Math.h" 32 #include "core/GameMode.h"33 32 34 33 … … 37 36 uint8_t SynchronisableVariableBase::state_ = 0; 38 37 39 /*static*/ void SynchronisableVariableBase::setState()40 {41 if ( state_ == 0x0 )42 {43 state_ = GameMode::isMaster() ? 0x1 : 0x2; // set the appropriate mode here44 }45 }46 38 47 39 -
code/branches/questsystem5/src/network/synchronisable/SynchronisableVariable.h
r2907 r2908 35 35 #include <string> 36 36 #include <cassert> 37 #include "util/Math.h" 37 #include "core/Core.h" 38 #include "core/CoreIncludes.h" 38 39 #include "network/synchronisable/NetworkCallback.h" 39 40 #include "network/synchronisable/NetworkCallbackManager.h" … … 62 63 virtual ~SynchronisableVariableBase() {} 63 64 protected: 64 static void setState();65 65 static uint8_t state_; 66 66 }; … … 110 110 variable_( variable ), mode_( syncDirection ), callback_( cb ) 111 111 { 112 setState(); 112 if ( state_ == 0x0 ) 113 { 114 state_ = Core::isMaster() ? 0x1 : 0x2; // set the appropriate mode here 115 } 113 116 } 114 117
Note: See TracChangeset
for help on using the changeset viewer.