Facepunch / Facepunch.Steamworks

Another fucking c# Steamworks implementation
MIT License
2.84k stars 342 forks source link

Workshop items created blank #67

Closed Talsidor closed 6 years ago

Talsidor commented 7 years ago

When I call Publish on a workshop item it does show up in Steam, but none of the content travels with it. Here's the code I'm using to submit the item:

Workshop.Editor workshopItem = Steam.client.Workshop.CreateItem(Workshop.ItemType.Community); 
workshopItem.Title = MapManager.selectedMap.name; 
workshopItem.Folder = tempDirPath; 
workshopItem.PreviewImage = "preview.jpg"; 
workshopItem.Visibility = Workshop.Editor.VisibilityType.Public; 
workshopItem.Publish();

Here's a screenshot of an uploaded item, blank name, no image, 0 bytes of data. (You'll also notice it's Hidden when I set visibility above to Public.) image

No errors or warnings are thrown, this is using the latest release (0.6). I can also confirm there's a 9.84 KB preview.jpg and 86.3 KB of other data in the folder at the time Publish is called.

MollerVictor commented 7 years ago

Does "workshopItem.Error" say anything after the publishing is finished? I remember getting the same problem, when trying to upload before I allowed users to have space/files on steam cloud and enabling "ISteamUGC for file transfer".

Talsidor commented 7 years ago

workshopItem.Error is just an empty string, even several minutes after Publish was called. I created a coroutine to report upload progress but workshopItem.Progress and workshopItem.BytesUploaded stay at 0 indefinitely. workshopItem.Publishing also stays true indefinitely.

I double-checked the Steam portal for the title but ISteamUGC file transfer and Steam Cloud user data are both set correctly and published.

(Also NeedToAgreeToWorkshopLegal is false and workshopItem.BytesTotal is 0.)

Talsidor commented 6 years ago

Would anyone be able to paste the code of their working implementation of uploading a workshop item? I still can't get this to upload a non-blank item.

Talsidor commented 6 years ago

I pulled down the source code and stepped through the code. The issue appears to be that the OnItemCreated callback (registered on Line 113 of Workshop.Editor) simply never gets executed. I'm at a loss as to why this would be.

MollerVictor commented 6 years ago

https://gist.github.com/MollerVictor/c1b8a9c16fce4078aa1f006dbee4dd41

I have had no troubles running this code.

Talsidor commented 6 years ago

@MollerVictor Thanks. I've made my code practically identical to yours but still no callback. Can I ask if you've used it from inside the Unity editor or only builds? And are you using Facepunch.Steamworks 0.6 or a different version?

MollerVictor commented 6 years ago

I don't use the callback, I checking it every frame.

https://gist.github.com/MollerVictor/d5d7a0440ce946e1b742a049d273be59

Talsidor commented 6 years ago

Sorry, I meant the callback internal to the API. Steam is not executing the OnItemCreated callback, which I mentioned above seems to be the reason it's not working for me. I'm also checking it every frame.

Talsidor commented 6 years ago

I spent the last few hours coding up the same functionality using Steamworks.NET, and it works. Facepunch.Steamworks still isn't receiving the OnItemCreated callback from Steam. :frowning_face:

garrynewman commented 6 years ago

Are you running 64bit or 32bit?