Ejemplo n.º 1
0
    void RPC_S2C_RemoveMask(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte index = stream.Read <byte> ();

        if (ForceSetting.Instance.Conflict(Id, mainPlayerId))
        {
            return;
        }

        PeMap.UserLabel userLabel = (PeMap.UserLabel)PeMap.LabelMgr.Instance.Find(iter =>
        {
            if (iter is PeMap.UserLabel)
            {
                PeMap.UserLabel label = (PeMap.UserLabel)iter;
                return(label.playerID == Id && label.index == index);
            }

            return(false);
        });

        if (null != userLabel)
        {
            PeMap.LabelMgr.Instance.Remove(userLabel);
        }
    }
Ejemplo n.º 2
0
    void RPC_S2C_MaskAreaList(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte[] binData = stream.Read <byte[]> ();

        if (ForceSetting.Instance.Conflict(Id, mainPlayerId))
        {
            return;
        }

        PETools.Serialize.Import(binData, (r) =>
        {
            int count = BufferHelper.ReadInt32(r);
            for (int i = 0; i < count; i++)
            {
                byte index = BufferHelper.ReadByte(r);
                int iconId = BufferHelper.ReadInt32(r);
                Vector3 pos;
                BufferHelper.ReadVector3(r, out pos);
                string desc = BufferHelper.ReadString(r);

                PeMap.UserLabel label = new PeMap.UserLabel();
                label.pos             = pos;
                label.icon            = iconId;
                label.text            = desc;
                label.index           = index;
                label.playerID        = Id;

                PeMap.LabelMgr.Instance.Add(label);
            }
        });

        //WorldMapManager.InitMaskArea(areas);
    }
Ejemplo n.º 3
0
 public bool CompareTo(ILabel label)
 {
     if (label is UserLabel)
     {
         UserLabel userLabel = (UserLabel)label;
         if (pos == userLabel.pos)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
    void RPC_S2C_MakeMask(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte    index  = stream.Read <byte> ();
        Vector3 pos    = stream.Read <Vector3> ();
        int     iconId = stream.Read <int> ();
        string  desc   = stream.Read <string> ();

        if (ForceSetting.Instance.Conflict(Id, mainPlayerId))
        {
            return;
        }

        PeMap.UserLabel userLabel = (PeMap.UserLabel)PeMap.LabelMgr.Instance.Find(iter =>
        {
            if (iter is PeMap.UserLabel)
            {
                PeMap.UserLabel label = (PeMap.UserLabel)iter;
                return(label.playerID == Id && label.index == index);
            }

            return(false);
        });

        if (null != userLabel)
        {
            PeMap.LabelMgr.Instance.Remove(userLabel);
        }

        userLabel          = new PeMap.UserLabel();
        userLabel.pos      = pos;
        userLabel.icon     = iconId;
        userLabel.text     = desc;
        userLabel.index    = index;
        userLabel.playerID = Id;
        PeMap.LabelMgr.Instance.Add(userLabel);
    }