Exemplo n.º 1
0
    void RPC_S2C_StartLogin(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        _pos = transform.position = stream.Read <Vector3>();
        int  recordTeamId = stream.Read <int>();
        bool hasRecord    = stream.Read <bool>();

        _networkState = stream.Read <ENetworkState>();

        if (null != RoomGui_N.Instance && RoomGui_N.Instance.isShow)
        {
            RoomGui_N.ChangePlayerStateByNet(Id, (int)NetworkState);
        }

        _useNewPos = UseNewPosition(hasRecord, recordTeamId);

        ChunkManager.Clear();

        if (null != PeSceneCtrl.Instance)
        {
            PeSceneCtrl.Instance.GotoGameSence();
        }

        if (Pathea.PeGameMgr.IsCustom)
        {
            int descId = -1 == DescId ? Id : DescId;
            curPlayerDesc = ForceSetting.AddPlayer(descId, TeamId, EPlayerType.Human, RoleName);
        }
    }
    void uLink_OnSerializeNetworkView(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (stream.isWriting == false)
        {
            // This is performed on deserialization.

            ballphysics.transform.position = stream.Read <Vector3>();
            ballphysics.transform.rotation = stream.Read <Quaternion>();
            ballphysics.velocity           = stream.Read <Vector2>();
            ballphysics.angularVelocity    = stream.Read <float>();
        }
    }
Exemplo n.º 3
0
    void RPC_S2C_GenRandomItem(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        Vector3    pos        = stream.Read <Vector3>();
        Quaternion rot        = stream.Read <Quaternion>();
        int        templateId = stream.Read <int>();

        int[] itemIdCount = stream.Read <int[]>();

        RandomItem.RandomItemBoxInfo boxInfo = RandomItem.RandomItemBoxInfo.GetBoxInfoById(templateId);
        if (boxInfo != null)
        {
            RandomItemMgr.Instance.AddItmeResult(pos, rot, templateId, itemIdCount, boxInfo.boxModelPath);
        }
    }
Exemplo n.º 4
0
    protected virtual void RPC_S2C_SkillCastShoot(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int     skillID = stream.Read <int>();
        Vector3 pos     = stream.Read <Vector3>();

        DefaultPosTarget target = new DefaultPosTarget(pos);

        SkillRunner caster = Runner as SkillRunner;

        if (null != caster && !caster.IsController)
        {
            caster.RunEffOnProxy(skillID, target);
        }
    }
Exemplo n.º 5
0
    private static object Deserializer(uLink.BitStream bs, params object[] codecOptions)
    {
        NetEntityID yid = new NetEntityID {
            p1 = bs.Read <ushort>(codecOptions)
        };

        if (yid.p1 == 0)
        {
            yid._viewID = bs.Read <uLink.NetworkViewID>(codecOptions);
            return(yid);
        }
        yid.p2 = bs.Read <ushort>(codecOptions);
        return(yid);
    }
Exemplo n.º 6
0
    void RPC_S2C_Damage(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        stream.Read <int>();
        int scenarioId = stream.Read <int>();

        stream.Read <int>();
        int   casterScenarioId = stream.Read <int>();
        float damage           = stream.Read <float>();

        if (null != PlayerNetwork.mainPlayer)
        {
            PlayerNetwork.mainPlayer.OnCustomDamage(scenarioId, casterScenarioId, damage);
        }
    }
Exemplo n.º 7
0
    //[RPC]
    //protected virtual void RPC_S2C_SetFloat_String(uLink.BitStream stream)
    //{
    //	if (IsController || null == Runner) return;
    //	string name = stream.Read<string>();
    //	float value = stream.Read<float>();

    //	AiObject ai = Runner as AiObject;
    //	if (ai != null)
    //	{
    //		ai.SetFloat(name,value);
    //	}
    //}

    //[RPC]
    //protected virtual void RPC_S2C_SetFloat_Int(uLink.BitStream stream)
    //{
    //	if (IsController || null == Runner) return;
    //	int id = stream.Read<int>();
    //	float value = stream.Read<float>();
    //	AiObject ai = Runner as AiObject;
    //	if (ai != null)
    //	{
    //		ai.SetFloat(id, value);
    //	}
    //}

    //[RPC]
    //protected virtual void RPC_S2C_SetFloat_String_1(uLink.BitStream stream)
    //{
    //	if (IsController || null == Runner) return;
    //	string name = stream.Read<string>();
    //	float value = stream.Read<float>();
    //	float dampTime = stream.Read<float>();
    //	float deltaTime = stream.Read<float>();

    //	AiObject ai = Runner as AiObject;
    //	if (ai != null)
    //	{
    //		ai.SetFloat(name, value, dampTime, deltaTime);
    //	}

    //}

    //[RPC]
    //protected virtual void RPC_S2C_RPC_C2S_SetFloat_Int_1(uLink.BitStream stream)
    //{
    //	if (IsController || null == Runner) return;
    //	int id = stream.Read<int>();
    //	float value = stream.Read<float>();
    //	float dampTime = stream.Read<float>();
    //	float deltaTime = stream.Read<float>();
    //	AiObject ai = Runner as AiObject;
    //	if (ai != null)
    //	{
    //		ai.SetFloat(id, value, dampTime, deltaTime);
    //	}
    //}

    protected virtual void RPC_S2C_SetBool_String(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth || null == Runner)
        {
            return;
        }
        string   name  = stream.Read <string> ();
        bool     value = stream.Read <bool> ();
        AiObject ai    = Runner as AiObject;

        if (ai != null)
        {
            ai.SetBool(name, value);
        }
    }
