1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "game_share/action.h"
25 using namespace CLFECOMMON
;
32 _PacketHistory
.setPropertyHistory(&_PropertyHistory
);
36 void CHistory::clear()
38 _PacketHistory
.clear();
39 _PropertyHistory
.clear();
42 void CHistory::setMaximumClient(uint maxClient
)
44 _MaxClientId
= maxClient
-1;
45 _PacketHistory
.setMaximumClient(maxClient
);
46 _PropertyHistory
.setMaximumClient(maxClient
);
50 void CHistory::addClient(TClientId clientId
)
52 _PacketHistory
.addClient(clientId
);
53 _PropertyHistory
.addClient(clientId
);
56 void CHistory::removeClient(TClientId clientId
)
58 _PacketHistory
.removeClient(clientId
);
59 _PropertyHistory
.removeClient(clientId
);
62 void CHistory::resetClient(TClientId clientId
)
64 _PacketHistory
.resetClient(clientId
);
65 _PropertyHistory
.resetClient(clientId
);
70 bool CHistory::addEntityToClient(TCLEntityId entityId
, TClientId clientId
)
72 return _PropertyHistory
.addEntityToClient(entityId
, clientId
);
75 void CHistory::removeEntityOfClient(TCLEntityId entityId
, TClientId clientId
)
77 _PropertyHistory
.removeEntityOfClient(entityId
, clientId
);
82 bool CHistory::packDelta(TClientId clientId, CAction *action)
84 return _ContinuousHistory.packDelta(clientId, *action, true);
88 void CHistory::store(TClientId clientId, uint32 packetNumber, CAction *action)
90 _PacketHistory.store(clientId, packetNumber, action);
91 _ContinuousHistory.updateProperty(clientId, packetNumber, *action);
95 void CHistory::ack(TClientId clientId
, uint32 packet
, uint32 bits
, uint ackBitWidth
)
97 _PacketHistory
.ack(clientId
, packet
, bits
, ackBitWidth
);
100 void CHistory::ack(TClientId clientId
, uint32 packet
, bool ackvalue
)
102 _PacketHistory
.ack(clientId
, packet
, ackvalue
);
108 void CHistory::setPropertyConversion(uint32 property, sint8 conversion) { _ContinuousHistory.setPropertyConversion(property, conversion); }
109 void CHistory::setPropertyConversion(CPropertyTranslation *properties, sint numProperties) { _ContinuousHistory.setPropertyConversion(properties, numProperties); }
110 void CHistory::setPositionPropertyId(uint32 id) { _ContinuousHistory.setPositionPropertyId(id); }
112 //bool CHistory::isContinuousProperty(uint32 property) { return _ContinuousHistory.isContinuousProperty(property); }