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