From e0456fad5c96f4a272accecb0781d9a32e6d2cf4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 15 Feb 2018 10:18:49 +0100 Subject: proto/ft: work with npclient logic DataID can be idempotent. It's "static unsigned frameno" in npclient that's used in place of DataID. --- proto-ft/ftnoir_protocol_ft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proto-ft') diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index ae8fe5a2..d240cc8d 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, 2017 Stanislaw Halik +/* Copyright (c) 2013-2018 Stanislaw Halik * Copyright (c) 2015 Wim Vriend * * Permission to use, copy, modify, and/or distribute this software for any @@ -97,7 +97,7 @@ void freetrack::pose(const double* headpose) const std::int32_t id = load(ft->GameID); - store(data->DataID, 60 * 10 + (rand() % 64)); + store(data->DataID, 60 * 5); if (intGameID != id) { -- cgit v1.2.3 From d9b56a39bf966e3eddf35b02a9400a3556823750 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 16 Feb 2018 12:39:32 +0100 Subject: proto/ft: fix idempotent dataid for freetrackclient It can cause problems for `freetrackclient.dll' consumers. This fix is better than modulo rand(). --- proto-ft/ftnoir_protocol_ft.cpp | 5 ++++- proto-ft/ftnoir_protocol_ft.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'proto-ft') diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index d240cc8d..0c97ffd2 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -97,7 +97,10 @@ void freetrack::pose(const double* headpose) const std::int32_t id = load(ft->GameID); - store(data->DataID, 60 * 5); + data_id++; + data_id %= 128; + + store(data->DataID, 60 * 5 + data_id); if (intGameID != id) { diff --git a/proto-ft/ftnoir_protocol_ft.h b/proto-ft/ftnoir_protocol_ft.h index ac82bbd9..843d1f34 100644 --- a/proto-ft/ftnoir_protocol_ft.h +++ b/proto-ft/ftnoir_protocol_ft.h @@ -54,6 +54,7 @@ private: int intGameID = -1; QString connected_game; QMutex game_name_mutex; + unsigned data_id = 0; void start_dummy(); static float degrees_to_rads(double degrees); -- cgit v1.2.3