2024-12-04 15:05:38 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System.Net.Sockets;
|
|
|
|
|
using UnityWebSocket;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Google.Protobuf;
|
|
|
|
|
using System.Net.WebSockets;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2025-01-02 11:59:10 +08:00
|
|
|
|
using UnityEngine.Networking.Types;
|
2024-12-16 10:30:18 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
public class test : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public string token;
|
|
|
|
|
public WEBScriptListener wEBScriptListener;
|
2024-12-12 15:06:30 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
public class auth_login
|
|
|
|
|
{
|
|
|
|
|
public string clientId = "e5cd7e4891bf95d1d19206ce24a7b32e";
|
|
|
|
|
public string grantType = "password";
|
|
|
|
|
public string userType = "company_user";
|
2024-12-12 11:04:48 +08:00
|
|
|
|
public string username = "13006065371";
|
|
|
|
|
public string password = "YYL5371!";
|
2024-12-04 15:05:38 +08:00
|
|
|
|
}
|
|
|
|
|
//public async void loging()
|
|
|
|
|
//{
|
|
|
|
|
// auth_login auth_Login = new auth_login();
|
|
|
|
|
// string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_Login));
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
// server serverData = JsonConvert.DeserializeObject<server>(response);
|
|
|
|
|
// token = serverData.data.access_token;
|
|
|
|
|
// //Debug.Log(setverData.msg);
|
|
|
|
|
|
|
|
|
|
//}
|
2024-12-12 11:04:48 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//<2F><>¼
|
2024-12-30 23:59:06 +08:00
|
|
|
|
public void lodingWebSocket(string str)
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
LoginRequest data = new LoginRequest();
|
2024-12-30 22:59:22 +08:00
|
|
|
|
data.UserId = GlobalData.ServerData.data.userId ;
|
2024-12-30 23:59:06 +08:00
|
|
|
|
data.Account = str;
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "Login";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
LoginRequest login = ProtoBufffer.DeSerialize<LoginRequest>(deinfo.Data.ToByteArray());
|
2024-12-31 01:25:14 +08:00
|
|
|
|
Debug.Log(login);
|
|
|
|
|
Debug.Log("dddddddddddddddddddd");
|
2024-12-04 15:05:38 +08:00
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-12 11:04:48 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//<2F><><EFBFBD>뷿<EFBFBD><EBB7BF>
|
2024-12-29 15:03:13 +08:00
|
|
|
|
public void JoinRoom(string roomid)
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
JoinRoomRequest data = new JoinRoomRequest();
|
2024-12-29 19:51:11 +08:00
|
|
|
|
|
2024-12-29 15:03:13 +08:00
|
|
|
|
data.RoomId = roomid;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "JoinRoom";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
JoinRoomRequest login = ProtoBufffer.DeSerialize<JoinRoomRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("<22><><EFBFBD>뷿<EFBFBD><EBB7BF>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//void BroadcastMessage()
|
|
|
|
|
//{
|
|
|
|
|
// WSMessage msg = new WSMessage();
|
|
|
|
|
// msg.Module = "hall";
|
|
|
|
|
// msg.ServiceName = "BroadcastMessage";
|
|
|
|
|
// //msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
// byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
// WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
// JoinRoomRequest login = ProtoBufffer.DeSerialize<JoinRoomRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
// Debug.Log("<22><><EFBFBD>뷿<EFBFBD><EBB7BF>");
|
|
|
|
|
// //BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
async void Heartbeat()
|
|
|
|
|
{
|
|
|
|
|
//WSMessage msg = new WSMessage();
|
|
|
|
|
//msg.Data = ByteString.CopyFrom(new byte[] { 1 });
|
|
|
|
|
//byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
//Debug.Log("");
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "ping";
|
|
|
|
|
//msg.Data = ByteString.CopyFrom(new byte[] { 1 });
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
// ÿ<><C3BF>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Debug.Log("ÿ<><C3BF>ִ<EFBFBD><D6B4>һ<EFBFBD><D2BB>");
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
|
2024-12-29 14:19:18 +08:00
|
|
|
|
// <20>ȴ<EFBFBD>2<EFBFBD><32>
|
|
|
|
|
await Task.Delay(2000);
|
2024-12-04 15:05:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//֡<>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
public void UpFps(string id,string sid,float x,float y,int roomseatid,float z,string roomid)
|
2024-12-28 15:57:12 +08:00
|
|
|
|
{
|
|
|
|
|
InputData data = new InputData();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.Id = id;
|
|
|
|
|
data.SId = sid;
|
|
|
|
|
data.X = x;
|
|
|
|
|
data.Y = y;
|
|
|
|
|
data.RoomSeatId = roomseatid;
|
|
|
|
|
data.Z = z;
|
|
|
|
|
data.RoomId = roomid;
|
2024-12-28 15:57:12 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "fps";
|
|
|
|
|
msg.ServiceName = "UpFps";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
InputData login = ProtoBufffer.DeSerialize<InputData>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("֡<>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2024-12-28 15:57:12 +08:00
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
|
|
|
|
//ʰȡ<CAB0><C8A1><EFBFBD><EFBFBD>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
void PickUpProp(int propid,int action,string propserverid,string roomid)
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
PropRequest data = new PropRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.PropId = propid;
|
|
|
|
|
data.Action = action;
|
|
|
|
|
data.PropServerId = propserverid;
|
|
|
|
|
data.RoomId = roomid;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "prop";
|
|
|
|
|
msg.ServiceName = "PickUpProp";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
PropRequest login = ProtoBufffer.DeSerialize<PropRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("ʰȡ<CAB0><C8A1><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//ʹ<>õ<EFBFBD><C3B5><EFBFBD>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
void StartUseProp(int propid, int action, string propserverid, string roomid)
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
PropRequest data = new PropRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.PropId = propid;
|
|
|
|
|
data.Action = action;
|
|
|
|
|
data.PropServerId = propserverid;
|
|
|
|
|
data.RoomId = roomid;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "prop";
|
|
|
|
|
msg.ServiceName = "StartUseProp";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
PropRequest login = ProtoBufffer.DeSerialize<PropRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("ʹ<>õ<EFBFBD><C3B5><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//ֹͣʹ<D6B9>õ<EFBFBD><C3B5><EFBFBD>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
void StopUseProp(int propid, int action, string propserverid, string roomid)
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
PropRequest data = new PropRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.RoomId = roomid;
|
|
|
|
|
data.PropId = propid;
|
|
|
|
|
data.PropServerId = propserverid;
|
|
|
|
|
data.Action = action;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "prop";
|
|
|
|
|
msg.ServiceName = "StopUseProp";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
PropRequest login = ProtoBufffer.DeSerialize<PropRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("ֹͣʹ<D6B9>õ<EFBFBD><C3B5><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>NPC ========================<3D><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ
|
|
|
|
|
//void CreateNpc()
|
|
|
|
|
//{
|
|
|
|
|
// PropRequest data = new PropRequest();
|
|
|
|
|
// data.RoomId = "168888";
|
|
|
|
|
// WSMessage msg = new WSMessage();
|
|
|
|
|
// msg.Module = "move";
|
|
|
|
|
// msg.ServiceName = "CreateNpc";
|
|
|
|
|
// msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
// byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
// WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
// PropRequest login = ProtoBufffer.DeSerialize<PropRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
// Debug.Log("<22><><EFBFBD><EFBFBD>NPC");
|
|
|
|
|
// //BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
// wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>npc<70><63><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ ===============ֻ<><D6BB>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
//void Location()
|
|
|
|
|
//{
|
|
|
|
|
// PropRequest data = new PropRequest();
|
|
|
|
|
// data.RoomId = "168888";
|
|
|
|
|
// WSMessage msg = new WSMessage();
|
|
|
|
|
// msg.Module = "prop";
|
|
|
|
|
// msg.ServiceName = "CreateNpc";
|
|
|
|
|
// msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
// byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
// WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
// PropRequest login = ProtoBufffer.DeSerialize<PropRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
// Debug.Log("<22><><EFBFBD><EFBFBD>npc<70><63><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ");
|
|
|
|
|
// //BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
// wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
//}
|
|
|
|
|
|
2024-12-12 19:49:08 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2024-12-26 20:58:08 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>npc<70><63><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ
|
2024-12-29 14:19:18 +08:00
|
|
|
|
void Location(string userId = "2", string roomId = "3")
|
2024-12-04 15:05:38 +08:00
|
|
|
|
{
|
|
|
|
|
MoveResponse data = new MoveResponse();
|
2024-12-26 20:58:08 +08:00
|
|
|
|
data.RoomId = roomId;
|
|
|
|
|
data.UserId = userId;
|
|
|
|
|
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "move";
|
|
|
|
|
msg.ServiceName = "Location";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
MoveResponse login = ProtoBufffer.DeSerialize<MoveResponse>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>npc<70><63><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//(1) <09><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫִ<D2AA>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
public void InitStart(string roomid)
|
2024-12-05 17:38:33 +08:00
|
|
|
|
{
|
|
|
|
|
TaskTrigger data = new TaskTrigger();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.RoomId = roomid;
|
|
|
|
|
|
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "task";
|
|
|
|
|
msg.ServiceName = "InitStart";
|
|
|
|
|
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("==========<3D><><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//(2) <09><><EFBFBD><EFBFBD>
|
|
|
|
|
public void TaskTrigger(string userid,string roomid,string triggerid,string typestr,string targetid,string taskid,string roleid)
|
|
|
|
|
{
|
|
|
|
|
TaskTrigger data = new TaskTrigger();
|
|
|
|
|
data.RoomId = roomid;
|
|
|
|
|
data.TriggerId = triggerid;
|
|
|
|
|
data.UserId = userid;
|
|
|
|
|
data.TypeStr = typestr;
|
|
|
|
|
data.TargetId = targetid;
|
|
|
|
|
data.TaskId = taskid;
|
|
|
|
|
data.RoleId = roleid;
|
2024-12-05 17:38:33 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "task";
|
|
|
|
|
msg.ServiceName = "TaskTrigger";
|
|
|
|
|
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("==========<3D><><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//(3) <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|
|
|
|
void TaskUpdateRequest(TaskUpdateRequest taskUpdateRequest)
|
2024-12-05 17:38:33 +08:00
|
|
|
|
{
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//TaskUpdateRequest<73><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
|
|
|
|
/*
|
|
|
|
|
message TaskUpdateRequesti
|
|
|
|
|
string RoomId =1;//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
tring TaskId =2; // <20><><EFBFBD><EFBFBD>id
|
|
|
|
|
string UserId =3;// <20>û<EFBFBD>id
|
|
|
|
|
string SelectId =4;// ѡ<><D1A1>ID <20><><EFBFBD>水ť
|
|
|
|
|
string ToUserId =5;// Ŀ<><C4BF><EFBFBD>û<EFBFBD>id
|
|
|
|
|
string UserName =6;//<2F>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
string PropId =7;//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
string PropName =8;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int32 InputNum =9;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string status =10;// <20><><EFBFBD><EFBFBD>״̬
|
|
|
|
|
string HandleButtoncallId=11;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>idstring TargetType =12;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2024-12-05 17:38:33 +08:00
|
|
|
|
TaskUpdateRequest data = new TaskUpdateRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data = taskUpdateRequest;
|
2024-12-05 17:38:33 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "task";
|
|
|
|
|
msg.ServiceName = "UpdateTask";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
TaskUpdateRequest login = ProtoBufffer.DeSerialize<TaskUpdateRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//NPC·<43><C2B7>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public void NpcMove(string roomId, int moveType, int selectId)
|
2024-12-12 17:00:17 +08:00
|
|
|
|
{
|
|
|
|
|
MoveRequest data = new MoveRequest();
|
2024-12-26 20:58:08 +08:00
|
|
|
|
data.RoomId = roomId;
|
|
|
|
|
data.MoveType = moveType;
|
|
|
|
|
data.SelectId = selectId;
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-12 17:00:17 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "move";
|
|
|
|
|
msg.ServiceName = "MoveNpc";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
MoveRequest login = ProtoBufffer.DeSerialize<MoveRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========ѡ<><D1A1>·<EFBFBD><C2B7>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//11<31><31><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ʱ
|
|
|
|
|
void RoomStartTime(string rooid)
|
|
|
|
|
{
|
|
|
|
|
JoinRoomRequest data = new JoinRoomRequest();
|
|
|
|
|
data.RoomId = rooid;
|
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "RoomStartTime";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
JoinRoomRequest login = ProtoBufffer.DeSerialize<JoinRoomRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>npc<70><63><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-12 19:49:08 +08:00
|
|
|
|
//12<31><32><EFBFBD><EFBFBD>Ϣת<CFA2><D7AA>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
public void MessageToUser(string roomid, int type, string roleid, string cmd)
|
2024-12-12 19:49:08 +08:00
|
|
|
|
{
|
|
|
|
|
MessageBroadcastRequest data = new MessageBroadcastRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.RoomId = roomid;
|
|
|
|
|
data.Type = type;
|
|
|
|
|
data.RoleId = roleid;
|
|
|
|
|
data.Cmd = cmd;
|
2024-12-12 19:49:08 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "MessageToUser";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
MessageBroadcastRequest login = ProtoBufffer.DeSerialize<MessageBroadcastRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2024-12-12 19:49:08 +08:00
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//14.<2E><><EFBFBD><EFBFBD><F3B4A5B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void HandleObject(RequestObject requestObject)
|
|
|
|
|
{
|
|
|
|
|
RequestObject data = new RequestObject();
|
|
|
|
|
|
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "object";
|
|
|
|
|
msg.ServiceName = "HandleObject";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
MessageBroadcastRequest login = ProtoBufffer.DeSerialize<MessageBroadcastRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-12-13 17:19:27 +08:00
|
|
|
|
public void CreateNpcHandler()
|
|
|
|
|
{
|
|
|
|
|
NpcCreateRequest data = new NpcCreateRequest();
|
|
|
|
|
data.RoomId = "168888";
|
|
|
|
|
data.SceneId = "9003";
|
2024-12-14 16:33:31 +08:00
|
|
|
|
data.TemplateId = 2;
|
2024-12-13 17:19:27 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "move";
|
|
|
|
|
msg.ServiceName = "CreateNpcHandler";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
NpcCreateRequest login = ProtoBufffer.DeSerialize<NpcCreateRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//17.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|
|
|
|
public void RtcTokenHandler(VoiceRequest voiceRequest)
|
2024-12-26 20:58:08 +08:00
|
|
|
|
{
|
2025-01-02 11:59:10 +08:00
|
|
|
|
/*
|
|
|
|
|
VoiceRequest
|
|
|
|
|
uint32 uid =1;// <20>û<EFBFBD>id
|
|
|
|
|
string channelName=2;//Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Channelrype=5;//Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>string
|
|
|
|
|
string roomId=8://<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>id
|
|
|
|
|
string role=6;//<2F><>Ҫ֪ͨ<CDA8>Ľ<EFBFBD>ɫ <20><><EFBFBD><EFBFBD>:1,2,3,4 You<6F><75>Moments
|
|
|
|
|
*/
|
2024-12-26 20:58:08 +08:00
|
|
|
|
VoiceRequest data = new VoiceRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data = voiceRequest;
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-26 20:58:08 +08:00
|
|
|
|
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<WSMessage>(sendData);
|
|
|
|
|
VoiceRequest login = ProtoBufffer.DeSerialize<VoiceRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//18.NPC<50>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void EnterFogArea(string[] npclist,string roomid,int action)
|
2024-12-26 20:58:08 +08:00
|
|
|
|
{
|
|
|
|
|
npcRequest data = new npcRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.RoomId = roomid;
|
|
|
|
|
data.Action = action;
|
|
|
|
|
|
2024-12-26 20:58:08 +08:00
|
|
|
|
|
|
|
|
|
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<WSMessage>(sendData);
|
2025-01-02 11:59:10 +08:00
|
|
|
|
npcRequest login = ProtoBufffer.DeSerialize<npcRequest>(deinfo.Data.ToByteArray());
|
2024-12-26 20:58:08 +08:00
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//19.<2E><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void SelectTrigger(SelectRequest selectRequest)
|
2024-12-26 21:59:25 +08:00
|
|
|
|
{
|
|
|
|
|
SelectRequest data = new SelectRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data = selectRequest;
|
2024-12-26 21:59:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WSMessage msg = new WSMessage();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
msg.Module = "select";
|
|
|
|
|
msg.ServiceName = "SelectTrigger";
|
2024-12-26 21:59:25 +08:00
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
SelectRequest login = ProtoBufffer.DeSerialize<SelectRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//20.ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
|
|
|
|
public void GetSelectHistoryList(string selectid,string userid,string roomid)
|
2024-12-26 21:59:25 +08:00
|
|
|
|
{
|
|
|
|
|
SelectHistoryRequest data = new SelectHistoryRequest();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data.SelectId = selectid;
|
|
|
|
|
data.UserId = userid;
|
|
|
|
|
data.RoomId = roomid;
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-26 21:59:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
SelectHistoryRequest login = ProtoBufffer.DeSerialize<SelectHistoryRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//16.<2E><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
public void GetTaskList(TaskTrigger taskTrigger)
|
2024-12-27 21:02:43 +08:00
|
|
|
|
{
|
|
|
|
|
TaskTrigger data = new TaskTrigger();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
data = taskTrigger;
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//15.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
2024-12-28 14:10:54 +08:00
|
|
|
|
public void ThatUser(PlayerJoinResponse player)
|
|
|
|
|
{
|
|
|
|
|
PlayerJoinResponse data = new PlayerJoinResponse();
|
|
|
|
|
data = player;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
PlayerJoinResponse login = ProtoBufffer.DeSerialize<PlayerJoinResponse>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
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());
|
2024-12-29 18:03:40 +08:00
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
//21.<2E><><EFBFBD><EFBFBD><EFBFBD><D7BC>
|
2024-12-29 18:03:40 +08:00
|
|
|
|
public void PlayerReady(string roomId,bool isready)
|
|
|
|
|
{
|
|
|
|
|
PlayerReadyRequest data = new PlayerReadyRequest();
|
|
|
|
|
data.RoomId = roomId;
|
|
|
|
|
data.IsReady = isready;
|
|
|
|
|
|
2024-12-30 11:20:06 +08:00
|
|
|
|
Debug.Log("==========<3D><><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
2024-12-29 18:03:40 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
2024-12-30 11:49:31 +08:00
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "PlayerReady";
|
2024-12-29 18:03:40 +08:00
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
PlayerReadyRequest login = ProtoBufffer.DeSerialize<PlayerReadyRequest>(deinfo.Data.ToByteArray());
|
2024-12-27 21:02:43 +08:00
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
2024-12-29 21:02:45 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//22.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
2024-12-29 21:02:45 +08:00
|
|
|
|
public void StartGameDrill(string roomId)
|
|
|
|
|
{
|
|
|
|
|
JoinRoomRequest data = new JoinRoomRequest();
|
|
|
|
|
data.RoomId = roomId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WSMessage msg = new WSMessage();
|
2024-12-30 11:49:31 +08:00
|
|
|
|
msg.Module = "hall";
|
2024-12-30 11:52:00 +08:00
|
|
|
|
msg.ServiceName = "StartGameDrill";
|
2024-12-29 21:02:45 +08:00
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
JoinRoomRequest login = ProtoBufffer.DeSerialize<JoinRoomRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
//24.<2E>ύ<EFBFBD>Ż<EFBFBD><C5BB><EFBFBD> 2024.12.30
|
|
|
|
|
public void PlayerSituation(FirePointRequest firePointRequest)
|
|
|
|
|
{
|
|
|
|
|
FirePointRequest data = new FirePointRequest();
|
|
|
|
|
data = firePointRequest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log("==========------------------<2D><>");
|
|
|
|
|
WSMessage msg = new WSMessage();
|
|
|
|
|
msg.Module = "hall";
|
|
|
|
|
msg.ServiceName = "SubmitFirePoint";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
FirePointRequest login = ProtoBufffer.DeSerialize<FirePointRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}//23.<2E><><EFBFBD>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> 2024.12.30
|
2024-12-30 22:59:22 +08:00
|
|
|
|
public void PlayerSituation(string roomId)
|
|
|
|
|
{
|
|
|
|
|
JoinRoomRequest data = new JoinRoomRequest();
|
|
|
|
|
data.RoomId = roomId;
|
2024-12-29 21:02:45 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-31 01:25:14 +08:00
|
|
|
|
Debug.Log("==========------------------<2D><>");
|
2024-12-30 22:59:22 +08:00
|
|
|
|
WSMessage msg = new WSMessage();
|
2025-01-02 11:59:10 +08:00
|
|
|
|
msg.Module = "hall";
|
2024-12-30 22:59:22 +08:00
|
|
|
|
msg.ServiceName = "PlayerSituation";
|
|
|
|
|
msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data));
|
|
|
|
|
byte[] sendData = ProtoBufffer.Serialize(msg);
|
|
|
|
|
WSMessage deinfo = ProtoBufffer.DeSerialize<WSMessage>(sendData);
|
|
|
|
|
JoinRoomRequest login = ProtoBufffer.DeSerialize<JoinRoomRequest>(deinfo.Data.ToByteArray());
|
|
|
|
|
Debug.Log("==========<3D><>Ϣת<CFA2><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
//BroadcastFrameMsg.FramesFieldNumber
|
|
|
|
|
|
|
|
|
|
wEBScriptListener.SendMessageByte(sendData);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
async void Start()
|
|
|
|
|
{
|
|
|
|
|
//loging();
|
|
|
|
|
wEBScriptListener.ConcatWEBSocket();
|
|
|
|
|
wEBScriptListener.OnCallback += callback;
|
|
|
|
|
if (wEBScriptListener != null)
|
|
|
|
|
{
|
2024-12-31 01:30:45 +08:00
|
|
|
|
//lodingWebSocket(ReadRoom.instance.ID);
|
2024-12-12 17:07:43 +08:00
|
|
|
|
//JoinRoom();
|
2024-12-12 11:04:48 +08:00
|
|
|
|
Heartbeat();
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//BroadcastMessage();
|
|
|
|
|
//UpFps();
|
|
|
|
|
//PickUpProp();
|
|
|
|
|
//StartUseProp();
|
|
|
|
|
//StopUseProp();
|
|
|
|
|
//RoomStartTime();
|
|
|
|
|
//Location();
|
2024-12-05 17:38:33 +08:00
|
|
|
|
//TaskTrigger();
|
|
|
|
|
//TaskUpdateRequest();
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
}
|
2024-12-12 11:04:48 +08:00
|
|
|
|
//int index = 0;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
//while (true)
|
|
|
|
|
//{
|
|
|
|
|
// index++;
|
|
|
|
|
// NpcData moveData = new NpcData();
|
|
|
|
|
// moveData.X = index;
|
|
|
|
|
// moveData.Y = 1;
|
|
|
|
|
// moveData.Z = 1;
|
|
|
|
|
|
|
|
|
|
// MoveResponse data = new MoveResponse();
|
|
|
|
|
// data.MoveData.Add(moveData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// WSResponse ws = new WSResponse();
|
|
|
|
|
// ws.MessageType = "move.Location";
|
|
|
|
|
// ws.Data = ByteString.CopyFrom(data.ToByteArray());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// callback(ProtoBufffer.Serialize(ws));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //PlayerJoinResponse pj = new PlayerJoinResponse();
|
|
|
|
|
// //pj.UserName = "abc";
|
|
|
|
|
// //pj.RoomId = "2";
|
|
|
|
|
// //pj.Status = 0;
|
|
|
|
|
// //pj.RoleName = "ABC";
|
|
|
|
|
// //pj.IsLeadingNPC = 5;
|
|
|
|
|
// //pj.Online = true;
|
|
|
|
|
// //pj.RoleId = 7;
|
|
|
|
|
// //pj.GroupLeader = 0;
|
|
|
|
|
// //pj.ActionMode = 2;
|
|
|
|
|
// //pj.Group = -1;
|
|
|
|
|
// //pj.X = 11;
|
|
|
|
|
// //pj.Y = 12;
|
|
|
|
|
// //pj.Z = 13;
|
|
|
|
|
// //pj.OverseeCond = "14";
|
|
|
|
|
// //pj.SendFrameCount = 15;
|
|
|
|
|
// //pj.MoveSpeedFirst = 16;
|
|
|
|
|
// //pj.MoveSpeedSecond = 17;
|
|
|
|
|
// //pj.MoveSpeedThird = 18;
|
|
|
|
|
// //pj.BearLoad = 19;
|
|
|
|
|
// //pj.Protection = 20;
|
|
|
|
|
// //pj.Health = 21;
|
|
|
|
|
// //pj.RoleStatus = 22;
|
|
|
|
|
// //pj.UserId = 23;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //JoinRoomResponse data = new JoinRoomResponse();
|
|
|
|
|
// //data.Data = pj;
|
|
|
|
|
|
|
|
|
|
// //WSResponse ws = new WSResponse();
|
|
|
|
|
// //ws.MessageType = "hall.JoinRoom";
|
|
|
|
|
// //ws.Data = ByteString.CopyFrom(data.ToByteArray());
|
|
|
|
|
|
|
|
|
|
// //callback(ProtoBufffer.Serialize(ws));
|
|
|
|
|
|
|
|
|
|
// await Task.Delay(1000);
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void callback(byte[] data)
|
|
|
|
|
{
|
|
|
|
|
WSResponse deinfo = ProtoBufffer.DeSerialize<WSResponse>(data);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:" + deinfo.MessageType);
|
2024-12-04 15:05:38 +08:00
|
|
|
|
byte[] bytes = deinfo.Data.ToByteArray();
|
|
|
|
|
switch (deinfo.MessageType)
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F><>¼
|
|
|
|
|
case "hall.Login":
|
|
|
|
|
Debug.Log("-=====--");
|
|
|
|
|
LoginResponse user = ProtoBufffer.DeSerialize<LoginResponse>(bytes);
|
|
|
|
|
Debug.Log(user);
|
2024-12-12 17:07:43 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2>Խ<D4BD><D7B6>õģ<C3B5><C4A3>ڵ<EFBFBD>¼֮<C2BC><D6AE><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC>뷿<EFBFBD><EBB7BF>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2024-12-29 17:50:20 +08:00
|
|
|
|
//<2F><><EFBFBD>뷿<EFBFBD><EBB7BF>
|
2024-12-04 15:05:38 +08:00
|
|
|
|
case "hall.JoinRoom":
|
|
|
|
|
JoinRoomResponse joinRoomResponse = ProtoBufffer.DeSerialize<JoinRoomResponse>(bytes);
|
|
|
|
|
byte[] joinByte = joinRoomResponse.Data.ToByteArray();
|
|
|
|
|
PlayerJoinResponse playerJoinResponse = ProtoBufffer.DeSerialize<PlayerJoinResponse>(joinByte);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
Debug.Log("<22><><EFBFBD>ң<EFBFBD>" + playerJoinResponse.UserName + "<22><><EFBFBD>뷿<EFBFBD><EBB7BF>:" + playerJoinResponse.RoomId.ToString());
|
2024-12-29 17:50:20 +08:00
|
|
|
|
GameObject.Find("player").transform.position = new Vector3((float)playerJoinResponse.X, (float)playerJoinResponse.Y, (float)playerJoinResponse.Z);
|
2024-12-29 19:33:02 +08:00
|
|
|
|
Debug.Log(playerJoinResponse.IsReady);//<2F>Ƿ<EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
|
|
|
|
|
|
2024-12-29 15:45:46 +08:00
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>");
|
2024-12-12 17:07:43 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//<2F>㲥
|
|
|
|
|
case "hall.BroadcastMessage":
|
|
|
|
|
UserJoinResponse userJoinResponse = ProtoBufffer.DeSerialize<UserJoinResponse>(bytes);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
/*
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>userJoinResponse<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
int64 userId =1;//<2F>û<EFBFBD>id
|
|
|
|
|
string nickName=2;//<2F>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
string roleName=3;//<2F>û<EFBFBD><C3BB><EFBFBD>ɫ
|
|
|
|
|
string roomId=4;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
bool online =5;//״̬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Dz<EFBFBD><C7B2>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD>¼<EFBFBD>״̬ 1 <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3 <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷿<EFBFBD><EFBFBD> 4 <EFBFBD>¹ʷ<EFBFBD><EFBFBD><EFBFBD> 5 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>6 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>7 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 8 NPc <EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><EFBFBD><EFBFBD> 9 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> 10 <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 11 <EFBFBD><EFBFBD><EFBFBD>俪ʼ
|
|
|
|
|
int32 messageType = 6;
|
|
|
|
|
string cmd =7;//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
string incidentPosition=8://<2F>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
float fireRadius =9;//<2F><><EFBFBD>ư뾶
|
|
|
|
|
int32 firevalue = 10;//<2F><><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
TaskInfoResponse taskResponse=11;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
0bjectInfoResponse objectResponse=12;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
NpcInfoResponse npcResponse=13;//npc<70><63>Ϣ
|
|
|
|
|
VoiceTransportResponse voiceResponse =14;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
PlayerJoinResponse playerResponse=15;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
*/
|
|
|
|
|
//Debug.Log(userJoinResponse);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 1)//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>:" + userJoinResponse.NickName + "<22><><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 2)//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>:" + userJoinResponse.NickName + "<22><><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 3)//<2F><><EFBFBD>뷿<EFBFBD><EBB7BF>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>" + userJoinResponse.NickName + "<22><><EFBFBD>뷿<EFBFBD><EBB7BF>:" + userJoinResponse.RoomId.ToString() + "<22><><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ɫ" + userJoinResponse.RoleName);
|
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 4)//<2F>¹ʷ<C2B9><CAB7><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-06 11:29:20 +08:00
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 5)//<2F><><EFBFBD><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
2024-12-29 14:19:18 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>»<EFBFBD><C2BB>Ƶ<EFBFBD><C6B5><EFBFBD>Ϣ <20>뾶userJoinResponse.FireRadius λ<><CEBB>userJoinResponse.IncidentPosition <20><><EFBFBD><EFBFBD>ֵuserJoinResponse.FireValue
|
|
|
|
|
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-06 11:29:20 +08:00
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 6)//<2F><><EFBFBD><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
2024-12-29 14:19:18 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>taskInfoResponse <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TaskId ״̬Status <20><><EFBFBD><EFBFBD>id <20><><EFBFBD><EFBFBD>x<EFBFBD><78>y<EFBFBD><79>z <20><><EFBFBD><EFBFBD>Type ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Timelimit <20><><EFBFBD><EFBFBD>Des <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Trigger <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>NextTask Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TargetType <20><><EFBFBD><EFBFBD>Reward <20><>עNote <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>CreatTime <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>UpdateTime Ŀ<><C4BF><EFBFBD>û<EFBFBD>id ToUserId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id BaseTaskid
|
2024-12-06 11:29:20 +08:00
|
|
|
|
TaskInfoResponse taskInfoResponse = userJoinResponse.TaskResponse;
|
2024-12-06 16:43:56 +08:00
|
|
|
|
if (long.Parse(taskInfoResponse.ToUserId) == userJoinResponse.UserId)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
2024-12-06 11:29:20 +08:00
|
|
|
|
{
|
2024-12-19 15:04:19 +08:00
|
|
|
|
TaskPanel.instance.Taskad(int.Parse(taskInfoResponse.TaskId));
|
2024-12-06 11:29:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-29 14:19:18 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 7)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>ϢobjectInfoResponse<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/*
|
|
|
|
|
string RoomId=1;//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
string Id=2://ID
|
|
|
|
|
string objectId=3;//<2F><><EFBFBD><EFBFBD>ID
|
|
|
|
|
string Note =4;//״̬
|
|
|
|
|
string Type =5;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lilubing<6E><67>2024/11/2716:37<33><37><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>弰<EFBFBD><E5BCB0><EFBFBD><EFBFBD>:Changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string Name=6;//<2F><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>Id
|
|
|
|
|
int64 Nameshowoffset=7;//<2F><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ʾƫ<CABE><C6AB><EFBFBD><EFBFBD>
|
|
|
|
|
int64 showRadius=8;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>뾶
|
|
|
|
|
string Icon =9;//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|
|
|
|
string Role =10;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
string ItemDepend =11;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|
|
|
|
int64 Takerime = 12;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> -1 <20><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>
|
|
|
|
|
string Needplayers = 13;// <20>ж<EFBFBD><D0B6><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɲ<EFBFBD><C9B2><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ)
|
|
|
|
|
string Taskstatus=14;//<2F><>Ӧ<EFBFBD>¼<EFBFBD>ID
|
|
|
|
|
string selectList=15;//ѡ<><D1A1><EFBFBD>б<EFBFBD>
|
|
|
|
|
int64 onoff =16;// <20><><EFBFBD><EFBFBD>״̬ 0<><30><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>1 <20>ɲ<EFBFBD><C9B2><EFBFBD>
|
|
|
|
|
|
|
|
|
|
string status=17;//״̬
|
|
|
|
|
string ResChange =18;//<2F><>Դ<EFBFBD>仯
|
|
|
|
|
|
|
|
|
|
int64 ParallelControl=19;//<2F>Ƿ<EFBFBD>֧<EFBFBD>ֶ<EFBFBD><D6B6>˲<EFBFBD><CBB2><EFBFBD>
|
|
|
|
|
string ExtraValue=20;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string UserIds = 21;// <20><><EFBFBD><EFBFBD>id<69>б<EFBFBD> <20><><EFBFBD>ŷָ<C5B7>
|
|
|
|
|
|
|
|
|
|
string Createrime =22;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
|
|
|
|
|
string Updaterime =23;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
ObjectInfoResponse objectInfoResponse = userJoinResponse.ObjectResponse;
|
|
|
|
|
}
|
|
|
|
|
if (userJoinResponse.MessageType == 8)//NPC<50><43><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (userJoinResponse.MessageType == 9)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϢvoiceTransportResponse<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӧ<><D3A6>id AppId <20>û<EFBFBD>id channelName
|
|
|
|
|
VoiceTransportResponse voiceTransportResponse = userJoinResponse.VoiceResponse;
|
|
|
|
|
}
|
|
|
|
|
if (userJoinResponse.MessageType == 10)//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (userJoinResponse.MessageType == 11)//<2F><><EFBFBD>俪ʼ
|
|
|
|
|
{
|
2025-01-03 11:38:37 +08:00
|
|
|
|
Debug.LogWarning("<22><><EFBFBD>俪ʼ");
|
2024-12-29 20:25:37 +08:00
|
|
|
|
test111.instance.Oppanel();
|
2024-12-29 14:19:18 +08:00
|
|
|
|
}
|
2024-12-29 21:02:45 +08:00
|
|
|
|
if (userJoinResponse.MessageType == 12)//<2F><><EFBFBD><EFBFBD><EFBFBD><D7BC>
|
|
|
|
|
{
|
2025-01-03 09:56:34 +08:00
|
|
|
|
if (userJoinResponse.IsAllReady)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
|
2025-01-03 10:07:03 +08:00
|
|
|
|
GameObject.Find("HostCanvas").GetComponent<Starthost>().start.interactable = true;
|
2025-01-03 11:38:37 +08:00
|
|
|
|
GameObject.Find("HostCanvas").GetComponent<Starthost>().isSatisfy = true;
|
2025-01-03 09:56:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-29 21:02:45 +08:00
|
|
|
|
}
|
2025-01-02 15:10:09 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//֡<><D6A1><EFBFBD><EFBFBD>
|
2024-12-04 15:05:38 +08:00
|
|
|
|
case "fps.UpFps":
|
|
|
|
|
InputData inputData = ProtoBufffer.DeSerialize<InputData>(bytes);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
Debug.Log("Id<49><64>" + inputData.Id + ",sId :" + inputData.SId + "<22><>X:" + inputData.X.ToString() + "<22><>Y:" + inputData.Y.ToString() + "<22><>roomSeatId :" + inputData.RoomSeatId + "<22><>z:" + inputData.Z.ToString() + "<22><>roomId:" + inputData.RoomId);
|
2024-12-04 15:05:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//ʰȡ<CAB0><C8A1><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-04 15:05:38 +08:00
|
|
|
|
case "prop.PickUpProp":
|
2025-01-02 11:59:10 +08:00
|
|
|
|
PropResponse PropResponse = ProtoBufffer.DeSerialize<PropResponse>(bytes);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>id propId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID propServerId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>name <20><><EFBFBD>߱<EFBFBD><DFB1><EFBFBD>code <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣmessage
|
|
|
|
|
Debug.Log("PropId:" + PropResponse.PropId);
|
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//<2F><>ʼʹ<CABC>õ<EFBFBD><C3B5><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-04 15:05:38 +08:00
|
|
|
|
case "prop.StartUseProp":
|
|
|
|
|
PropResponse useProp = ProtoBufffer.DeSerialize<PropResponse>(bytes);
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>id propId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID propServerId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>name <20><><EFBFBD>߱<EFBFBD><DFB1><EFBFBD>code <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣmessage
|
2024-12-04 15:05:38 +08:00
|
|
|
|
Debug.Log("PropId:" + useProp);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "prop.StopUseProp":
|
|
|
|
|
PropResponse stopuseProp = ProtoBufffer.DeSerialize<PropResponse>(bytes);
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>id propId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID propServerId <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>name <20><><EFBFBD>߱<EFBFBD><DFB1><EFBFBD>code <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣmessage
|
2024-12-04 15:05:38 +08:00
|
|
|
|
Debug.Log("PropId:" + stopuseProp);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "move.Location":
|
2024-12-14 14:31:48 +08:00
|
|
|
|
//Debug.Log("move.Location<6F><6E><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD>");
|
2025-01-02 11:59:10 +08:00
|
|
|
|
MoveResponse playermove = ProtoBufffer.DeSerialize<MoveResponse>(bytes);
|
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
NpcData npcData = ProtoBufffer.DeSerialize<NpcData>(bytes);
|
2024-12-14 14:31:48 +08:00
|
|
|
|
//Debug.Log(npcData);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (npcData.Type == 1)//npc<70><63><EFBFBD><EFBFBD>
|
2024-12-09 11:30:15 +08:00
|
|
|
|
{
|
2024-12-12 15:48:41 +08:00
|
|
|
|
float x = -float.Parse(npcData.X.ToString());
|
2024-12-09 11:30:15 +08:00
|
|
|
|
float y = float.Parse(npcData.Y.ToString());
|
|
|
|
|
float z = float.Parse(npcData.Z.ToString());
|
2024-12-12 16:02:29 +08:00
|
|
|
|
Vector3 position = new Vector3(x, y, z);
|
|
|
|
|
|
2024-12-12 18:51:08 +08:00
|
|
|
|
NPCController.instance.InitNPC(position, npcData);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-09 11:30:15 +08:00
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
if (npcData.Type == 2)//npc<70>ƶ<EFBFBD>
|
2024-12-09 11:30:15 +08:00
|
|
|
|
{
|
2024-12-14 16:33:31 +08:00
|
|
|
|
Vector3 v = new Vector3(float.Parse(npcData.X.ToString()), float.Parse(npcData.Y.ToString()) + 0.5f, float.Parse(npcData.Z.ToString()));
|
2024-12-16 10:24:19 +08:00
|
|
|
|
//NPCController.instance.npcposition.Add(v);
|
|
|
|
|
//foreach (RecuseNpc item in NPCController.instance.npcsList)
|
|
|
|
|
//{
|
|
|
|
|
// if (npcData.UserId == item.npcId)
|
|
|
|
|
// {
|
|
|
|
|
// //Debug.Log("================" + v);
|
|
|
|
|
// item.SetNpcDes(v);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
foreach (var npcDict in NPCController.instance.npcsList)
|
2024-12-12 18:51:08 +08:00
|
|
|
|
{
|
2024-12-16 10:24:19 +08:00
|
|
|
|
foreach (var kvp in npcDict)
|
2024-12-12 18:51:08 +08:00
|
|
|
|
{
|
2024-12-16 10:24:19 +08:00
|
|
|
|
RecuseNpc npc = kvp.Key; // <20><>ȡ NPC <20>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Vector3 position = kvp.Value; // <20><>ȡ NPC <20><>λ<EFBFBD>ã<EFBFBD>ֵ<EFBFBD><D6B5>
|
|
|
|
|
|
|
|
|
|
if (npcData.UserId == npc.npcId)
|
|
|
|
|
{
|
|
|
|
|
npc.SetNpcDes(v);
|
2024-12-16 10:30:18 +08:00
|
|
|
|
Debug.Log($"NPCID{npcData.UserId}NPCPOSITION{v}");
|
2024-12-16 10:24:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-29 14:19:18 +08:00
|
|
|
|
|
2024-12-12 18:51:08 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-09 11:30:15 +08:00
|
|
|
|
}
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-09 11:30:15 +08:00
|
|
|
|
//npc.transform.name = npcData.UserId;
|
|
|
|
|
//npc.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
|
|
|
|
|
//npc.transform.position = new Vector3(x, y + 0.25f, z);
|
|
|
|
|
//npc.transform.parent = GameObject.Find("schoo103").transform;
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
2024-12-12 19:49:08 +08:00
|
|
|
|
case "task.InitStart":
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-12 19:49:08 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//13(1)<29><><EFBFBD><EFBFBD>
|
2024-12-05 17:38:33 +08:00
|
|
|
|
case "task.TaskTrigger":
|
|
|
|
|
Debug.Log("-----------task.TaskTrigger");
|
|
|
|
|
TaskTrigger taskTrigger = ProtoBufffer.DeSerialize<TaskTrigger>(bytes);
|
|
|
|
|
Debug.Log(taskTrigger);
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-05 17:38:33 +08:00
|
|
|
|
|
|
|
|
|
break;
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//13(2)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-05 17:38:33 +08:00
|
|
|
|
case "task.UpdateTask":
|
|
|
|
|
Debug.Log("-----------task.TaskTrigger");
|
2024-12-12 17:00:17 +08:00
|
|
|
|
MoveRequest taskUpdateRequest = ProtoBufffer.DeSerialize<MoveRequest>(bytes);
|
2024-12-05 17:38:33 +08:00
|
|
|
|
Debug.Log(taskUpdateRequest);
|
|
|
|
|
|
2024-12-27 23:36:33 +08:00
|
|
|
|
|
2024-12-05 17:38:33 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><F3B4A5B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
case "object.HandleObject":
|
|
|
|
|
Debug.Log("-----------object.HandleObject");
|
|
|
|
|
RequestObject requestObject = ProtoBufffer.DeSerialize<RequestObject>(bytes);
|
|
|
|
|
Debug.Log(requestObject);
|
|
|
|
|
|
|
|
|
|
break;
|
2024-12-27 11:35:45 +08:00
|
|
|
|
//
|
2024-12-12 17:00:17 +08:00
|
|
|
|
case "move.MoveNpc":
|
|
|
|
|
Debug.Log("-----------move.MoveNpc");
|
|
|
|
|
MoveRequest moveRequest = ProtoBufffer.DeSerialize<MoveRequest>(bytes);
|
|
|
|
|
Debug.Log(moveRequest);
|
|
|
|
|
|
|
|
|
|
break;
|
2024-12-05 17:38:33 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
2024-12-14 16:33:31 +08:00
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//15.<2E><><EFBFBD><EFBFBD><F3B4A5B7><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-26 21:59:25 +08:00
|
|
|
|
case "hall.ThatUser":
|
|
|
|
|
Debug.Log("-----------move.MoveNpc");
|
|
|
|
|
PlayerJoinResponse PlayerJoinResponse = ProtoBufffer.DeSerialize<PlayerJoinResponse>(bytes);
|
|
|
|
|
Debug.Log(PlayerJoinResponse);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//16.<2E><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
2024-12-26 21:59:25 +08:00
|
|
|
|
case "hall.GetTaskList":
|
2025-01-02 11:59:10 +08:00
|
|
|
|
/*
|
|
|
|
|
TaskListResponsetmessage
|
|
|
|
|
repeated TaskResponse tasks =1;//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
|
|
|
|
|
message TaskResponsef
|
|
|
|
|
string TaskId =1;//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
string status =2;//״̬
|
|
|
|
|
string RoomId =3;//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
float X=4;//x<><78><EFBFBD><EFBFBD>
|
|
|
|
|
float Y=5;// y<><79><EFBFBD><EFBFBD>
|
|
|
|
|
float z=6;// z<><7A><EFBFBD><EFBFBD>
|
|
|
|
|
string Type = 7;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
int64 TimeLimit =8;//ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Desc=9;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
string Trigger =10;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string NextTasks =11;//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string TargetType =12;//<2F>ձ<EFBFBD><D5B1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Reward =13;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
string Note =14;//<2F><>ע
|
|
|
|
|
string CreateTime =15;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string UpdateTime =16;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string ToUserId =17;//<2F>ձ<EFBFBD><D5B1>û<EFBFBD>id
|
|
|
|
|
string BaseTaskId =18;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
|
|
|
|
|
*/
|
2024-12-26 21:59:25 +08:00
|
|
|
|
Debug.Log("-----------move.MoveNpc");
|
|
|
|
|
TaskListResponse TaskListResponse = ProtoBufffer.DeSerialize<TaskListResponse>(bytes);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
foreach (var task in TaskListResponse.Tasks)
|
2024-12-26 21:59:25 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log(task.TaskId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
//17.<2E><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>v
|
|
|
|
|
case "voice.RtcTokenHandler":
|
|
|
|
|
/*
|
|
|
|
|
uint32 uid =1;// <20>û<EFBFBD>id
|
|
|
|
|
ChannelName=2;//Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>string
|
|
|
|
|
ChannelId=3;//Ƶ<><C6B5>idstring
|
|
|
|
|
string Token =4://<2F><><EFBFBD><EFBFBD>token
|
|
|
|
|
Channelrype=5;//Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>string
|
|
|
|
|
string appId =7;// <20><>Ҫ֪ͨ<CDA8>Ľ<EFBFBD>ɫ
|
|
|
|
|
*/
|
|
|
|
|
Debug.Log("-----------move.MoveNpc");
|
|
|
|
|
VoiceResponse voiceResponse = ProtoBufffer.DeSerialize<VoiceResponse>(bytes);
|
|
|
|
|
Debug.Log(voiceResponse);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//19. <09><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-26 21:59:25 +08:00
|
|
|
|
case "select.SelectTrigger":
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
tring Id =1;// ѡ<><D1A1><EFBFBD><EFBFBD>ID
|
|
|
|
|
string BaseId =2;//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
string Note =3;// ѡ<><D1A1>˵<EFBFBD><CBB5>
|
|
|
|
|
string Group =4;// ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string UnDisplay =5;// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> 1 ֻ<><D6BB>ʾһ<CABE><D2BB> 2 <20><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>ʾ
|
|
|
|
|
string ShowText =6;//<2F><>ʾ<EFBFBD>ı<EFBFBD>
|
|
|
|
|
string Icon =7;// ͼ<><CDBC>
|
|
|
|
|
string Preconditions=8;//ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Exclusive =9;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ռ
|
|
|
|
|
string TaskTime =10;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
int64 TimeLimit = 11;// ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string NextSelect =12;//<2F><>һ<EFBFBD><D2BB>ѡ<EFBFBD><D1A1>
|
|
|
|
|
string TaskLink = 13;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string TaskLinkDetails = 14;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string callMode = 15;// <20><><EFBFBD>з<EFBFBD>ʽ
|
|
|
|
|
string callRecipient =16;//<2F><><EFBFBD>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Correctoption=17;//<2F><>ȷѡ<C8B7><D1A1>
|
|
|
|
|
string Reward =18;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
string Result=19;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
string Route =20;//·<><C2B7>
|
|
|
|
|
string TimingChange = 21;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
|
|
|
|
string ApplieduI = 22;// <20>Ƿ<EFBFBD><C7B7><EFBFBD>Ӧ<EFBFBD><D3A6>UI
|
|
|
|
|
string UIDetails = 23;// UI<55><49><EFBFBD><EFBFBD>
|
|
|
|
|
string Seq = 24;// ִ<><D6B4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡
|
|
|
|
|
string PlayScript = 25;// JSON<4F><4E>ʽ<EFBFBD>IJ<EFBFBD><C4B2>Žű<C5BD>
|
|
|
|
|
string RoomId=26;//<2F><><EFBFBD><EFBFBD>ID
|
|
|
|
|
string CreateTime =27;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string UpdateTime =28;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string UserId =29;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
string RoleId =30;//<2F><>ɫID
|
|
|
|
|
*/
|
2024-12-27 21:02:43 +08:00
|
|
|
|
Debug.Log("select.SelectTrigger");
|
2024-12-26 21:59:25 +08:00
|
|
|
|
SelectResponse selectRequest = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
|
|
|
|
Debug.Log(selectRequest);
|
|
|
|
|
|
|
|
|
|
break;
|
2024-12-27 21:02:43 +08:00
|
|
|
|
|
|
|
|
|
//20. ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
2024-12-26 21:59:25 +08:00
|
|
|
|
case "select.GetSelectHistoryList":
|
2025-01-02 11:59:10 +08:00
|
|
|
|
/*
|
|
|
|
|
message SelectHistoryResponse
|
|
|
|
|
meated selectResponse selects= 1;// ѡ<><D1A1><EFBFBD><EFBFBD>ʷ<EFBFBD>б<EFBFBD>
|
|
|
|
|
|
|
|
|
|
message SelectResponse
|
|
|
|
|
string Id =1;// ѡ<><D1A1><EFBFBD><EFBFBD>ID
|
|
|
|
|
string BaseId =2;//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
string Note =3;//ѡ<><D1A1>˵<EFBFBD><CBB5>
|
|
|
|
|
string Group =4;//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string UnDisplay =5;// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> 1 ֻ<><D6BB>ʾһ<CABE><D2BB> 2 <20><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>ʾ
|
|
|
|
|
string ShowText =6;// <20><>ʾ<EFBFBD>ı<EFBFBD>
|
|
|
|
|
string Icon =7;// ͼ<><CDBC>
|
|
|
|
|
string Preconditions=8;//ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Exclusive =9;// <20>Ƿ<EFBFBD><C7B7><EFBFBD>ռ
|
|
|
|
|
string TaskTime =10;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
int64 TimeLimit = 11;// ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string NextSelect=12;//<2F><>һ<EFBFBD><D2BB>ѡ<EFBFBD><D1A1>
|
|
|
|
|
string TaskLink=13;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string TaskLinkDetails=14;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string callMode =15;//<2F><><EFBFBD>з<EFBFBD>ʽ
|
|
|
|
|
string callRecipient =16;//<2F><><EFBFBD>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string Correctoption=17;//<2F><>ȷѡ<C8B7><D1A1>
|
|
|
|
|
string Reward =18;// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
string Result = 19;// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
string Route =20;//·<><C2B7>
|
|
|
|
|
string Timingchange =21;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
|
|
|
|
string ApplieduI=22;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ӧ<EFBFBD><D3A6>UI
|
|
|
|
|
string UIDetails=23;//UI<55><49><EFBFBD><EFBFBD>
|
|
|
|
|
string Seq=24;// ִ<><D6B4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡
|
|
|
|
|
string PlayScript=25;//JSON<4F><4E>ʽ<EFBFBD>IJ<EFBFBD><C4B2>Žű<C5BD>
|
|
|
|
|
string RoomId=26;//<2F><><EFBFBD><EFBFBD>ID
|
|
|
|
|
string CreateTime=27;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string UpdateTime =28;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
string UserId =29;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
string RoleId =30://<2F><>ɫID
|
|
|
|
|
repeated UserList SelectUserList =31;//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ID
|
|
|
|
|
repeated string SelectRoleList=32;//ѡ<><D1A1><EFBFBD>Ľ<EFBFBD>ɫID
|
|
|
|
|
message UserList{
|
|
|
|
|
string UserId =1://<2F>û<EFBFBD>ID
|
|
|
|
|
string RoleId=2;//<2F><>ɫID
|
|
|
|
|
*/
|
2024-12-27 21:02:43 +08:00
|
|
|
|
Debug.Log("select.GetSelectHistoryList");
|
2024-12-26 21:59:25 +08:00
|
|
|
|
SelectHistoryResponse selectHistoryResponse = ProtoBufffer.DeSerialize<SelectHistoryResponse>(bytes);
|
2024-12-29 14:19:18 +08:00
|
|
|
|
foreach (var selectRes in selectHistoryResponse.Selects)
|
2024-12-26 21:59:25 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log(selectRes.Id);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2024-12-27 21:02:43 +08:00
|
|
|
|
//21.NPC<50>Ƿ<C7B7><F1B1BBBF><EFBFBD>
|
2025-01-02 11:59:10 +08:00
|
|
|
|
case "hall.PlayerReady":
|
|
|
|
|
//SelectResponse selectResponse = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
2024-12-27 21:02:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//23.<2E><><EFBFBD>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> 2024.12.30
|
|
|
|
|
//case "hall.PlayerSituation":
|
|
|
|
|
// //SelectResponse selectResponse = ProtoBufffer.DeSerialize<SelectResponse>(bytes);
|
|
|
|
|
// PlayerStatisticsResponse playerStatisticsResponse1 = ProtoBufffer.DeSerialize<PlayerStatisticsResponse>(bytes);
|
|
|
|
|
// foreach(var item in playerStatisticsResponse1.Data)
|
|
|
|
|
// {
|
|
|
|
|
// Debug.Log(item.UserId);
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
//23.<2E><><EFBFBD>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> 2024.12.30 ֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD><EFBFBD>øĵ<C3B8>
|
|
|
|
|
case "hall.PlayerSituation":
|
2024-12-30 22:59:22 +08:00
|
|
|
|
Debug.LogError("<22><><EFBFBD><EFBFBD>״̬11111111111111111");
|
|
|
|
|
PlayerStatisticsResponse playerStatisticsResponse = ProtoBufffer.DeSerialize<PlayerStatisticsResponse>(bytes);
|
2025-01-02 15:10:09 +08:00
|
|
|
|
Debug.LogError(playerStatisticsResponse.Data.Count);
|
|
|
|
|
foreach (var item in playerStatisticsResponse.Data)
|
2024-12-30 22:59:22 +08:00
|
|
|
|
{
|
|
|
|
|
Debug.Log(item.RoleId);
|
|
|
|
|
Debug.Log(item.IsReady);
|
|
|
|
|
}
|
|
|
|
|
Personnelpreparation.instance.playerStatisticsResponse = playerStatisticsResponse;
|
|
|
|
|
Personnelpreparation.instance.UpdateSubObjectList();
|
|
|
|
|
break;
|
2024-12-26 21:59:25 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
//25.<2E><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Ƿ<EFBFBD><C7B7><EFBFBD>¼
|
|
|
|
|
case "user.UnOnlineByUser":
|
|
|
|
|
|
2024-12-26 21:59:25 +08:00
|
|
|
|
|
2025-01-02 11:59:10 +08:00
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//case "hall.RoomStartTime":
|
|
|
|
|
// JoinRoomRequest joinRoomRequest = ProtoBufffer.DeSerialize<JoinRoomRequest>(bytes);
|
|
|
|
|
// Debug.Log("PropId:" + joinRoomRequest.RoomId);
|
|
|
|
|
// break;
|
|
|
|
|
//case " hall.MessageToUser":
|
|
|
|
|
// //JoinRoomRequest joinRoomRequest = ProtoBufffer.DeSerialize<JoinRoomRequest>(bytes);
|
|
|
|
|
// //Debug.Log("PropId:" + joinRoomRequest.RoomId);
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
|
2024-12-05 17:38:33 +08:00
|
|
|
|
|
2024-12-04 15:05:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|