Raised This Month: $51 Target: $400
 12% 

[TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoloZero01
Member
Join Date: May 2020
Location: Async Research Institute
Plugin ID:
8084
Plugin Version:
Plugin Category:
All
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 06-18-2022 , 15:55   [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!
    Reply With Quote #1

    SourceMod Smart FastDownloads

    This allows server owners to define multiple FastDL nodes via a simple config file and spread players by redirecting each to the closest node available.



    Dependencies:
    • SxGeo Extension (Uses SypexGeo database)
    • DHooks
    • [Optional] GeoIP2 that ships with SourceMod 1.11 Dev
    • Own gamedata

    How it works:

    It uses either SypexGeo or MaxMind database to look up the approximate coordinates of a given client. Then it compares them against all known FastDL node coordinates, picks the one with the shortest distance and sends it's corresponding link to the client. FastDL node coordinates are looked up in the same database on startup. If client cannot be located, this plugin will fall back to the original default sv_downloadurl value.

    Installation:
    • Grab the latest release from here: GRAB RELEASE
    • Install SxGeo or update to SourceMod 1.11 with newest GeoIP2.
    • Upload the contents of the archive to your root sourcemod directory
    • Open configs/fastdlmanager.cfg and add your FastDL nodes
    • Load the plugin

    Example node config entry:
    Code:
    		"Server Node 1"
    		{
    			"ip"		"8.8.8.8"
    			"Link"		"http://example.com/tf"
    		}
    ConVars:
    • sfd_debug - If enabled, writes debug-oriented information to fastdl_debug.log in the root sourcemod folder
    • sfd_lookup - 0 - use SxGeo to locate clients, 1 - use GeoIP2 to locate clients


    Compatibility:
    Given correct gamedata, it should generally work on any given Source game, as it doesn't have any game specific dependencies.
    For now I only provide gamedata for Team Fortress 2 Linux and Windows. Feel free to request gamedata for other games.

    Known issues:
    • Some IP addresses might not be present in the databases
    • Undiscovered...

    Future Plans:
    • Add flag-specific access (so only clients with certain flags i.e. donors can use this)
    • Allow players to choose their download node using a menu

    Credits:
    1. Naydef for helping me understand sigscanning, dhooks, helping with debug and providing Linux gamedata
    2. Samm-Cheese for assisting in testing
    3. NecGaming for providing their gameserver for live production testing
    4. Suza for code cleanup tips
    5. AlliedMods Discord members and their GitHub repos for help with random questions

    PRs, suggestions and improvements are welcome. This has been running on a live 27-slot server for around a month now, and I found no issues. I still consider myself an advanced beginner, so this might have flaws.

    Last edited by NoloZero01; 06-18-2022 at 15:57.
    NoloZero01 is offline
    Alexmy
    Senior Member
    Join Date: Oct 2014
    Location: Russian Federation
    Old 10-13-2022 , 14:43   Re: [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!
    Reply With Quote #2

    I understand correctly that you can use several web hostings, the plugin will automatically select the closest one for the player?
    __________________
    [/URL]
    Alexmy is offline
    NoloZero01
    Member
    Join Date: May 2020
    Location: Async Research Institute
    Old 10-13-2022 , 14:53   Re: [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!
    Reply With Quote #3

    Hello.
    Yes, that is correct. You have to specify the IP address of each web host (if you have a domain attached to it, just look it up via WHOIS or similar sources) in the config. The plugin will attempt to determine it's coordinates using the geo provider database on startup.
    After that whenever a client connects, the plugin loops through each available web host and determines the geographically closest one, and sends it's respective address to the client.

    Though be aware that the plugin is as accurate as the geo provider database is. If the IP of the client or the web server is missing the plugin will default to the standard fastdownload url. It's completely possible that the IP coordinates within the database may be incorrect (say the actual web host is in Germany, but the database thinks it's IP is in the US). I highly recommend keeping the database file up to date.

    If you need further assistance with the plugin, feel free to DM me here.
    NoloZero01 is offline
    Alexmy
    Senior Member
    Join Date: Oct 2014
    Location: Russian Federation
    Old 10-14-2022 , 06:47   Re: [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!
    Reply With Quote #4

    It looks very cool, but I got an error. Do I need to add some extension?

    PHP Code:
    L 10/14/2022 09:54:24: [SMUnable to load plugin "smart_fastdownloads.smx"Native "GeoipLatitude" was not found 
    __________________
    [/URL]
    Alexmy is offline
    NoloZero01
    Member
    Join Date: May 2020
    Location: Async Research Institute
    Old 10-20-2022 , 16:21   Re: [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location!
    Reply With Quote #5

    Hello.

    If you'd like to use GeoIP instead of SxGeo, you'll have to make sure that you're running the latest version of the GeoIP extension. I believe it ships with latest SM 1.11 builds these days.

    Older versions do not have the coordinate and distance related natives available.
    NoloZero01 is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 03:15.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode