Compare commits
2 Commits
61df6df538
...
97a09ec9f1
| Author | SHA1 | Date |
|---|---|---|
|
|
97a09ec9f1 | |
|
|
e0a33711d6 |
|
|
@ -146,7 +146,6 @@ public class Taskpanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
string _msg = "leaveroom ";
|
string _msg = "leaveroom ";
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -476,6 +476,9 @@ public class View_Panel2 : XUIPanel
|
||||||
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||||
//加入房间
|
//加入房间
|
||||||
Debug.Log("进入训练");
|
Debug.Log("进入训练");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string RoomName = "joinroom " + currentRoomName;
|
string RoomName = "joinroom " + currentRoomName;
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -283,9 +283,9 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
|
|
||||||
private void OnGetRoomUsers(string obj)
|
private void OnGetRoomUsers(string obj)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(obj)) return;
|
if (!string.IsNullOrWhiteSpace(obj))
|
||||||
|
{
|
||||||
string[] data = obj.Split(';');
|
string[] data = obj.Split(';');
|
||||||
//Debug.Log("datas=" + data[0]);
|
|
||||||
for (int i = 0; i < data.Length; i++)
|
for (int i = 0; i < data.Length; i++)
|
||||||
{
|
{
|
||||||
int index = i;
|
int index = i;
|
||||||
|
|
@ -301,6 +301,8 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
userIds.Add(ulong.Parse(userInfo[0]));
|
userIds.Add(ulong.Parse(userInfo[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Debug.Log($"<color=yellow>OnGetRoomUsers={obj}</color>");
|
||||||
SpawnDevice();
|
SpawnDevice();
|
||||||
string msg = $"send2room online,{ulong.Parse(GlobalFlag.currentUser.user_id)},{GlobalFlag.currentUser.login_name},{ulong.Parse(GlobalFlag.roomID)}";
|
string msg = $"send2room online,{ulong.Parse(GlobalFlag.currentUser.user_id)},{GlobalFlag.currentUser.login_name},{ulong.Parse(GlobalFlag.roomID)}";
|
||||||
_ = SyncCreateRoom.SendMessageAsync(msg);
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
|
@ -340,8 +342,17 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
Debug.Log("OnDisable");
|
Debug.Log("OnDisable");
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void Reset()
|
||||||
|
{
|
||||||
SyncCreateRoom.getroomusersRequset -= OnGetRoomUsers;
|
SyncCreateRoom.getroomusersRequset -= OnGetRoomUsers;
|
||||||
SyncCreateRoom.send2roomRequset -= OnRoomInfo;
|
SyncCreateRoom.send2roomRequset -= OnRoomInfo;
|
||||||
|
string _msg = "leaveroom ";
|
||||||
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,4 +168,10 @@ public class ToolsBootstrap : MonoSingleton<ToolsBootstrap>
|
||||||
{
|
{
|
||||||
wrjManager.wrjMenuSetPanel.gameObject.SetActive(false);
|
wrjManager.wrjMenuSetPanel.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnApplicationQuit()
|
||||||
|
{
|
||||||
|
string _msg = "leaveroom ";
|
||||||
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,18 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
}
|
}
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
///// <summary>
|
||||||
|
///// 是否分配角色
|
||||||
|
///// </summary>
|
||||||
|
//public bool IsAllocate()
|
||||||
|
//{
|
||||||
|
// string currentName =
|
||||||
|
// for(int i = 0;i < subjectInfo.Count; i++)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void OnGetWorldInfo(string msg)
|
public void OnGetWorldInfo(string msg)
|
||||||
|
|
@ -87,6 +99,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
Debug.Log("OnGetWorldInfo====" + msg);
|
Debug.Log("OnGetWorldInfo====" + msg);
|
||||||
GameManager.Instance.RemovePlayer(ulong.Parse(msg));
|
GameManager.Instance.RemovePlayer(ulong.Parse(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnLeaveRoomInfo(string msg)
|
public void OnLeaveRoomInfo(string msg)
|
||||||
{
|
{
|
||||||
string[] data = msg.Split(',');
|
string[] data = msg.Split(',');
|
||||||
|
|
@ -102,6 +115,8 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
{
|
{
|
||||||
Debug.Log("OnDisable");
|
Debug.Log("OnDisable");
|
||||||
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnLeaveRoomInfo;
|
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnLeaveRoomInfo;
|
||||||
|
string _msg = "leaveroom ";
|
||||||
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
}
|
}
|
||||||
private void OnDestory()
|
private void OnDestory()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace AdamSync
|
||||||
|
|
||||||
if (commands.Length > 0)
|
if (commands.Length > 0)
|
||||||
{
|
{
|
||||||
//Debug.Log("commands[0]====" + commands[0]);
|
Debug.Log($"<color=green>commands[0]===={commands[0]}</color>");
|
||||||
switch (commands[0])
|
switch (commands[0])
|
||||||
{
|
{
|
||||||
case "regist":
|
case "regist":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue