예제 #1
0
    // Token: 0x06000ABA RID: 2746 RVA: 0x0004D570 File Offset: 0x0004B770
    private Player SpawnPlayer(Vector3 spawnPoint)
    {
        ZLog.DevLog("Spawning player:" + Time.frameCount);
        Player component = UnityEngine.Object.Instantiate <GameObject>(this.m_playerPrefab, spawnPoint, Quaternion.identity).GetComponent <Player>();

        component.SetLocalPlayer();
        this.m_playerProfile.LoadPlayerData(component);
        ZNet.instance.SetCharacterID(component.GetZDOID());
        component.OnSpawned();
        return(component);
    }
예제 #2
0
 // Token: 0x06000D10 RID: 3344 RVA: 0x0005D2E8 File Offset: 0x0005B4E8
 private void RPC_AddItem(long sender, string name)
 {
     if (!this.m_nview.IsOwner())
     {
         return;
     }
     if (this.GetStatus() != Fermenter.Status.Empty)
     {
         return;
     }
     if (!this.IsItemAllowed(name))
     {
         ZLog.DevLog("Item not allowed");
         return;
     }
     this.m_addedEffects.Create(base.transform.position, base.transform.rotation, null, 1f);
     this.m_nview.GetZDO().Set("Content", name);
     this.m_nview.GetZDO().Set("StartTime", ZNet.instance.GetTime().Ticks);
 }
예제 #3
0
    // Token: 0x06000B89 RID: 2953 RVA: 0x00052DCC File Offset: 0x00050FCC
    public void StartRandomEvent()
    {
        if (!ZNet.instance.IsServer())
        {
            return;
        }
        List <KeyValuePair <RandomEvent, Vector3> > possibleRandomEvents = this.GetPossibleRandomEvents();

        ZLog.Log("Possible events:" + possibleRandomEvents.Count);
        if (possibleRandomEvents.Count == 0)
        {
            return;
        }
        foreach (KeyValuePair <RandomEvent, Vector3> keyValuePair in possibleRandomEvents)
        {
            ZLog.DevLog("Event " + keyValuePair.Key.m_name);
        }
        KeyValuePair <RandomEvent, Vector3> keyValuePair2 = possibleRandomEvents[UnityEngine.Random.Range(0, possibleRandomEvents.Count)];

        this.SetRandomEvent(keyValuePair2.Key, keyValuePair2.Value);
    }