mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
[Game] [Arrows] Use arrowData/registry and generate unique server-side ids (#6973)
* [Game] [Arrows] Track creatorId, use arrowData in arrowItem, use registry, generate unique arrow id's on server side and delete-on-exist inserts. Took 2 minutes Took 1 minute * Fix emitting slot instead of signal. Took 15 minutes * Clear arrows locally in special circumstances i.e. teardown. Took 28 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
c14a008080
commit
23da49ee5b
19 changed files with 225 additions and 148 deletions
|
|
@ -74,7 +74,7 @@ PlayerLogic::~PlayerLogic()
|
|||
|
||||
void PlayerLogic::clear()
|
||||
{
|
||||
emit arrowsCleared();
|
||||
emit arrowsClearedLocally();
|
||||
|
||||
QMapIterator<QString, CardZoneLogic *> i(zones);
|
||||
while (i.hasNext()) {
|
||||
|
|
@ -115,7 +115,7 @@ void PlayerLogic::processPlayerInfo(const ServerInfo_Player &info)
|
|||
/* HandZone */
|
||||
ZoneNames::HAND};
|
||||
clearCounters();
|
||||
emit arrowsCleared();
|
||||
emit arrowsClearedLocally();
|
||||
|
||||
QMutableMapIterator<QString, CardZoneLogic *> zoneIt(zones);
|
||||
while (zoneIt.hasNext()) {
|
||||
|
|
@ -231,7 +231,8 @@ void PlayerLogic::processCardAttachment(const ServerInfo_Player &info)
|
|||
|
||||
const int arrowListSize = info.arrow_list_size();
|
||||
for (int i = 0; i < arrowListSize; ++i) {
|
||||
emit arrowCreateRequested(ArrowData::fromProto(info.arrow_list(i)));
|
||||
emit arrowCreateRequested(QSharedPointer<ArrowData>::create(
|
||||
ArrowData::fromProto(info.arrow_list(i), getPlayerInfo()->getId(), getPlayerInfo()->getLocal())));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue