SyncServerEventSenders.hpp   SyncServerEventSenders.hpp 
skipping to change at line 57 skipping to change at line 57
//! Use this to set clients to the current server state. //! Use this to set clients to the current server state.
//! The default implementation does nothing. //! The default implementation does nothing.
virtual void newClientConnected(SyncRemotePeer& client) { Q_UNUSED(c lient); } virtual void newClientConnected(SyncRemotePeer& client) { Q_UNUSED(c lient); }
protected: protected:
//! This is guaranteed to be called once per frame (usually after al l other StelModules have been updated). //! This is guaranteed to be called once per frame (usually after al l other StelModules have been updated).
//! It is can be used to defer state broadcasts until the frame is f inished to only send a single message. //! It is can be used to defer state broadcasts until the frame is f inished to only send a single message.
//! Default implentation does nothing. //! Default implentation does nothing.
virtual void update() {} virtual void update() {}
//! Subclasses can call this to broadcast a message to all valid con nected clients //! Subclasses can call this to broadcast a message to all valid con nected clients
void broadcastMessage(const SyncMessage& msg); void broadcastMessage(const SyncProtocol::SyncMessage& msg);
//! Free to use by sublasses. Recommendation: use to track if update () should broadcast a message. //! Free to use by sublasses. Recommendation: use to track if update () should broadcast a message.
bool isDirty; bool isDirty;
//! Direct access to StelCore //! Direct access to StelCore
StelCore* core; StelCore* core;
private: private:
SyncServer* server; SyncServer* server;
friend class SyncServer; friend class SyncServer;
}; };
//! This class provides a semi-automatic event sender using a specific mess age type. //! This class provides a semi-automatic event sender using a specific mess age type.
skipping to change at line 101 skipping to change at line 101
void TypedSyncServerEventSender<T>::update() void TypedSyncServerEventSender<T>::update()
{ {
if(isDirty) if(isDirty)
{ {
broadcastMessage(constructMessage()); broadcastMessage(constructMessage());
isDirty = false; isDirty = false;
} }
} }
//! Notifies clients of simulation time jumps and time scale changes //! Notifies clients of simulation time jumps and time scale changes
class TimeEventSender : public TypedSyncServerEventSender<Time> class TimeEventSender : public TypedSyncServerEventSender<SyncProtocol::Tim e>
{ {
Q_OBJECT Q_OBJECT
public: public:
TimeEventSender(); TimeEventSender();
protected: protected:
Time constructMessage() Q_DECL_OVERRIDE; SyncProtocol::Time constructMessage() Q_DECL_OVERRIDE;
}; };
class LocationEventSender : public TypedSyncServerEventSender<Location> class LocationEventSender : public TypedSyncServerEventSender<SyncProtocol: :Location>
{ {
Q_OBJECT Q_OBJECT
public: public:
LocationEventSender(); LocationEventSender();
protected: protected:
Location constructMessage() Q_DECL_OVERRIDE; SyncProtocol::Location constructMessage() Q_DECL_OVERRIDE;
}; };
class SelectionEventSender : public TypedSyncServerEventSender<Selection> class SelectionEventSender : public TypedSyncServerEventSender<SyncProtocol ::Selection>
{ {
Q_OBJECT Q_OBJECT
public: public:
SelectionEventSender(); SelectionEventSender();
protected: protected:
Selection constructMessage() Q_DECL_OVERRIDE; SyncProtocol::Selection constructMessage() Q_DECL_OVERRIDE;
private: private:
StelObjectMgr* objMgr; StelObjectMgr* objMgr;
}; };
class StelProperty;
class StelPropertyMgr;
class StelPropertyEventSender : public SyncServerEventSender
{
Q_OBJECT
public:
StelPropertyEventSender();
protected slots:
//! Sends all current StelProperties to the client
virtual void newClientConnected(SyncRemotePeer& client) Q_DECL_OVERR
IDE;
void sendStelPropChange(StelProperty* prop, const QVariant& val);
private:
StelPropertyMgr* propMgr;
};
class StelMovementMgr;
class ViewEventSender : public TypedSyncServerEventSender<SyncProtocol::Vie
w>
{
Q_OBJECT
public:
ViewEventSender();
protected:
SyncProtocol::View constructMessage() Q_DECL_OVERRIDE;
void update() Q_DECL_OVERRIDE;
private:
StelMovementMgr* mvMgr;
Vec3d lastView;
};
class FovEventSender : public TypedSyncServerEventSender<SyncProtocol::Fov>
{
Q_OBJECT
public:
FovEventSender();
protected:
SyncProtocol::Fov constructMessage() Q_DECL_OVERRIDE;
void update() Q_DECL_OVERRIDE;
private:
StelMovementMgr* mvMgr;
double lastFov;
};
#endif #endif
 End of changes. 8 change blocks. 
7 lines changed or deleted 53 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/