コード例 #1
0
    void RPC_S2C_ASB_LevelUpStart(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        CSAssemblyData recordData = (CSAssemblyData)_ColonyObj._RecordData;

        recordData.m_CurUpgradeTime = stream.Read <float>();
        recordData.m_UpgradeTime    = stream.Read <float>();
        string roleName = stream.Read <string>();
        bool   success  = stream.Read <bool>();

        if (m_Entity == null)
        {
            Debug.LogWarning("entity not ready");
            return;
        }

        CSAssembly csAssembly = m_Entity as CSAssembly;

        csAssembly.StartUpgradeCounter(recordData.m_CurUpgradeTime, recordData.m_UpgradeTime);
        if (CSUI_MainWndCtrl.Instance.AssemblyUI != null && success)
        {
            CSUI_MainWndCtrl.Instance.AssemblyUI.UpgradeStartSuccuss(csAssembly, roleName);
        }
    }
コード例 #2
0
    void RPC_S2C_RCY_Start(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        bool success = stream.Read <bool>();

        if (success)
        {
            //1.data
            CSRecycleData recordData = (CSRecycleData)_ColonyObj._RecordData;
            recordData.m_CurTime = 0;
            recordData.m_Time    = ((CSRecycle)m_Entity).CountFinalTime();
            if (m_Entity == null)
            {
                Debug.LogError("entity not ready");
                return;
            }
            ((CSRecycle)m_Entity).StartCounter(recordData.m_CurTime, recordData.m_Time);

            //2.ui
            if (CSUI_MainWndCtrl.Instance.EngineeringUI != null)
            {
                CSUI_MainWndCtrl.Instance.EngineeringUI.StartWorkerResult(CSConst.etRecyle, m_Entity, "");
            }
        }
    }
コード例 #3
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);
    }
コード例 #4
0
    void RPC_S2C_PRC_SyncAllCounter(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (csp == null)
        {
            Debug.LogError("processing not exist");
            return;
        }
        List <float> curCounter   = stream.Read <float[]>().ToList();
        List <float> finalCounter = stream.Read <float[]>().ToList();
        List <int>   runCount     = stream.Read <int[]>().ToList();

        for (int i = 0; i < ProcessingConst.TASK_NUM; i++)
        {
            if (curCounter[i] < 0)
            {
                csp.SyncStop(i);
                csp.StopResult(i);
            }
            else
            {
                csp.SetCounter(i, curCounter[i], finalCounter[i], runCount[i]);
            }
        }
    }
コード例 #5
0
 void RPC_S2C_CLN_SetState(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     //--to do: wait
     //int state = stream.Read<int>();
     //int playID = stream.Read<int>();
     //if(playID != PlayerFactory.mMainPlayer.OwnerView.viewID.id)
     //{
     //    CSCreator creator = CSMain.GetCreator(CSConst.ciDefMgCamp);
     //    if (creator != null)
     //    {
     //        CSPersonnel[] personnels = creator.GetNps();
     //        foreach (CSPersonnel csp in personnels)
     //        {
     //            if(csp != null && csp.m_Npc != null && csp.m_Npc.Netlayer != null && csp.m_Npc.Netlayer is AiAdNpcNetwork)
     //            {
     //                if(objectID == ((AiAdNpcNetwork)csp.m_Npc.Netlayer).objectID)
     //                {
     //                    //csp.State = state;
     //                }
     //            }
     //        }
     //    }
     //}
 }
コード例 #6
0
    protected void RPC_SKSyncAttr(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int   indexData = (int)stream.Read <byte> ();
        float valueData = stream.Read <float> ();
        bool  bRaw      = stream.Read <bool> ();
        int   caster    = stream.Read <int>();

        if (runner != null && runner.SkEntityBase != null)
        {
            float oldData = runner.SkEntityBase.GetAttribute(indexData, !bRaw);
            runner.SkEntityBase._attribs.FromNet = true;
            runner.SkEntityBase.SetAttribute(indexData, valueData, false, bRaw, caster);
            runner.SkEntityBase._attribs.FromNet = false;
            if (!bRaw)
            {
                OnAttrChange((AttribType)indexData, runner.SkEntityBase.GetAttribute(indexData), caster, valueData - oldData);
            }
        }

//		if(indexData == 25)
//			Debug.LogError("Sync attk value = " + valueData);
//		if(indexData == 1)
//			Debug.LogError("Sync hp value = " + valueData);
    }
