StringKeyDictionary Resulting in two clients getting an entry on the same key
Hey guys!
So we use a StringKeyDictionary for a task system whereby players all race to put an identical key (the task's nametag basically e.g. "round 1 / generateCourse") into the dictionary with a "claimModel" that they put their own client ID into
However, when we've been testing and logging it appears like the transactional side of the dictionary is failing and:
UniTask<bool> TryClaimTaskAsync(string taskKey, GSGTaskClaimModel claim)
{
var tcs = new UniTaskCompletionSource<bool>();
model.taskDictionary.Insert(taskKey, claim, success => tcs.TrySetResult(success));
return tcs.Task;
}
is coming back successful for multiple clients.
The docs appear to say pretty specifically that this shouldn't be the case so I'm thinking we're missing something fundamental here.
Any clarity on the system would be a huge help!
Happy to provide any more context you guys need
So we use a StringKeyDictionary for a task system whereby players all race to put an identical key (the task's nametag basically e.g. "round 1 / generateCourse") into the dictionary with a "claimModel" that they put their own client ID into
However, when we've been testing and logging it appears like the transactional side of the dictionary is failing and:
UniTask<bool> TryClaimTaskAsync(string taskKey, GSGTaskClaimModel claim)
{
var tcs = new UniTaskCompletionSource<bool>();
model.taskDictionary.Insert(taskKey, claim, success => tcs.TrySetResult(success));
return tcs.Task;
}
is coming back successful for multiple clients.
The docs appear to say pretty specifically that this shouldn't be the case so I'm thinking we're missing something fundamental here.
Any clarity on the system would be a huge help!
Happy to provide any more context you guys need