Add close connection
parent
466933babe
commit
b6ca4d3f1e
|
|
@ -772,7 +772,7 @@ RectTransform:
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 1000, y: 100}
|
m_SizeDelta: {x: 1000, y: 200}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1 &549377895
|
--- !u!1 &549377895
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ public class GameClient : MonoBehaviour
|
||||||
{
|
{
|
||||||
_kcpDofClient.OnConnected -= OnConnected;
|
_kcpDofClient.OnConnected -= OnConnected;
|
||||||
_kcpDofClient.OnServerMessage -= OnServerMessage;
|
_kcpDofClient.OnServerMessage -= OnServerMessage;
|
||||||
|
|
||||||
|
_kcpDofClient.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator _DelayCall(float delay_secs, Action callback)
|
IEnumerator _DelayCall(float delay_secs, Action callback)
|
||||||
|
|
@ -187,7 +189,7 @@ public class GameClient : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (msg.PlayerEntered != null)
|
if (msg.PlayerEntered != null)
|
||||||
{
|
{
|
||||||
infoText.text = $"Player Enter cid: {msg.PlayerEntered.Cid}, Waiting for player";
|
infoText.text = $"{nickName} Enter cid: {msg.PlayerEntered.Cid}, Waiting for other player";
|
||||||
goes[1].SetActive(false);
|
goes[1].SetActive(false);
|
||||||
}
|
}
|
||||||
else if (msg.GameStart != null)
|
else if (msg.GameStart != null)
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,11 @@ public class KcpDofClient : KcpListener
|
||||||
dataBuf.Release();
|
dataBuf.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
_kcpClient.stop();
|
||||||
|
}
|
||||||
|
|
||||||
public void onConnected(Ukcp ukcp)
|
public void onConnected(Ukcp ukcp)
|
||||||
{
|
{
|
||||||
Debug.Log($"[KcpDofClient]onConnected");
|
Debug.Log($"[KcpDofClient]onConnected");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue