コード例 #1
0
    void ConnectToWorld()
    {
        var randomWorld = SubSceneManager.RequestRandomAwayWorldLink(this);

        if (randomWorld == null)
        {
            Logger.Log("StationGateway failed to connect to an away world");
            SetOffline();
            return;
        }

        selectedWorld = randomWorld;

        Message = "Teleporting to: " + selectedWorld.WorldName;

        if (selectedWorld.spawnMobsOnConnection)
        {
            selectedWorld.SetUp(this);
        }

        if (HasPower)
        {
            SetOnline();
            ServerChangeState(true);

            var text = "Alert! New Gateway connection formed.\n\n Connection established to: " + selectedWorld.WorldName;
            CentComm.MakeAnnouncement(CentComm.CentCommAnnounceTemplate, text, CentComm.UpdateSound.alert);
        }
    }
コード例 #2
0
 public static void RegisterWorldGateway(WorldGateway gateway)
 {
     Instance.worldGatewayCache.Add(gateway);
 }