diff --git a/Assets/Temp/Scripts/Taskpanel.cs b/Assets/Temp/Scripts/Taskpanel.cs index 76e9ec0c..a5ded7fa 100644 --- a/Assets/Temp/Scripts/Taskpanel.cs +++ b/Assets/Temp/Scripts/Taskpanel.cs @@ -43,8 +43,6 @@ public class Taskpanel : MonoBehaviour void Start() { - AdamSync.SyncCreateRoom.leaveRoomRequset += OnGetLeaveRoomsInfo; - fanhui.onClick.AddListener(() => { GameMain.tiao = false; @@ -145,22 +143,11 @@ public class Taskpanel : MonoBehaviour } }); } - public void OnGetLeaveRoomsInfo(string msg) - { - Debug.Log("OnGetLeaveRoomsInfo====" + msg); - string[] info = msg.Split(','); - _ = SyncCreateRoom.SendMessageAsync($"send2room offline,{info[3]}"); - //SceneManager.LoadScene("SampleScene"); - } + public void OnLeaveRoom() { Debug.Log("Leaveroom"); - string msg = "leaveroom "; - _ = SyncCreateRoom.SendMessageAsync(msg); - } - // Update is called once per frame - void Update() - { - + _ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}"); } + } diff --git a/Assets/Zion/Scripts/Adam/GameManager.cs b/Assets/Zion/Scripts/Adam/GameManager.cs index 1c7a815a..c616062b 100644 --- a/Assets/Zion/Scripts/Adam/GameManager.cs +++ b/Assets/Zion/Scripts/Adam/GameManager.cs @@ -203,6 +203,8 @@ public class GameManager : MonoSingleton break; case "offline": RemovePlayer(ulong.Parse(data[1])); + string _msg = "leaveroom "; + _ = SyncCreateRoom.SendMessageAsync(_msg); SceneManager.LoadScene("SampleScene"); break; default: