mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
TEngine 6
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
internal class RemotePlayerSession
|
||||
{
|
||||
private readonly List<DebugReport> _reportList = new List<DebugReport>();
|
||||
private readonly Queue<DebugReport> _reports = new Queue<DebugReport>();
|
||||
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
@@ -29,7 +30,7 @@ namespace YooAsset.Editor
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = _reportList.Count - 1;
|
||||
int index = _reports.Count - 1;
|
||||
if (index < 0)
|
||||
index = 0;
|
||||
return index;
|
||||
@@ -37,7 +38,7 @@ namespace YooAsset.Editor
|
||||
}
|
||||
|
||||
|
||||
public RemotePlayerSession(int playerId, int maxReportCount = 1000)
|
||||
public RemotePlayerSession(int playerId, int maxReportCount = 500)
|
||||
{
|
||||
PlayerId = playerId;
|
||||
MaxReportCount = maxReportCount;
|
||||
@@ -48,7 +49,7 @@ namespace YooAsset.Editor
|
||||
/// </summary>
|
||||
public void ClearDebugReport()
|
||||
{
|
||||
_reportList.Clear();
|
||||
_reports.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -59,9 +60,9 @@ namespace YooAsset.Editor
|
||||
if (report == null)
|
||||
Debug.LogWarning("Invalid debug report data !");
|
||||
|
||||
if (_reportList.Count >= MaxReportCount)
|
||||
_reportList.RemoveAt(0);
|
||||
_reportList.Add(report);
|
||||
if (_reports.Count >= MaxReportCount)
|
||||
_reports.Dequeue();
|
||||
_reports.Enqueue(report);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,11 +70,11 @@ namespace YooAsset.Editor
|
||||
/// </summary>
|
||||
public DebugReport GetDebugReport(int rangeIndex)
|
||||
{
|
||||
if (_reportList.Count == 0)
|
||||
if (_reports.Count == 0)
|
||||
return null;
|
||||
if (rangeIndex < 0 || rangeIndex >= _reportList.Count)
|
||||
if (rangeIndex < 0 || rangeIndex >= _reports.Count)
|
||||
return null;
|
||||
return _reportList[rangeIndex];
|
||||
return _reports.ElementAt(rangeIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user