diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 5d410f27..252168bb 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -416,6 +416,54 @@ public class test : MonoBehaviour } + //界面选项操作 + public void SelectTrigger() + { + SelectRequest data = new SelectRequest(); + data.SelectId = "1"; + data.UserId = "2"; + data.RoomId = "3"; + data.TaskId = "4"; + data.RoleId = "5"; + + + WSMessage msg = new WSMessage(); + msg.Module = "voice"; + msg.ServiceName = "RtcTokenHandler"; + msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data)); + byte[] sendData = ProtoBufffer.Serialize(msg); + WSMessage deinfo = ProtoBufffer.DeSerialize(sendData); + SelectRequest login = ProtoBufffer.DeSerialize(deinfo.Data.ToByteArray()); + Debug.Log("==========消息转发函数调用"); + //BroadcastFrameMsg.FramesFieldNumber + + wEBScriptListener.SendMessageByte(sendData); + } + + + //界面选项操作 + public void GetSelectHistoryList() + { + SelectHistoryRequest data = new SelectHistoryRequest(); + data.SelectId = "1"; + data.UserId = "2"; + data.RoomId = "3"; + + + + WSMessage msg = new WSMessage(); + msg.Module = "select"; + msg.ServiceName = "GetSelectHistoryList"; + msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data)); + byte[] sendData = ProtoBufffer.Serialize(msg); + WSMessage deinfo = ProtoBufffer.DeSerialize(sendData); + SelectHistoryRequest login = ProtoBufffer.DeSerialize(deinfo.Data.ToByteArray()); + Debug.Log("==========消息转发函数调用"); + //BroadcastFrameMsg.FramesFieldNumber + + wEBScriptListener.SendMessageByte(sendData); + } + // Start is called before the first frame update async void Start() @@ -677,7 +725,7 @@ public class test : MonoBehaviour break; - //语音监听 + //语音频道 case "voice.RtcTokenHandler": Debug.Log("-----------move.MoveNpc"); VoiceResponse voiceResponse = ProtoBufffer.DeSerialize(bytes); @@ -685,9 +733,46 @@ public class test : MonoBehaviour break; + //对象触发操作 + case "hall.ThatUser": + Debug.Log("-----------move.MoveNpc"); + PlayerJoinResponse PlayerJoinResponse = ProtoBufffer.DeSerialize(bytes); + Debug.Log(PlayerJoinResponse); + + break; + + //获取任务列表 + case "hall.GetTaskList": + Debug.Log("-----------move.MoveNpc"); + TaskListResponse TaskListResponse = ProtoBufffer.DeSerialize(bytes); + foreach(var task in TaskListResponse.Tasks) + { + Debug.Log(task.TaskId); + } + + break; + //获取任务列表 + case "select.SelectTrigger": + Debug.Log("-----------move.MoveNpc"); + SelectResponse selectRequest = ProtoBufffer.DeSerialize(bytes); + Debug.Log(selectRequest); + + break; + //获取任务列表 + case "select.GetSelectHistoryList": + Debug.Log("-----------move.MoveNpc"); + SelectHistoryResponse selectHistoryResponse = ProtoBufffer.DeSerialize(bytes); + foreach(var selectRes in selectHistoryResponse.Selects) + { + Debug.Log(selectRes.Id); + } + break; + + + //case "prop.CreateNpc": // MoveResponse moveResponse = ProtoBufffer.DeSerialize(bytes); // Debug.Log("UserId:" + moveResponse.UserId + ",RoomId:" + moveResponse.RoomId + ",x:" + moveResponse.MoveData);