DiscordGSM / GameServerMonitor

📺 A discord bot that monitors your game server and tracks the live data of your game servers. Supports over 260 game servers.
https://discordgsm.com
MIT License
119 stars 64 forks source link

Support for Ark: Survival Ascended using EOS #54

Closed dkoz closed 8 months ago

dkoz commented 8 months ago

This pull request will add support for Ark: Survival Ascended (ASA) using epics EOS api.

Some key notes:

This is an example API request from the EOS API:


    'sessions': [{
        'deployment': 'ad9a8feffb3b4b2ca315546f038c3ae2',
        'id': '7978933815d04377af2f67930749da72',
        'bucket': 'TestGameMode_C:<None>:TheIsland_WP',
        'settings': {
            'maxPublicPlayers': 70,
            'allowInvites': True,
            'shouldAdvertise': True,
            'allowReadById': True,
            'allowJoinViaPresence': True,
            'allowJoinInProgress': True,
            'allowConferenceRoom': False,
            'checkSanctions': False,
            'allowMigration': False,
            'rejoinAfterKick': '',
            'platforms': None
        },
        'totalPlayers': 5,
        'openPublicPlayers': 65,
        'publicPlayers': [],
        'started': False,
        'lastUpdated': None,
        'attributes': {
            'MINORBUILDID_s': '11',
            'MODID_l': 0,
            'CUSTOMSERVERNAME_s': 'GR8 NewbZ Evolved PVE 10x',
            'ADDRESSDEV_s': '51.81.48.2,127.0.0.1',
            'ISPRIVATE_l': 0,
            'SERVERPASSWORD_b': False,
            'MATCHTIMEOUT_d': 120.0,
            'ENABLEDMODSFILEIDS_s': '4854705,4861202,4851634,4846256,4856936,4863828,4863178,4829265,4825342,4820622,4861686,4856764,4830799,4863213,4821647',
            'DAYTIME_s': '205',
            'SOTFMATCHSTARTED_b': False,
            'STEELSHIELDENABLED_l': 0,
            'SERVERUSESBATTLEYE_b': False,
            'EOSSERVERPING_l': 98,
            'ALLOWDOWNLOADCHARS_l': 1,
            'OFFICIALSERVER_s': '0',
            'GAMEMODE_s': 'TestGameMode_C',
            'ADDRESS_s': '51.81.48.2',
            'SEARCHKEYWORDS_s': 'Custom',
            'EOS_BLISTENING_b': True,
            'ALLOWDOWNLOADITEMS_l': 1,
            'LEGACY_l': 0,
            'ADDRESSBOUND_s': '0.0.0.0:7777',
            'SESSIONISPVE_l': 1,
            'EOS_BUSESPRESENCE_b': True,
            'ENABLEDMODS_s': '928793,928988,932822,900062,929521,930115,930494,930829,929830,928565,929183,928597,929110,929489,928708',
            'SESSIONNAMEUPPER_s': 'GR8 NEWBZ EVOLVED PVE 10X - (V26.11)',
            'SERVERPLATFORMTYPE_s': 'All',
            'MAPNAME_s': 'TheIsland_WP',
            'BUILDID_s': '26',
            'SESSIONNAME_s': 'GR8 NewbZ Evolved PVE 10x - (v26.11)'
        },
        'owner': 'Client_xyza7891muomRmynIIHaJB9COBKkwj6n',
        'ownerPlatformId': None
    }],
    'count': 1
}```
patrix87 commented 8 months ago

This change includes Epic API secret key and client id. I would recommend looking for a public API that does not require those. Otherwise they would need to be added through the environment variables and definitely not directly in the code.

dkoz commented 8 months ago

This change includes Epic API secret key and client id. I would recommend looking for a public API that does not require those. Otherwise they would need to be added through the environment variables and definitely not directly in the code.

Unfortunately there really is no other way to query servers under EOS. A public API equivalent would something like BattleMetrics which uses a similar method I'm introducing here.

I can definitely load the credentials through the environment file instead of being hardcoded. Should I modify the .env.example or just leave it blank for now while introducing the change into the code itself?

BattlefieldDuck commented 8 months ago

I guess that is not a big deal, these credentials can be provided by the game developers or extracted from the game's files.