321
This commit is contained in:
parent
065e2824b2
commit
88fe840255
|
@ -144,8 +144,7 @@ public class Taskpanel : MonoBehaviour
|
||||||
|
|
||||||
public void OnLeaveRoom()
|
public void OnLeaveRoom()
|
||||||
{
|
{
|
||||||
Debug.Log("Leaveroom");
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
||||||
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
|
||||||
string _msg = "leaveroom ";
|
string _msg = "leaveroom ";
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
SceneManager.LoadScene("SampleScene");
|
SceneManager.LoadScene("SampleScene");
|
||||||
|
|
|
@ -137,6 +137,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
if (players[i].userID == playerID)
|
if (players[i].userID == playerID)
|
||||||
{
|
{
|
||||||
Destroy(players[i].gameObject);
|
Destroy(players[i].gameObject);
|
||||||
|
players.RemoveAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,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;
|
AdamSync.SyncCreateRoom.leaveRoomRequset += OnOtherPlayerOffline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,14 +95,13 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
{
|
{
|
||||||
Debug.Log("OnGetRooms====" + msg);
|
Debug.Log("OnGetRooms====" + msg);
|
||||||
}
|
}
|
||||||
public void OnOtherPlayerOnline(string msg)
|
public void OnOtherPlayerOffline(string msg)
|
||||||
{
|
{
|
||||||
string[] data = msg.Split(',');
|
string[] data = msg.Split(',');
|
||||||
Debug.Log(data[1]);
|
Debug.Log(data[1]);
|
||||||
if (data[0] == "offline")
|
if (data[0] == "offline")
|
||||||
{
|
{
|
||||||
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
|
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +139,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;
|
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnOtherPlayerOffline;
|
||||||
}
|
}
|
||||||
private void OnDestory()
|
private void OnDestory()
|
||||||
{
|
{
|
||||||
|
@ -148,6 +147,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;
|
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnOtherPlayerOffline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue