123456789101112131415161718192021222324252627282930 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- namespace KairoEngine.Multiplayer
- {
- [System.Serializable]
- public class ClientData
- {
- [FoldoutGroup("@ToString()")] public int connectionId = -1;
- [FoldoutGroup("@ToString()")] public string playerName = "";
- [FoldoutGroup("@ToString()")] public bool isConnected = false;
- [FoldoutGroup("@ToString()"), ReadOnly] public int latency = 0;
- public ClientData(int connectionId, string playerName, bool isConnected)
- {
- this.connectionId = connectionId;
- this.playerName = playerName;
- this.isConnected = isConnected;
- }
- public override string ToString()
- {
- string idText = connectionId < 10 ? $"0{connectionId.ToString()}" : $"{connectionId}";
- if(!isConnected) idText = "XX";
- return $"{idText} : {playerName}";
- }
- }
- }
|