Exemplo n.º 8
0
    protected void RPC_S2C_SetIKRotation(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth || null == Runner)
        {
            return;
        }
        AvatarIKGoal goal         = stream.Read <AvatarIKGoal> ();
        Quaternion   goalPosition = stream.Read <Quaternion> ();
        AiObject     ai           = Runner as AiObject;

        if (ai != null)
        {
            ai.SetIKRotation(goal, goalPosition);
        }
    }
Exemplo n.º 9
0
    protected void RPC_S2C_SetIKRotationWeight(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth || null == Runner)
        {
            return;
        }
        AvatarIKGoal goal  = stream.Read <AvatarIKGoal> ();
        float        value = stream.Read <float> ();
        AiObject     ai    = Runner as AiObject;

        if (ai != null)
        {
            ai.SetIKRotationWeight(goal, value);
        }
    }
Exemplo n.º 10
0
    protected virtual void RPC_S2C_TwoHandWeaponAttack(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth || null == Runner)
        {
            return;
        }
        Vector3 v3   = stream.Read <Vector3>();
        int     type = stream.Read <int>();
        int     time = stream.Read <int>();

        if (Equipment != null)
        {
            Equipment.TwoHandWeaponAttack(v3, type, time);
        }
    }
Exemplo n.º 11
0
    protected virtual void RPC_S2C_SetBool(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth || null == Runner)
        {
            return;
        }
        int name = stream.Read <int> ();
        //string name = stream.Read<string>();
        bool b = stream.Read <bool> ();

        if (animatorCmpt != null)
        {
            animatorCmpt.SetBool(name, b);
        }
    }
Exemplo n.º 12
0
    public void Read(BitStream stream)
    {
//        Name = stream.Read<string>();
        Params.Experience = stream.ReadInt32();
//        Params.Rank = stream.ReadByte();
        Params.Money = stream.ReadInt32();
        Params.Gold  = stream.ReadInt32();

        InventoryList = stream.Read <PPIInventoryList>();
        EquipList     = stream.Read <PPIEquipList>();
        Upgrades      = stream.Read <PPIUpgradeList>();

//        Statistic = stream.Read<PPIStatistic>();
//        Score = stream.Read<PPIRoundScore>();
    }
Exemplo n.º 13
0
    void RPC_S2C_CLN_PlantClean(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        /*int farmId = */ stream.Read <int>();
        FarmPlantLogic plant = stream.Read <FarmPlantLogic>();

        CSMgCreator creator = MultiColonyManager.GetCreator(TeamId);

        if (creator == null || creator.Assembly == null)
        {
            return;
        }
        CSFarm farm = creator.Assembly.Farm;

        farm.RestoreCleaningPlant(plant);
    }
Exemplo n.º 14
0
    void RPC_S2C_CLN_PlantUpdateInfo(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int            objId = stream.Read <int> ();
        double         life  = stream.Read <double> ();
        double         water = stream.Read <double> ();
        double         clean = stream.Read <double> ();
        FarmPlantLogic plant = FarmManager.Instance.GetPlantByItemObjID(objId);

        if (plant != null)
        {
            plant.mLife  = life;
            plant.mWater = water;
            plant.mClean = clean;
        }
    }
Exemplo n.º 15
0
    void RPC_S2C_RandomIsoObj(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        Vector3       rioPos        = stream.Read <Vector3>();
        int           objInstanceId = stream.Read <int>();
        RandomItemObj rio           = RandomItemMgr.Instance.GetRandomItemObj(rioPos);

        if (rio != null)
        {
            rio.AddRareInstance(objInstanceId);
            if (Application.isEditor)
            {
                Debug.LogError("<color=yellow>A Rare RandomItem is Ready!" + rioPos + " </color>");
            }
        }
    }
Exemplo n.º 16
0
    void RPC_S2C_WeaponDurability(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        float      hp    = stream.Read <float>();
        int        objId = stream.Read <int>();
        ItemObject item  = ItemMgr.Instance.Get(objId);

        if (item != null)
        {
            Durability d = item.GetCmpt <Durability>();
            if (d != null)
            {
                d.floatValue.current = hp;
            }
        }
    }