//发送机器人的角色信息 //play 玩家对象 public void SendRobotInfo(PlayerObject play /*bool boRepeat = true*/) { uint legion_id = RobotLegionManager.GetInstance().GetLegionId(mInfo.legion_name); NetMsg.MsgRoleInfo role = new NetMsg.MsgRoleInfo(); role.Create(null, play.GetGamePackKeyEx()); role.role_id = this.GetTypeId(); role.x = mInfo.x; role.y = mInfo.y; role.armor_id = mInfo.armor_id; role.wepon_id = mInfo.wepon_id; role.face_sex = role.face_sex1 = mInfo.lookface; role.dir = mInfo.dir; role.guanjue = mInfo.guanjue; role.hair_id = mInfo.hair; role.rid_id = mInfo.rid_id; role.str.Add(mInfo.name); //军团 if (mInfo.legion_name.Length > 0) { role.legion_id = legion_id; role.legion_title = mInfo.legion_title; role.legion_place = mInfo.legion_place; role.legion_id1 = legion_id; } play.SendData(role.GetBuffer()); //军团名称- if (legion_id > 0) { NetMsg.MsgLegionName legion = new NetMsg.MsgLegionName(); legion.Create(null, play.GetGamePackKeyEx()); legion.legion_id = legion_id; legion.legion_name = mInfo.legion_name; play.SendData(legion.GetBuffer()); //if (boRepeat) //{ // mListPlay.Add(play.GetTypeId()); //} } //取该玩家对象- 如果是王、女王、公爵则行礼 //2015.11.21 遇到玩家就行礼 //GameStruct.GUANGJUELEVEL lv = play.GetGuanJue(); //if (lv == GameStruct.GUANGJUELEVEL.KING || // lv == GameStruct.GUANGJUELEVEL.QUEEN || // lv == GameStruct.GUANGJUELEVEL.DUKE // ) //{ // this.PlayFaceAcion(Define._ACTION_GENUFLECT, play); // } this.PlayFaceAcion(Define._ACTION_GENUFLECT, play); }
//发送机器人的角色信息 //play 玩家对象 public void SendRobotInfo(PlayerObject play/*bool boRepeat = true*/) { uint legion_id = RobotLegionManager.GetInstance().GetLegionId(mInfo.legion_name); NetMsg.MsgRoleInfo role = new NetMsg.MsgRoleInfo(); role.Create(null, play.GetGamePackKeyEx()); role.role_id = this.GetTypeId(); role.x = mInfo.x; role.y = mInfo.y; role.armor_id = mInfo.armor_id; role.wepon_id = mInfo.wepon_id; role.face_sex = role.face_sex1 = mInfo.lookface; role.dir = mInfo.dir; role.guanjue = mInfo.guanjue; role.hair_id = mInfo.hair; role.rid_id = mInfo.rid_id; role.str.Add(mInfo.name); //军团 if (mInfo.legion_name.Length > 0) { role.legion_id = legion_id; role.legion_title = mInfo.legion_title; role.legion_place = mInfo.legion_place; role.legion_id1 = legion_id; } play.SendData(role.GetBuffer()); //军团名称- if (legion_id > 0) { NetMsg.MsgLegionName legion = new NetMsg.MsgLegionName(); legion.Create(null, play.GetGamePackKeyEx()); legion.legion_id = legion_id; legion.legion_name = mInfo.legion_name; play.SendData(legion.GetBuffer()); //if (boRepeat) //{ // mListPlay.Add(play.GetTypeId()); //} } //取该玩家对象- 如果是王、女王、公爵则行礼 //2015.11.21 遇到玩家就行礼 //GameStruct.GUANGJUELEVEL lv = play.GetGuanJue(); //if (lv == GameStruct.GUANGJUELEVEL.KING || // lv == GameStruct.GUANGJUELEVEL.QUEEN || // lv == GameStruct.GUANGJUELEVEL.DUKE // ) //{ // this.PlayFaceAcion(Define._ACTION_GENUFLECT, play); // } this.PlayFaceAcion(Define._ACTION_GENUFLECT, play); }
public void SendRoleInfo(PlayerObject play) { NetMsg.MsgRoleInfo role = new NetMsg.MsgRoleInfo(); role.Create(null, this.GetGamePackKeyEx()); role.role_id = play.GetTypeId(); role.x = play.GetCurrentX(); role.y = play.GetCurrentY(); role.armor_id = play.GetItemSystem().GetArmorLook(); role.wepon_id = play.GetItemSystem().GetWeaponLook(); // role.face_sex = play.GetFace(); role.face_sex = (uint)play.GetLookFace(); role.face_sex1 = play.GetBaseAttr().lookface; role.dir = play.GetDir(); role.action = play.GetCurrentAction(); role.guanjue = (byte)play.GetGuanJue(); role.hair_id = play.GetBaseAttr().hair; role.str.Add(play.GetName()); role.rid_id = play.GetMountID(); //军团 if (play.GetLegionSystem().IsHaveLegion() && play.GetLegionSystem().GetLegion() != null) { role.legion_id = play.GetLegionSystem().GetLegion().GetBaseInfo().id; role.legion_title = play.GetLegionSystem().GetLegion().GetBaseInfo().title; role.legion_place = play.GetLegionSystem().GetPlace(); role.legion_id1 = role.legion_id; } this.SendData(role.GetBuffer()); //发送状态 play.GetTimerSystem().SendState(this); //军团名称- if (role.legion_id > 0) { NetMsg.MsgLegionName legion = new NetMsg.MsgLegionName(); legion.Create(null, this.GetGamePackKeyEx()); legion.legion_id = role.legion_id; legion.legion_name = play.GetLegionSystem().GetLegion().GetBaseInfo().name; this.SendData(legion.GetBuffer()); } //加到对方玩家可视列表 //if (!this.GetVisibleList().ContainsKey(play.GetGameID())) //{ // RefreshObject refobj = new RefreshObject(); // refobj.bRefreshTag = true; // refobj.obj = play; // this.GetVisibleList()[play.GetGameID()] = refobj; //} this.AddVisibleObject(play, true); //前面发送了角色的lookface 却并没有变为鬼魂状态,用这个协议号再改变一次..偷个懒 省的去分析封包结构了。 if (play.IsDie() && play.IsGhost()) { play.ChangeAttribute(UserAttribute.LOOKFACE, play.GetLookFace(), true); } }