diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index cce3ec84..3a4a845f 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -488,7 +488,25 @@ public class test : MonoBehaviour wEBScriptListener.SendMessageByte(sendData); } - + //推送玩家信息 + 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(sendData); + PlayerJoinResponse login = ProtoBufffer.DeSerialize(deinfo.Data.ToByteArray()); + Debug.Log("==========消息转发函数调用"); + //BroadcastFrameMsg.FramesFieldNumber + + wEBScriptListener.SendMessageByte(sendData); + } public void TriggerNpcArrive() { MoveRoomAoiRequest data = new MoveRoomAoiRequest(); diff --git a/xiaofang/Assets/Script/hylScripts/PlayerState.cs b/xiaofang/Assets/Script/hylScripts/PlayerState.cs index f31f701c..97721723 100644 --- a/xiaofang/Assets/Script/hylScripts/PlayerState.cs +++ b/xiaofang/Assets/Script/hylScripts/PlayerState.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; @@ -6,6 +7,32 @@ using UnityEngine; public class PlayerState : MonoBehaviour { + PlayerJoinResponse playerJoinResponse; + string UserName;// 用户名 + string RoomId;// 房间Id + int Status;//扶态日特加入 1进行中 2已结束 + string RoleName;// 角色名 + int IsLeadingNPC;//1=此职业有分管NPC的功 + bool Online;// 判断是否在线 true 在线 false 离线 + int RoleId =7;// 角色id + int GroupLeader = 8;// 是否是组长 0 组员 1 组长 2 总指挥 3 主持人 + int ActionHode;//0=主持人1=指令式行动2=自由行动 + int Group =10;//小组归属 -1 无归属 有值有归属 + double X = 11;// 坚标X + double Y = 12;// 坚标Y + double Z = 13;// 坚标Z + string OverseeCond;// 分管区域ID + int SendFraneCount=15;//玩家发送的帧数 + int HovespeedFirst;//移动速度1 + int Movespeedsecond = 17;//移动速度2 + int MoveSpeedThird = 18;//移动速度3 + int BearLoad = 19;// 负重 + int Protection = 20;//防护值 + int Health = 100;//健康值 100 + int Rolestatus = 22;//角色扶态 0正常 1行动受限 2负伤 3昏速 4手变伤 + int UserId = 23;// 用户id + + [Header("玩家总血量")] public float totalHp = 100; [Header("玩家当前血量")] @@ -17,6 +44,7 @@ public class PlayerState : MonoBehaviour // Start is called before the first frame update void Start() { + currentHp = totalHp; }