예제 #1
0
        public async Task <PlayerNetworkObject> MatchMake(string pass)
        {
            self = new PlayerNetworkObject {
                Id        = storage == null ? 0 : storage.AllValues.Count,
                Position  = new float[] { 0, 0, 0 },
                Rotation  = new float[] { 0, 0, 0, 0 },
                Character = storage == null ? Character.BG72 : Character.SG27,
                Velocity  = new float[] { 0, 0, 0 }
            };
            if (storage != null)
            {
                if (storage.AllValues.Count > 1)
                {
                    return(null);
                }
            }
            (room, storage) = await Group.AddAsync(pass, self);

            if (storage.AllValues.Count == 2)
            {
                Broadcast(room).MatchMade(storage.AllValues.ToArray());
            }
            return(self);
        }
예제 #2
0
 public void PlayerStateUpdate(PlayerNetworkObject player)
 {
     State[player.Character] = player;
     Broadcast(room).OnPlayerStateUpdate(player);
 }