Example #1
0
        private byte GetSpawnIndex(uint actorId)
        {
            // local actor always has an index of 0
            if (actorId == Id)
            {
                return(0);
            }

            if (!spawnIndexLookup.TryGetValue(actorId, out byte index))
            {
                index = spawnIndex.DequeueValue();
                spawnIndexLookup.Add(actorId, index);
            }

            return(index);
        }
Example #2
0
 public static ulong GetNewCharacterId()
 {
     return(characterId.DequeueValue());
 }