コード例 #7
0
ファイル: AiNetwork.cs プロジェクト: shrubba/planetexplorers
    protected virtual void RPC_S2C_AiNetworkIKTarget(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        if (hasOwnerAuth)
        {
            return;
        }

        Vector3 aimTarget;

        if (stream.TryRead <Vector3>(out aimTarget))
        {
            if (null == Runner)
            {
                return;
            }

            //if (Runner is AiNative)
            //{
            //    AiNative ai = Runner as AiNative;
            //    if (null != ai.aimer)
            //        ai.aimer.aimTarget = aimTarget;
            //}
        }
    }
コード例 #8
0
ファイル: AiNetwork.cs プロジェクト: shrubba/planetexplorers
    protected void RPC_S2C_SetIKPositionWeight(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)
        {
            switch (goal)
            {
            case AvatarIKGoal.LeftFoot:
                ai.SetLeftFootIKWeight(value);
                break;

            case AvatarIKGoal.LeftHand:
                ai.SetLeftHandIKWeight(value);
                break;

            case AvatarIKGoal.RightFoot:
                ai.SetRightFootIKWeight(value);
                break;

            case AvatarIKGoal.RightHand:
                ai.SetRightHandIKWeight(value);
                break;

            default:
                break;
            }
        }
    }
コード例 #9
0
    void RPC_S2C_RandomItemRareAry(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        List <Vector3>    posList    = stream.Read <Vector3[]>().ToList();
        List <Quaternion> rotList    = stream.Read <Quaternion[]>().ToList();
        List <int>        idList     = stream.Read <int[]>().ToList();
        List <int>        itemLength = stream.Read <int[]>().ToList();
        List <int>        allItems   = stream.Read <int[]>().ToList();

        for (int i = 0; i < posList.Count; i++)
        {
            Vector3    pos         = posList[i];
            Quaternion rot         = rotList[i];
            int        boxId       = idList[i];
            int        iCount      = itemLength[i];
            int[]      itemIdCount = new int[iCount];
            Array.Copy(allItems.ToArray(), itemIdCount, iCount);
            allItems.RemoveRange(0, iCount);
            RandomItem.RandomItemBoxInfo boxInfo = RandomItem.RandomItemBoxInfo.GetBoxInfoById(boxId);
            if (boxInfo != null)
            {
                RandomItemMgr.Instance.AddRareItmeResult(pos, rot, boxId, itemIdCount, boxInfo.boxModelPath);
            }
        }
    }
コード例 #10
0
    protected void RPC_S2C_ApplyHpChange(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        float damage = stream.Read <float>();
        int   life   = stream.Read <int>();

        uLink.NetworkViewID viewID = stream.Read <uLink.NetworkViewID>();

        CommonInterface caster = null;

        uLink.NetworkView view = uLink.NetworkView.Find(viewID);
        if (null != view)
        {
            NetworkInterface network = view.GetComponent <NetworkInterface>();
            if (null != network && null != network.Runner)
            {
                caster = network.Runner;
            }
        }

        if (null != Runner)
        {
            Runner.NetworkApplyDamage(caster, damage, life);
        }
    }
コード例 #11
0
    protected override void RPC_S2C_SetController(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        authId  = stream.Read <int>();
        _teamId = stream.Read <int>();

        ResetContorller();
        SendBaseAttr();
        if (_entity == null)
        {
            return;
        }
        var robot = _entity.GetComponent <WhiteCat.AIBehaviourController>();

        if (robot)
        {
            robot.SetCreater(_ownerId);
        }

//#if UNITY_EDITOR
//		PlayerNetwork p = PlayerNetwork.GetPlayer(authId);
//		if (null != p)
//			Debug.LogFormat("<color=blue>{0} got [{1}]'s authority.</color>", p.RoleName, Id);
//#endif
    }
コード例 #12
0
    protected void RPC_SKSyncInitAttrs(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte[] data = stream.Read <byte[]> ();
        if (runner != null && runner.SkEntityBase != null)
        {
            runner.SkEntityBase._attribs.FromNet = true;
            runner.SkEntityBase.Import(data);
            runner.SkEntityBase._attribs.FromNet = false;
        }
        else
        {
            Debug.LogError("RPC_SKSyncInitAttrs runner or SkEntityPE is null");
        }

        if (Runner != null && Runner.SkEntityBase != null)
        {
            Runner.SkEntityBase._attribs.LockModifyBySingle = false;
        }

        if (null != OnSkAttrInitEvent)
        {
            OnSkAttrInitEvent();
        }
    }
コード例 #13
0
    void RPC_S2C_PersonalStorageExchange(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int objID    = stream.Read <int>();
        int dstIndex = stream.Read <int>();
        int dstObjID = stream.Read <int>();
        int srcIndex = stream.Read <int>();

        ItemObject item = ItemMgr.Instance.Get(objID);

        if (null == item)
        {
            return;
        }

        NpcStorage storage = NpcStorageMgr.GetStorage(Id);

        if (null == storage)
        {
            return;
        }

        ItemObject dstObj = ItemMgr.Instance.Get(dstObjID);

        if (null != dstObj)
        {
            storage.Package.PutItem(dstObj, srcIndex);
        }
        else
        {
            storage.Package.RemoveItem(item);
        }

        storage.Package.PutItem(item, dstIndex);

        storage.Reset();
    }
コード例 #14
0
    void RPC_S2C_PersonalStorageSort(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int tabIndex = stream.Read <int>();

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

        NpcStorage storage = NpcStorageMgr.GetStorage(Id);

        if (null == storage)
        {
            return;
        }

        storage.Package.Clear((ItemPackage.ESlotType)tabIndex);
        SlotList itemList = storage.Package.GetSlotList((ItemPackage.ESlotType)tabIndex);

        for (int i = 0; i < ids.Length; i++)
        {
            ItemObject item = ItemMgr.Instance.Get(ids[i]);
            itemList[i] = item;
        }

        storage.Reset();
    }
コード例 #15
0
    void RPC_S2C_SkillCast(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int _skillID;

        uLink.NetworkViewID _viewID;

        stream.TryRead <int>(out _skillID);
        stream.TryRead <uLink.NetworkViewID>(out _viewID);

        SkillRunner caster = Runner as SkillRunner;

        if (null != caster)
        {
            ISkillTarget      target = null;
            uLink.NetworkView view   = uLink.NetworkView.Find(_viewID);
            if (null != view)
            {
                NetworkInterface network = view.GetComponent <NetworkInterface>();
                target = (null == network) ? null : network.Runner;
            }

            caster.RunEffOnProxy(_skillID, target);
        }
    }
コード例 #16
0
    void RPC_S2C_CampAreaList(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        Vector3[] campArea = stream.Read <Vector3[]> ();

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

        foreach (Vector3 townPos in campArea)
        {
            IntVector2 center = new IntVector2(Mathf.RoundToInt(townPos.x), Mathf.RoundToInt(townPos.z));
            if (VArtifactTownManager.Instance.TownPosInfo.ContainsKey(center))
            {
                //TownInfo ti = RandomTownManager.Instance.TownPosInfo[center];
                //WorldMapManager.Instance.AddCamp(townPos);
                //ti.IsExplored = true;
                VArtifactTown ti = VArtifactTownManager.Instance.TownPosInfo [center];
                //int id = ti.townId;
                if (VArtifactTownManager.Instance.IsCaptured(ti.townId))
                {
                    RandomMapIconMgr.AddDestroyedTownIcon(ti);
                }
                else
                {
                    RandomMapIconMgr.AddNativeIcon(ti);
                }
                foreach (VArtifactUnit vau in ti.VAUnits)
                {
                    vau.isDoodadNpcRendered = true;
                }
                ti.IsExplored = true;
                VArtifactTownManager.Instance.DetectTowns(ti);
            }
        }
    }
コード例 #17
0
 public static void RPC_S2C_ElapseSpeedShift(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     GameTime.Timer.ElapseSpeed = stream.Read <float>();
 }
コード例 #18
0
 public static void RPC_S2C_SyncGameTimer(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     GameTime.Timer.Tick = stream.Read <long>();
 }
コード例 #19
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportMove(uLink.NetworkPlayer player, Vector3 newPos, Vector3 newVelocity, uLink.NetworkMessageInfo info)
 {
 }
コード例 #20
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportMineDetected(uLink.NetworkPlayer player, Mine mine, uLink.NetworkMessageInfo info)
 {
 }
コード例 #21
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportAgentDetected(uLink.NetworkPlayer player, AgentHuman theAgent, AgentHuman sender, uLink.NetworkMessageInfo info)
 {
 }
コード例 #22
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static bool ReportAndValidateMelee(uLink.NetworkPlayer player, AgentHuman attacker, Agent target, uLink.NetworkMessageInfo info)
 {
     return(true);
 }
コード例 #23
0
ファイル: Controllable.cs プロジェクト: HexHash/LegacyRust
 private void OCO_FOUND(uLink.NetworkViewID viewID, ref uLink.NetworkMessageInfo info)
 {
     this.SetIdle(false);
     this.__networkViewForControllable = base.networkView;
     this.__controllerDriverViewID = viewID;
     this.__controllerCreateMessageInfo = info;
     this.FreshInitializeController();
 }
コード例 #24
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportUseItemInCover(uLink.NetworkPlayer player, E_ItemID gadget, E_CoverPose coverPose, E_CoverDirection coverDirection, uLink.NetworkMessageInfo info)
 {
 }
