Sign In Register

How can we help you today?

Start a new topic

Export Webgl in Unity 2017.3

Hi, Im getting this error when trying to make a webgl build since the last two SDK updates. 


Assets/GameSparks/GameSparksRTUnity.cs(456,30): error CS0122: `GameSparks.RT.GameSparksRT.MAX_RTDATA_SLOTS' is inaccessible due to its protection level


As a workaround I'm just commenting that out.


Hi Hjupter,


Thanks. We'll look into this for you. 


Regards,

Liam

Hi Hjupter,


The SDK team has identified the issue. It will be addressed in an SDK update soon.


Regards,

Liam

Good afternoon,


Is there an ETA for this fix?  This has scuppered my plans to release simultaneously across multiple platforms in time for Christmas, hoping to do so for 2018.


Thanks,


Dan

Hi Dan, it seems like MAX_RTDATA_SLOTS is set in gamespaks-rt.jslib :

window.GameSparksRT={};window.GameSparksRT.MAX_RTDATA_SLOTS=128;

So I tried this in GameSparksRTUnity.cs :

   

#if UNITY_WEBGL && !UNITY_EDITOR
private static int MAX_RTDATA_SLOTS_COMPILE_ERROR_WORKAROUND = 128;

private int GetNumItemsData(RTData data)
{
	int numItems = 0;

	if (data != null) {
		for (int i = MAX_RTDATA_SLOTS_COMPILE_ERROR_WORKAROUND - 1; i >= 0 ; i --) { // HACK
			if (data.GetInt ((uint)i) != null || data.GetLong ((uint)i) != null || data.GetFloat ((uint)i) != null ||
				data.GetDouble ((uint)i) != null || data.GetRTVector ((uint)i) != null || data.GetString ((uint)i) != null ||
				data.GetData ((uint)i) != null) {
				numItems = i + 1;

				break;
			}
		}
	}

	return numItems;
}

 and it did compile. Though I have a weird issue with the WebGL build: GS WebSocket connection doesn't occur at all (no log in the game or in the Chrome dev tools WS filtered network console), I don't know if it's linked or not.

Ok, as a matter of fact, my problem had nothing to do with Gamesparks, the compile error workaround is still valid, though.

Has this been sorted yet?
Login to post a comment