接口的变动
This commit is contained in:
parent
7231ae528e
commit
50ab18271f
@ -251,12 +251,14 @@ public class test : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
//ÍÆËÍnpcºÍÍæ¼ÒµÄÐÅÏ¢
|
//ÍÆËÍnpcºÍÍæ¼ÒµÄÐÅÏ¢
|
||||||
void Location(string userId = "2",string roomId = "3",NpcData npcData = null)
|
void Location(string userId = "2",string roomId = "3")
|
||||||
{
|
{
|
||||||
MoveResponse data = new MoveResponse();
|
MoveResponse data = new MoveResponse();
|
||||||
data.RoomId = roomId;
|
data.RoomId = roomId;
|
||||||
data.UserId = userId;
|
data.UserId = userId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WSMessage msg = new WSMessage();
|
WSMessage msg = new WSMessage();
|
||||||
msg.Module = "move";
|
msg.Module = "move";
|
||||||
msg.ServiceName = "Location";
|
msg.ServiceName = "Location";
|
||||||
@ -464,6 +466,55 @@ public class test : MonoBehaviour
|
|||||||
wEBScriptListener.SendMessageByte(sendData);
|
wEBScriptListener.SendMessageByte(sendData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public void GetTaskList(string userID,string roomID)
|
||||||
|
{
|
||||||
|
TaskTrigger data = new TaskTrigger();
|
||||||
|
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<WSMessage>(sendData);
|
||||||
|
TaskTrigger login = ProtoBufffer.DeSerialize<TaskTrigger>(deinfo.Data.ToByteArray());
|
||||||
|
Debug.Log("==========消息转发函数调用");
|
||||||
|
//BroadcastFrameMsg.FramesFieldNumber
|
||||||
|
|
||||||
|
wEBScriptListener.SendMessageByte(sendData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void TriggerNpcArrive()
|
||||||
|
{
|
||||||
|
MoveRoomAoiRequest data = new MoveRoomAoiRequest();
|
||||||
|
data.RoomId = "1";
|
||||||
|
data.UserId = 2;
|
||||||
|
data.X = 3f;
|
||||||
|
data.Y = 4f;
|
||||||
|
data.Z = 5f;
|
||||||
|
data.SceneId = "6";
|
||||||
|
data.NpcId = "7";
|
||||||
|
data.Action = 8;
|
||||||
|
|
||||||
|
|
||||||
|
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<WSMessage>(sendData);
|
||||||
|
MoveRoomAoiRequest login = ProtoBufffer.DeSerialize<MoveRoomAoiRequest>(deinfo.Data.ToByteArray());
|
||||||
|
Debug.Log("==========消息转发函数调用");
|
||||||
|
//BroadcastFrameMsg.FramesFieldNumber
|
||||||
|
|
||||||
|
wEBScriptListener.SendMessageByte(sendData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
async void Start()
|
async void Start()
|
||||||
@ -694,7 +745,7 @@ public class test : MonoBehaviour
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
//任务触发
|
//13(1)任务触发
|
||||||
case "task.TaskTrigger":
|
case "task.TaskTrigger":
|
||||||
Debug.Log("-----------task.TaskTrigger");
|
Debug.Log("-----------task.TaskTrigger");
|
||||||
TaskTrigger taskTrigger = ProtoBufffer.DeSerialize<TaskTrigger>(bytes);
|
TaskTrigger taskTrigger = ProtoBufffer.DeSerialize<TaskTrigger>(bytes);
|
||||||
@ -702,7 +753,7 @@ public class test : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
//更新任务
|
//13(2)更新任务
|
||||||
case "task.UpdateTask":
|
case "task.UpdateTask":
|
||||||
Debug.Log("-----------task.TaskTrigger");
|
Debug.Log("-----------task.TaskTrigger");
|
||||||
MoveRequest taskUpdateRequest = ProtoBufffer.DeSerialize<MoveRequest>(bytes);
|
MoveRequest taskUpdateRequest = ProtoBufffer.DeSerialize<MoveRequest>(bytes);
|
||||||
@ -725,7 +776,7 @@ public class test : MonoBehaviour
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//语音频道
|
//17.语音频道
|
||||||
case "voice.RtcTokenHandler":
|
case "voice.RtcTokenHandler":
|
||||||
Debug.Log("-----------move.MoveNpc");
|
Debug.Log("-----------move.MoveNpc");
|
||||||
VoiceResponse voiceResponse = ProtoBufffer.DeSerialize<VoiceResponse>(bytes);
|
VoiceResponse voiceResponse = ProtoBufffer.DeSerialize<VoiceResponse>(bytes);
|
||||||
@ -733,7 +784,7 @@ public class test : MonoBehaviour
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//对象触发操作
|
//15.对象触发操作
|
||||||
case "hall.ThatUser":
|
case "hall.ThatUser":
|
||||||
Debug.Log("-----------move.MoveNpc");
|
Debug.Log("-----------move.MoveNpc");
|
||||||
PlayerJoinResponse PlayerJoinResponse = ProtoBufffer.DeSerialize<PlayerJoinResponse>(bytes);
|
PlayerJoinResponse PlayerJoinResponse = ProtoBufffer.DeSerialize<PlayerJoinResponse>(bytes);
|
||||||
@ -741,7 +792,7 @@ public class test : MonoBehaviour
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//获取任务列表
|
//16.获取任务列表
|
||||||
case "hall.GetTaskList":
|
case "hall.GetTaskList":
|
||||||
Debug.Log("-----------move.MoveNpc");
|
Debug.Log("-----------move.MoveNpc");
|
||||||
TaskListResponse TaskListResponse = ProtoBufffer.DeSerialize<TaskListResponse>(bytes);
|
TaskListResponse TaskListResponse = ProtoBufffer.DeSerialize<TaskListResponse>(bytes);
|
||||||
@ -751,16 +802,17 @@ public class test : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
//获取任务列表
|
//19. 界面选项操作
|
||||||
case "select.SelectTrigger":
|
case "select.SelectTrigger":
|
||||||
Debug.Log("-----------move.MoveNpc");
|
Debug.Log("select.SelectTrigger");
|
||||||
SelectResponse selectRequest = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
SelectResponse selectRequest = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
||||||
Debug.Log(selectRequest);
|
Debug.Log(selectRequest);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
//获取任务列表
|
|
||||||
|
//20. 选项操作记录
|
||||||
case "select.GetSelectHistoryList":
|
case "select.GetSelectHistoryList":
|
||||||
Debug.Log("-----------move.MoveNpc");
|
Debug.Log("select.GetSelectHistoryList");
|
||||||
SelectHistoryResponse selectHistoryResponse = ProtoBufffer.DeSerialize<SelectHistoryResponse>(bytes);
|
SelectHistoryResponse selectHistoryResponse = ProtoBufffer.DeSerialize<SelectHistoryResponse>(bytes);
|
||||||
foreach(var selectRes in selectHistoryResponse.Selects)
|
foreach(var selectRes in selectHistoryResponse.Selects)
|
||||||
{
|
{
|
||||||
@ -768,6 +820,12 @@ public class test : MonoBehaviour
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//21.NPC是否被扛起
|
||||||
|
case "move.TriggerNpcArrive":
|
||||||
|
SelectResponse selectResponse = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user