Compare commits
No commits in common. "3aae7026ec5cfcddf8b4b706f87c4c9c9f5dbd75" and "c6d15e3e9aafc89e5d73e7b2a1e273322e83badc" have entirely different histories.
3aae7026ec
...
c6d15e3e9a
|
@ -453,7 +453,7 @@ public class View_Panel2 : XUIPanel
|
|||
selector_panl.gameObject.SetActive(true);
|
||||
CreateAllUser(userData.data);
|
||||
EliminateAccount();
|
||||
Debug.Log($"currentSubjectID+currentSeatID={ currentSubjectID }={currentSeatID}");
|
||||
Debug.Log($"currentSubjectID+currentSeatID=" + currentSubjectID + "=" + currentSeatID);
|
||||
});
|
||||
if (GlobalFlag.currentUser.role_code.Equals("04") || GlobalFlag.currentUser.role_code.Equals("05"))
|
||||
{
|
||||
|
@ -523,6 +523,7 @@ public class View_Panel2 : XUIPanel
|
|||
}
|
||||
}
|
||||
|
||||
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
|
||||
|
||||
public void CreateRoomBase(string roomId, string name)
|
||||
{
|
||||
|
@ -532,7 +533,7 @@ public class View_Panel2 : XUIPanel
|
|||
roomItem.transform.Find("view_btn").GetComponent<Button>().onClick.AddListener(async () =>
|
||||
{
|
||||
Storm_and_capture_panl.gameObject.SetActive(true);
|
||||
UIBootstrap.Instance.currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticesubject&PracticeId=" + roomItem.name);
|
||||
currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticesubject&PracticeId=" + roomItem.name);
|
||||
currentRoomName = roomItem.name;
|
||||
GlobalFlag.roomID = roomItem.name;
|
||||
GlobalFlag.practiceId = roomItem.name;
|
||||
|
@ -540,7 +541,7 @@ public class View_Panel2 : XUIPanel
|
|||
UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId);
|
||||
UIBootstrap.Instance.GetAllDeviceData();
|
||||
Debug.Log(" roomItem.nameID==" + roomItem.name);
|
||||
CreateSubjectItem(UIBootstrap.Instance.currentRoomData.data);
|
||||
CreateSubjectItem(currentRoomData.data);
|
||||
});
|
||||
}
|
||||
public RSData.SubjectInfo currentSubjectInfo = new RSData.SubjectInfo();
|
||||
|
@ -633,7 +634,6 @@ public class View_Panel2 : XUIPanel
|
|||
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
||||
{
|
||||
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
||||
GlobalFlag.practiceSeatId = item.name;
|
||||
isAssigned = true;
|
||||
}
|
||||
}
|
||||
|
@ -676,7 +676,6 @@ public class View_Panel2 : XUIPanel
|
|||
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
||||
{
|
||||
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
||||
GlobalFlag.practiceSeatId = item.name;
|
||||
isAssigned = true;
|
||||
}
|
||||
}
|
||||
|
@ -751,18 +750,12 @@ public class View_Panel2 : XUIPanel
|
|||
string accountInfo = AccountsInfo();
|
||||
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>("http://111.229.30.246:48888/Handler/Practice.ashx?action=add&Name=" + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
||||
if (returnRoomId.state)
|
||||
{
|
||||
string roomID = returnRoomId.data;
|
||||
|
||||
RoomState roomState = await AsyncWebReq.Post<RoomState>("http://111.229.30.246:48888/Handler/Practice.ashx?action=updatestate&Id=" + roomID + "&state=0", null);
|
||||
//创建房间
|
||||
if (roomState.message == "success")
|
||||
{
|
||||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
||||
}
|
||||
Debug.Log($"<color=yellow> roomState=={roomState.message}</color>");
|
||||
//string RoomName = "createroom " + returnRoomId.data;
|
||||
//_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||
//创建房间
|
||||
string RoomName = "createroom " + returnRoomId.data;
|
||||
|
||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2,23 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
namespace RDate
|
||||
{
|
||||
[Serializable]
|
||||
public class RoomState
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string state;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string message;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string data;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class DataItem
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using AdamSync;
|
||||
using AdamThinkDevicesData;
|
||||
using Boo.Lang;
|
||||
using RDate;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
@ -84,23 +83,22 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
}
|
||||
}
|
||||
///04 student 03 teacher
|
||||
if (GlobalFlag.currentUser.role_code == "04")
|
||||
{
|
||||
Teacher.gameObject.SetActive(false);
|
||||
student.gameObject.SetActive(true);
|
||||
GlobalFlag.isStartRehearsing = (UIBootstrap.Instance.GetRoomStateById(GlobalFlag.roomID) == 1);
|
||||
Debug.Log($"<color=red>isStartRehearsing={ GlobalFlag.isStartRehearsing}</color>");
|
||||
if (GlobalFlag.isStartRehearsing)
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = -1;
|
||||
}
|
||||
}
|
||||
if (GlobalFlag.currentUser.role_code == "03")
|
||||
{
|
||||
Teacher.gameObject.SetActive(true);
|
||||
student.gameObject.SetActive(false);
|
||||
spt.GetComponent<Camera>().cullingMask = -1;
|
||||
}
|
||||
if (GlobalFlag.currentUser.role_code == "04")
|
||||
{
|
||||
Teacher.gameObject.SetActive(false);
|
||||
student.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (GlobalFlag.isStartRehearsing)
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = -1;
|
||||
}
|
||||
|
||||
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
||||
tenkokuModule.mainCamera = spt.transform;
|
||||
|
@ -111,7 +109,6 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
{
|
||||
SetWeatherValue();
|
||||
SetModelValue();
|
||||
|
||||
string msg = "getroomusers ";
|
||||
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||
}
|
||||
|
@ -179,7 +176,15 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
}
|
||||
break;
|
||||
case "StartDeduction":
|
||||
CheckRoomState();
|
||||
GlobalFlag.isStartRehearsing = true;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
DeviceManager.Instance.devices[i].isStartRehearsing = true;
|
||||
}
|
||||
if (GlobalFlag.currentUser.role_code == "04")
|
||||
{
|
||||
currentSpt.GetComponent<Camera>().cullingMask = -1;
|
||||
}
|
||||
break;
|
||||
case "无人机List":
|
||||
SpawnDevice(wrjDrag.prefabItem, data);
|
||||
|
@ -218,22 +223,6 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
}
|
||||
|
||||
|
||||
public async void CheckRoomState()
|
||||
{
|
||||
RoomState roomState = await AsyncWebReq.Post<RoomState>("http://111.229.30.246:48888/Handler/Practice.ashx?action=updatestate&Id=" + GlobalFlag.roomID + "&state=1", null);
|
||||
if (roomState.message == "success")
|
||||
{
|
||||
GlobalFlag.isStartRehearsing = true;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
DeviceManager.Instance.devices[i].isStartRehearsing = true;
|
||||
}
|
||||
if (GlobalFlag.currentUser.role_code == "04")
|
||||
{
|
||||
currentSpt.GetComponent<Camera>().cullingMask = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//}
|
||||
|
|
|
@ -15,7 +15,6 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
|
||||
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
||||
public AdamThinkDevicesData.DeviceData thinkDevicesData = new AdamThinkDevicesData.DeviceData();
|
||||
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
|
||||
// Start is called before the first frame update
|
||||
private async void Start()
|
||||
{
|
||||
|
@ -59,19 +58,6 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
return detaIteml;
|
||||
}
|
||||
|
||||
|
||||
public int GetRoomStateById(string Id)
|
||||
{
|
||||
for (int i = 0; i < currentRoomData.data.Count; i++)
|
||||
{
|
||||
if (currentRoomData.data[i].Id == Id)
|
||||
{
|
||||
return currentRoomData.data[i].State;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public List<List_paraItem> GetListParaItemById(string deviceId)
|
||||
{
|
||||
for (int i = 0; i < thinkDevicesData.data.Count; i++)
|
||||
|
|
|
@ -7,9 +7,6 @@ public class GlobalFlag
|
|||
public static UserInfo currentUser;
|
||||
public static string roomID;
|
||||
public static string practiceId;
|
||||
/// <summary>
|
||||
/// 席位ID
|
||||
/// </summary>
|
||||
public static string practiceSeatId;
|
||||
/// <summary>
|
||||
///是否正在预演
|
||||
|
|
|
@ -45,7 +45,7 @@ public static class AsyncWebReq
|
|||
{
|
||||
string reqJson = JsonConvert.SerializeObject(data);
|
||||
#if UNITY_EDITOR
|
||||
Debug.Log($"async req json : {reqJson}");
|
||||
//Debug.Log($"async req json : {reqJson}");
|
||||
#endif
|
||||
var bodyRaw = Encoding.UTF8.GetBytes(reqJson);
|
||||
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||
|
|
Loading…
Reference in New Issue