2123
This commit is contained in:
parent
bcded4bbfb
commit
065e2824b2
|
@ -146,6 +146,8 @@ public class Taskpanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log("Leaveroom");
|
Debug.Log("Leaveroom");
|
||||||
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
||||||
|
string _msg = "leaveroom ";
|
||||||
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
SceneManager.LoadScene("SampleScene");
|
SceneManager.LoadScene("SampleScene");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,17 +30,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
AdamSync.SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
AdamSync.SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnOtherPlayerOnline(string msg)
|
|
||||||
{
|
|
||||||
string[] data = msg.Split(',');
|
|
||||||
Debug.Log(data[1]);
|
|
||||||
if (data[0] == "offline")
|
|
||||||
{
|
|
||||||
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
|
|
||||||
string _msg = "leaveroom ";
|
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async void GetSceneData(string roomId)
|
public async void GetSceneData(string roomId)
|
||||||
{
|
{
|
||||||
|
@ -104,8 +94,18 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
public void OnGetRoomsInfo(string msg)
|
public void OnGetRoomsInfo(string msg)
|
||||||
{
|
{
|
||||||
Debug.Log("OnGetRooms====" + msg);
|
Debug.Log("OnGetRooms====" + msg);
|
||||||
}
|
}
|
||||||
|
public void OnOtherPlayerOnline(string msg)
|
||||||
|
{
|
||||||
|
string[] data = msg.Split(',');
|
||||||
|
Debug.Log(data[1]);
|
||||||
|
if (data[0] == "offline")
|
||||||
|
{
|
||||||
|
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
@ -140,6 +140,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
||||||
AdamSync.SyncCreateRoom.getroomusersRequset -= OnGetRoomsUsers;
|
AdamSync.SyncCreateRoom.getroomusersRequset -= OnGetRoomsUsers;
|
||||||
AdamSync.SyncCreateRoom.send2roomRequset -= OnGetRoomsInfo;
|
AdamSync.SyncCreateRoom.send2roomRequset -= OnGetRoomsInfo;
|
||||||
|
AdamSync.SyncCreateRoom.send2roomRequset -= OnOtherPlayerOnline;
|
||||||
}
|
}
|
||||||
private void OnDestory()
|
private void OnDestory()
|
||||||
{
|
{
|
||||||
|
@ -147,5 +148,6 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
||||||
AdamSync.SyncCreateRoom.getroomusersRequset -= OnGetRoomsUsers;
|
AdamSync.SyncCreateRoom.getroomusersRequset -= OnGetRoomsUsers;
|
||||||
AdamSync.SyncCreateRoom.send2roomRequset -= OnGetRoomsInfo;
|
AdamSync.SyncCreateRoom.send2roomRequset -= OnGetRoomsInfo;
|
||||||
|
AdamSync.SyncCreateRoom.send2roomRequset -= OnOtherPlayerOnline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue