コード例 #1
0
        public static PlayerPayload FromPlayerConnection(PlayerConnection connection)
        {
            var payload = new PlayerPayload();

            PlayerDetail playerDetail;

            if (PlayerInfoManager.Instance.GetPlayer(connection.SteamId, out playerDetail))
            {
                payload.playerName = playerDetail.PlayerName;
                payload.ping       = playerDetail.PingMs;
                payload.score      = playerDetail.Score;
                payload.playTime   = PlayerInfoManager.Instance.GetPlayTime(playerDetail.StartPlayTime);
            }

            payload.steamName = connection.SteamName;
            payload.steamId   = connection.SteamId.ToString();
            return(payload);
        }
コード例 #2
0
        public static PlayerPayload FromPlayerConnection(PlayerConnection connection)
        {
            var payload = new PlayerPayload();

            PlayerDetail playerDetail;

            if (PlayerInfoManager.Instance.GetPlayer(connection.SteamId, out playerDetail))
            {
                payload.playerName = playerDetail.PlayerName;
                payload.ping       = playerDetail.PingMs;
                payload.score      = playerDetail.Score;
                payload.playTime   = PlayerInfoManager.Instance.GetPlayTime(playerDetail.StartPlayTime);
            }

            payload.location = Vector3Payload.FromVector3(connection.Brain.ParentHuman.transform.position);

            payload.steamName = connection.SteamName;
            payload.steamId   = connection.SteamId.ToString();
            return(payload);
        }