コード例 #25
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportRoll(uLink.NetworkPlayer player, E_Direction direction, uLink.NetworkMessageInfo info)
 {
 }
コード例 #26
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportChangeWeapon(uLink.NetworkPlayer player, E_WeaponID weapon, uLink.NetworkMessageInfo info)
 {
 }
コード例 #27
0
 public static void RPC_S2C_BuildBlock(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     byte[] binData = stream.Read <byte[]>();
     DigTerrainManager.ApplyBSVoxelData(binData);
 }
コード例 #28
0
ファイル: Controllable.cs プロジェクト: HexHash/LegacyRust
 public CL_Binder(Controllable owner, uLink.NetworkViewID rootID, uLink.NetworkViewID parentID, ref uLink.NetworkMessageInfo info)
 {
     this._root.id = rootID;
     this._parent.id = parentID;
     this._info = info;
     this.owner = owner;
     this.sameSearch = this._root.id == this._parent.id;
     int num = Controllable.CL_Binder.binderCount;
     Controllable.CL_Binder.binderCount = num + 1;
     if (num != 0)
     {
         this.prev = Controllable.CL_Binder.last;
         this.prev.next = this;
         Controllable.CL_Binder.last = this;
     }
     else
     {
         Controllable.CL_Binder cLBinder = this;
         Controllable.CL_Binder.last = cLBinder;
         Controllable.CL_Binder.first = cLBinder;
     }
 }
コード例 #29
0
    void RPC_S2C_ExitDungeon(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        //UILoadScenceEffect.Instance.EnableProgress(true);
        RequestFastTravel(0, RandomDungenMgrData.enterPos, 0);
//		FastTravel.TravelTo(RandomDungenMgrData.enterPos);
    }
コード例 #30
0
ファイル: ServerAnticheat.cs プロジェクト: huokele/shadow-gun
 public static void ReportUseItem(uLink.NetworkPlayer player, E_ItemID gadget, bool keepMotion, uLink.NetworkMessageInfo info)
 {
 }
コード例 #31
0
 public static void RPC_S2C_BlockData(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     /*int index = */ stream.Read <int>();
     byte[] data = stream.Read <byte[]>();
     DigTerrainManager.ApplyBlockData(data);
 }
コード例 #32
0
ファイル: Controllable.cs プロジェクト: HexHash/LegacyRust
 internal void PrepareInstantiate(Facepunch.NetworkView view, ref uLink.NetworkMessageInfo info)
 {
     PlayerClient playerClient;
     this.__controllerCreateMessageInfo = info;
     this.__networkViewForControllable = view;
     if (this.classFlagsRootControllable || this.classFlagsStandaloneVessel)
     {
         this.__controllerDriverViewID = uLink.NetworkViewID.unassigned;
         if (this.classFlagsStandaloneVessel)
         {
             return;
         }
     }
     else if (this.classFlagsDependantVessel || this.classFlagsFreeVessel)
     {
         if (!PlayerClient.Find(view.owner, out playerClient))
         {
             this.__controllerDriverViewID = uLink.NetworkViewID.unassigned;
         }
         else
         {
             this.__controllerDriverViewID = playerClient.topControllable.networkViewID;
         }
         if (this.classFlagsFreeVessel)
         {
             return;
         }
         if (this.__controllerDriverViewID == uLink.NetworkViewID.unassigned)
         {
             UnityEngine.Debug.LogError("NOT RIGHT");
             return;
         }
     }
     this.FreshInitializeController();
 }
コード例 #33
0
 public static void RPC_S2C_BlockDestroyInRange(uLink.BitStream stream, uLink.NetworkMessageInfo info)
 {
     byte[] data = stream.Read <byte[]>();
     DigTerrainManager.BlockDestroyInRangeNetReturn(data);
 }
コード例 #34
0
ファイル: PlayerClient.cs プロジェクト: HexHash/LegacyRust
 private void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo info)
 {
     this.netPlayer = info.networkView.owner;
     uLink.BitStream bitStream = info.networkView.initialData;
     this.userID = bitStream.ReadUInt64();
     this.userName = bitStream.ReadString();
     base.name = string.Concat(new string[] { "Player ", this.userName, " (", this.userID.ToString(), ")" });
     this.instantiationinfo = info;
     this._playerID = this.netPlayer.id;
     PlayerClient.g.playerIDDict[this._playerID] = this;
     PlayerClient.g.userIDDict[this.userID] = this;
     this.boundUserID = true;
     if (PlayerClient.localPlayerClient || !base.networkView.isMine)
     {
         base.enabled = false;
     }
     else
     {
         PlayerClient.localPlayerClient = this;
         base.enabled = true;
         this.nextAutoReclockTime = NetCull.localTimeInMillis + (long)8000;
     }
 }