00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __CLIENT_CONN_SRVR_H__
00014 #define __CLIENT_CONN_SRVR_H__
00015
00016
00017 #include "shared_types.h"
00018
00019
00020 #include <ltengineobjects.h>
00021 #include <autoview/autoview.h>
00022
00024 class CPlayerSrvr;
00025
00027 class CClientConnSrvr : public BaseClass
00028 {
00029 public:
00030
00031 CClientConnSrvr();
00032 virtual ~CClientConnSrvr();
00033
00034 distr_class(CClientConnSrvr);
00035
00036 uint32 EngineMessageFn(uint32 messageID, void *pData, float fData);
00037 uint32 ObjectMessageFn(HOBJECT hSender, uint32 messageID, HMESSAGEREAD hRead);
00038
00039
00040 virtual void RemotePositionUpdate(LTVector3f& newPosition);
00041 virtual void RemoteRotationUpdate(LTOrientation& newOrientation);
00042 virtual void RemoteVelocityUpdate(LTVector3f& newVelocity);
00043 virtual void RemoteAngularVelocityUpdate(LTVector3f& newAngVelocity);
00044
00045 void SetClient(HCLIENT hClient) { m_hClient = hClient; };
00046
00047 void OnClientMessage(uint8 messageID, ILTMessage* pMessage);
00048
00049 protected:
00050
00051
00052 uint32 PreCreate(void *pData, float fData);
00053 void ObjectCreated();
00054 void Update();
00055
00056 void GetForceUpdateObjects(ForceUpdate* pForceUpdate);
00057
00058
00059
00060 BaseClass* AddPlayer();
00061 void FirstUpdate();
00062 void CallbackPlayers(const uint32& nOldVal);
00063
00064
00065
00066
00067 bool m_bFirstUpdate;
00068
00069 HCLIENT m_hClient;
00070
00071 CPlayerSrvr* m_pPlayers[MAX_CLIENT_PLAYERS];
00072
00073 distr_callback_fn(CClientConnSrvr, uint32, m_nPlayers, CallbackPlayers);
00074 distr_uint32_callback(m_nPlayers, AVITEM_REG, 10, 0);
00075
00076 distr_uint32(m_nClientID, AVITEM_REG, 11, 0);
00077 };
00078
00079
00080 #endif // __CLIENT_CONN_SRVR_H__