Raised This Month: $344 Target: $400
 86%   Almost there!

[CSGO] Workshop Collection Cycling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-16-2022 , 06:02   [CSGO] Workshop Collection Cycling
Reply With Quote #1

The steam workshop has trouble with updating multiple collections at once if the total map count is over 100 or 150 (about that much, it changes from time to time), it would return a HTTP 400 Error.

I was wondering if there was a solution possible through sourcemod to cycle through collection ids one by one, moving to the next once it sees that it has finished updating from a collection? I was thinking maybe it could read the debug logs from the sv_debug_ugc_downloads 1 cvar?

The server reads the collection id from subscribed_collection_ids.txt and maybe this solution would have like a workshop_ids_all.txt with all the collection ids and it would loop through them putting one collection id in subscribed_collection_ids.txt at a time switching to the next when it sees it is done (not sure how this will be done).

The command to manually update from the file is ds_get_newest_subscribed_files

For example this is what I am trying to update:
Quote:
2849457149 // Collection 1 (100 maps)
2849463207 // Collection 2 (100 maps)
2849463412 // Collection 3 (100 maps)
2849463553 // Collection 4 (100 maps)
2849463722 // Collection 5 (100 maps)
2849464025 // Collection 6 (100 maps)
2849464182 // Collection 7 (100 maps)
2849464317 // Collection 8 (100 maps)
2849464476 // Collection 9 (28 maps)
Help is appreciated.

https://developer.valvesoftware.com/...rver_Operators

Last edited by AuricYoutube; 08-16-2022 at 06:04.
AuricYoutube is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-16-2022 , 07:03   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #2

okay...

CSGO have these workshop commands
Code:
"host_workshop_collection"
FCVAR_GAMEDLL 
- Get the latest version of maps in a workshop collection and host them as a maplist.

"host_workshop_map"
FCVAR_GAMEDLL 
- Get the latest version of the map and host it on this server.


"workshop_start_map"
FCVAR_GAMEDLL 
- Sets the first map to load once a workshop collection been hosted. Takes the file id of desired start map as a parameter.
Instead modified txt file,
try use command host_workshop_collection to host different collections.
I'm not familiar with these, what happen when you change to different collections during game play. Does it have check/download delay aka idle time ?

Not sure, do you need use workshop_start_map mapid also.

...I never have handled 100 maps or more
Bacardi is offline
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-16-2022 , 08:17   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
okay...

CSGO have these workshop commands...
These commands change to the maps, while ds_get_newest_subscribed_files simply grabs the workshop collection id from subscribed_file/collection_ids.txt and compares the maps in there to the map files which exist in maps/workshop updating any that are out of date (if the publisher of the workshop map were to update them)

As an example this is what shows up from the debug log when I run the command but have all the collections in there at once (csgo/subscribed_collection_ids.txt):

Quote:
Server UGC Manager: Failed to get file info. HTTP status 400
Failed to get file info information from steam, HTTP status: 400
. Missing info for file ids: 2044480266 1738623286 1195605978 687020203 652958899 ...
But if I only have one collection in there its fine:

Quote:
...
Skipping download for file id 1195619049:'bhop_kiwi_cwfx_csgo_b5' - version on disk is latest.
CDedicatedServerWorkshopManager: received file details for id 1541563350: 'bhop_kokiri'.
Skipping download for file id 1541563350:'bhop_kokiri' - version on disk is latest.
CDedicatedServerWorkshopManager: received file details for id 2355731521: 'bhop_kr_d'.
Skipping download for file id 2355731521:'bhop_kr_d' - version on disk is latest.
CDedicatedServerWorkshopManager: received file details for id 1924085791: 'bhop_kuukkeli'.
Skipping download for file id 1924085791:'bhop_kuukkeli' - version on disk is latest.
CDedicatedServerWorkshopManager: received file details for id 1644046441: 'bhop_kotodama (CSGO)'.
Skipping download for file id 1644046441:'bhop_kotodama (CSGO)' - version on disk is latest.
CDedicatedServerWorkshopManager: received file details for id 1195619375: 'bhop_kyle'.
Skipping download for file id 1195619375:'bhop_kyle' - version on disk is latest.
...

Last edited by AuricYoutube; 08-16-2022 at 08:27.
AuricYoutube is offline
oqyh
Senior Member
Join Date: May 2019
Location: United Arab Emirates
Old 08-16-2022 , 09:48   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #4

Quote:
Originally Posted by AuricYoutube View Post
The steam workshop has trouble with updating multiple collections at once if the total map count is over 100 or 150 (about that much, it changes from time to time), it would return a HTTP 400 Error.

I was wondering if there was a solution possible through sourcemod to cycle through collection ids one by one, moving to the next once it sees that it has finished updating from a collection? I was thinking maybe it could read the debug logs from the sv_debug_ugc_downloads 1 cvar?

The server reads the collection id from subscribed_collection_ids.txt and maybe this solution would have like a workshop_ids_all.txt with all the collection ids and it would loop through them putting one collection id in subscribed_collection_ids.txt at a time switching to the next when it sees it is done (not sure how this will be done).

The command to manually update from the file is ds_get_newest_subscribed_files

For example this is what I am trying to update:


Help is appreciated.

https://developer.valvesoftware.com/...rver_Operators


add me discord
wanna try something
__________________
.:[ >> My Plugins << ]:.

My discord : Gold KingZ#1337
oqyh is online now
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-16-2022 , 17:02   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #5

Based on https://raw.githubusercontent.com/ki...lection_fix.sp

Code:
#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public void OnPluginStart()
{
    RegAdminCmd("updateworkshop", Command_Workshop, ADMFLAG_ROOT, "ds_get_newest_subscribed_files");
}

public Action Command_Workshop(int client, int args)
{
    char line[128];

    if(FileExists( "workshop_collections.txt") )
    {
        File collectionHandle = OpenFile("workshop_collections.txt", "r");

        while( !IsEndOfFile(collectionHandle) && ReadFileLine(collectionHandle,line,sizeof(line)) )
        {
          File dataFileHandle = OpenFile("subscribed_collection_ids.txt", "a");
          PrintToServer("Writing %s to subscribed_collection_ids.txt",line);
          dataFileHandle.WriteLine(line);
          dataFileHandle.Close();
          PrintToServer("Workshop ID Written to subscribed_collection_ids.txt");
          ServerCommand("ds_get_newest_subscribed_files");
          ** NEED DELAY HERE **
          DeleteFile("subscribed_collection_ids.txt");
          PrintToServer("Workshop ID removed from subscribed_collection_ids.txt");
        }
        collectionHandle.Close();
    }
    else
    {
        File collectionHandle = OpenFile("workshop_collections.txt", "a");
        collectionHandle.Close();
    }
    
    ReplyToCommand(client, "Workshop Updated");
    return Plugin_Handled;
}
However it does not work because it goes too fast. Anyone know how to add a delay after ServerCommand?

Last edited by AuricYoutube; 08-16-2022 at 17:04.
AuricYoutube is offline
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-18-2022 , 01:33   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #6

Quote:
Originally Posted by AuricYoutube View Post
...
However it does not work because it goes too fast. Anyone know how to add a delay after ServerCommand?
I tried using a timer for this but it did not really work because the while loop would still go on and the timer would not delay it at all.
AuricYoutube is offline
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-28-2022 , 14:09   Re: [CSGO] Workshop Collection Cycling
Reply With Quote #7

anyone have any ideas?
AuricYoutube is offline
Reply


Thread Tools
Display Modes

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 02:48.


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