Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (!dropEventManager)
        {
            dropEventManager = GetComponent <DropEventManager>();
        }
        if (!ferryProgress)
        {
            ferryProgress = FindObjectOfType <FerryProgress>();
        }
        if (!gameCamera)
        {
            gameCamera = FindObjectOfType <GameCamera>();
        }

        if (!playerLogoManager)
        {
            playerLogoManager = GetComponent <PlayerLogoManager>();
        }
        if (!villageManager)
        {
            villageManager = FindObjectOfType <VillageManager>();
        }

        if (!settings)
        {
            settings = GetComponent <GameSettings>();
        }
        if (!subEventManager)
        {
            subEventManager = GetComponent <TwitchEventManager>();
        }
        if (!subEventManager)
        {
            subEventManager = gameObject.AddComponent <TwitchEventManager>();
        }

        if (!commandServer)
        {
            commandServer = GetComponent <CommandServer>();
        }
        if (!islandManager)
        {
            islandManager = GetComponent <IslandManager>();
        }
        if (!itemManager)
        {
            itemManager = GetComponent <ItemManager>();
        }
        if (!playerManager)
        {
            playerManager = GetComponent <PlayerManager>();
        }
        if (!chunkManager)
        {
            chunkManager = GetComponent <ChunkManager>();
        }
        if (!craftingManager)
        {
            craftingManager = GetComponent <CraftingManager>();
        }
        if (!raidManager)
        {
            raidManager = GetComponent <RaidManager>();
        }
        if (!streamRaidManager)
        {
            streamRaidManager = GetComponent <StreamRaidManager>();
        }
        if (!arenaController)
        {
            arenaController = FindObjectOfType <ArenaController>();
        }

        if (!ferryController)
        {
            ferryController = FindObjectOfType <FerryController>();
        }
        if (!musicManager)
        {
            musicManager = GetComponent <MusicManager>();
        }

        RegisterGameEventHandler <ItemAddEventHandler>(GameEventType.ItemAdd);
        RegisterGameEventHandler <ResourceUpdateEventHandler>(GameEventType.ResourceUpdate);
        RegisterGameEventHandler <ServerMessageEventHandler>(GameEventType.ServerMessage);

        RegisterGameEventHandler <VillageInfoEventHandler>(GameEventType.VillageInfo);
        RegisterGameEventHandler <VillageLevelUpEventHandler>(GameEventType.VillageLevelUp);

        RegisterGameEventHandler <PlayerRemoveEventHandler>(GameEventType.PlayerRemove);
        RegisterGameEventHandler <PlayerAddEventHandler>(GameEventType.PlayerAdd);
        RegisterGameEventHandler <PlayerExpUpdateEventHandler>(GameEventType.PlayerExpUpdate);
        RegisterGameEventHandler <PlayerJoinArenaEventHandler>(GameEventType.PlayerJoinArena);
        RegisterGameEventHandler <PlayerJoinDungeonEventHandler>(GameEventType.PlayerJoinDungeon);
        RegisterGameEventHandler <PlayerJoinRaidEventHandler>(GameEventType.PlayerJoinRaid);
        RegisterGameEventHandler <PlayerNameUpdateEventHandler>(GameEventType.PlayerNameUpdate);
        RegisterGameEventHandler <PlayerTaskEventHandler>(GameEventType.PlayerTask);


        RegisterGameEventHandler <StreamerWarRaidEventHandler>(GameEventType.WarRaid);
        RegisterGameEventHandler <StreamerRaidEventHandler>(GameEventType.Raid);
        RegisterGameEventHandler <PlayerAppearanceEventHandler>(GameEventType.PlayerAppearance);
        RegisterGameEventHandler <ItemBuyEventHandler>(GameEventType.ItemBuy);
        RegisterGameEventHandler <ItemSellEventHandler>(GameEventType.ItemSell);

        commandServer.StartServer(this);
        musicManager.PlayBackgroundMusic();
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        if (!dropEventManager)
        {
            dropEventManager = GetComponent <DropEventManager>();
        }
        if (!ferryProgress)
        {
            ferryProgress = FindObjectOfType <FerryProgress>();
        }
        if (!gameCamera)
        {
            gameCamera = FindObjectOfType <GameCamera>();
        }

        if (!settings)
        {
            settings = GetComponent <GameSettings>();
        }
        if (!subEventManager)
        {
            subEventManager = GetComponent <TwitchEventManager>();
        }
        if (!subEventManager)
        {
            subEventManager = gameObject.AddComponent <TwitchEventManager>();
        }

        if (!commandServer)
        {
            commandServer = GetComponent <CommandServer>();
        }

        if (!islandManager)
        {
            islandManager = GetComponent <IslandManager>();
        }
        if (!itemManager)
        {
            itemManager = GetComponent <ItemManager>();
        }
        if (!playerManager)
        {
            playerManager = GetComponent <PlayerManager>();
        }
        if (!chunkManager)
        {
            chunkManager = GetComponent <ChunkManager>();
        }
        if (!craftingManager)
        {
            craftingManager = GetComponent <CraftingManager>();
        }
        if (!raidManager)
        {
            raidManager = GetComponent <RaidManager>();
        }
        if (!streamRaidManager)
        {
            streamRaidManager = GetComponent <StreamRaidManager>();
        }
        if (!arenaController)
        {
            arenaController = FindObjectOfType <ArenaController>();
        }

        if (!ferryController)
        {
            ferryController = FindObjectOfType <FerryController>();
        }
        if (!musicManager)
        {
            musicManager = GetComponent <MusicManager>();
        }


        commandServer.StartServer(this);

        musicManager.PlayBackgroundMusic();
    }