Exemplo n.º 1
0
 public void InitAtbFromMsg(NotifyAtb msg)
 {
     for (int i = 0; i < msg.atbTypes.Count; ++i)
     {
         int     atbInt  = msg.atbTypes[i];
         AtbType atbType = (AtbType)atbInt;
         SetAtb(atbType, msg.atbValues[i]);
     }
 }
Exemplo n.º 2
0
    void InitAtb()
    {
        NotifyAtb msg = null;

        if (AtbInitData.TryGetValue(gid, out msg))
        {
            InitAtbFromMsg(msg);
            AtbInitData.Remove(gid);
        }
    }
Exemplo n.º 3
0
    static void AtbNotify(byte[] data)
    {
        Scene scn = SceneSystem.Instance.mCurrentScene;

        if (scn == null)
        {
            return;
        }
        NotifyAtb msg = ProtoBufUtils.Deserialize <NotifyAtb>(data);
        Character cha = scn.GetCharacter(msg.uid);

        if (cha == null)
        {
            Character.AtbInitData[msg.uid] = msg;
            return;
        }
        cha.InitAtbFromMsg(msg);
    }
Exemplo n.º 4
0
 public void PacketToMsg()
 {
     if (mAtbMsgAround == null)
     {
         mAtbMsgAround     = new NotifyAtb();
         mAtbMsgAround.uid = mCharacter.gid;
     }
     if (mAtbMsgSelf == null)
     {
         mAtbMsgSelf     = new NotifyAtb();
         mAtbMsgSelf.uid = mCharacter.gid;
     }
     foreach (var kv in atbNodes)
     {
         AtbNode node = kv.Value;
         if (node == null)
         {
             return;
         }
         node.PacketToMsg();
     }
 }