コード例 #1
0
    public static void Process(byte[] bytes)
    {
        MsgDamage msg  = Utils.BytesToStruct <MsgDamage>(bytes);
        Role      role = Core.Game.GetEntity(msg.role) as Role;

        if (role != null)
        {
            role.Damage(msg.damage, msg.dir, msg.pos);
        }
    }
コード例 #2
0
    public IEnumerator Process()
    {
        switch (type)
        {
        case Type.Event:
            MsgEvent.Process(m_bytes);
            break;

        case Type.CreatePlayer:
            MsgCreatePlayer.Process(m_bytes);
            break;

        case Type.Account:
            MsgAccount.Process(m_bytes);
            break;

        case Type.ChangeMap:
            yield return(MsgChangeMap.Process(m_bytes));

            break;

        case Type.EntityEnter:
            MsgEntityEnter.Process(m_bytes);
            break;

        case Type.EntityLeave:
            MsgEntityLeave.Process(m_bytes);
            break;

        case Type.Move:
            MsgMove.Process(m_bytes);
            break;

        case Type.Action:
            MsgAction.Process(m_bytes);
            break;

        case Type.Damage:
            MsgDamage.Process(m_bytes);
            break;

        case Type.Attribs:
            MsgAttribs.Process(m_bytes);
            break;

        case Type.Bag:
            MsgBag.Process(m_bytes);
            break;

        case Type.ItemOperation:
            MsgItemOperation.Process(m_bytes);
            break;

        case Type.Missions:
            MsgMissions.Process(m_bytes);
            break;

        default:
            break;
        }
    }