增加自定义不是房间的消息发送
This commit is contained in:
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
|
||||
public interface IGlobalConfigSystem : ISystem
|
||||
{
|
||||
public string IP { get; }
|
||||
public string GetConnectionId();
|
||||
public void SetConnectionId(string connectionId);
|
||||
|
||||
@@ -21,6 +22,9 @@ public interface IGlobalConfigSystem : ISystem
|
||||
|
||||
public Texture2D GetConnectionTexture();
|
||||
public void SetConnectionTexture(Texture2D connectionTexture);
|
||||
|
||||
public string GetUserId();
|
||||
public void SetUserId(string userId);
|
||||
}
|
||||
|
||||
public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
@@ -53,11 +57,19 @@ public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
private CancellationTokenSource _cts;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
private string _userId;
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public string IP => "http://127.0.0.1:8080";
|
||||
|
||||
public string GetConnectionId()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_connectionId))
|
||||
@@ -143,6 +155,22 @@ public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
_connectionTexture = connectionTexture;
|
||||
}
|
||||
|
||||
public string GetUserId()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_userId))
|
||||
{
|
||||
Debug.LogWarning("GlobalConfigSystem: GetUserId not set");
|
||||
return "";
|
||||
}
|
||||
|
||||
return _userId;
|
||||
}
|
||||
|
||||
public void SetUserId(string userId)
|
||||
{
|
||||
_userId = userId;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user