BlueBox and WebPlayer - will it ever work?

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

pgbrandao
Posts: 8
Joined: 26 Nov 2010, 16:34

Postby pgbrandao » 30 May 2011, 18:56

Hello everyone,

I, too, was disappointed to find out BlueBox doesn't work on Unity as advertised. :? Let's hope this gets sorted out soon.
jimbobway
Posts: 20
Joined: 26 Oct 2010, 15:57

Postby jimbobway » 14 Jul 2011, 17:20

Has anything new come of this? Can BlueBox work with Unity's WebPlayer?
tpenn
Posts: 95
Joined: 03 Aug 2010, 18:48

Postby tpenn » 21 Jul 2011, 21:24

I am also very concerned about this feature not working as advertised, and hope a resolution can be reached.

Currently, the documentation reads:
» Known issues / limitations
The current BlueBox shipping with SFS2X RC2 is already production ready and has been tested under different scenarios of heavy traffic with excellent results. We are not aware of any issues at the moment.

Obviously that is not true. It should be changed.
jimbobway
Posts: 20
Joined: 26 Oct 2010, 15:57

Postby jimbobway » 01 Aug 2011, 15:15

One of the senior engineers I am working with has direct contact with Unity developers. They (Unity) are willing to work with us to get BlueBox working and apparently said "they will do what it takes." Does anyone here have any advice for me before going into this meeting? Please reply soon.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 05 Aug 2011, 06:59

As written in the other thread - I'm happy to participate in that.

/T
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
jimbobway
Posts: 20
Joined: 26 Oct 2010, 15:57

Postby jimbobway » 18 Aug 2011, 23:33

So I am still experimenting with this and management is looking into this problem with the Unity creators.

So I put the policy file on socket 443 which is https. It serves the policy file fine.

In my code I do this:

Code: Select all


Security.PrefetchSocketPolicy(serverName, 443));  //Serve policy on https
smartFox.Connect(serverName, [blockedPort]);  //Use blocked port so it uses BlueBox



In the first line it gets the policy file fine and PrefetchSocketPolicy returns true. In the second line, since it tries to connect to a blocked port (and fails) it will then switch to BlueBox on port 8080. However, I get this error in Unity (see below.) Note in the error "404 Not Found". BlueBox returns a "404" error which means it does, in fact, try to connect to BlueBox, and it does connect, but BlueBox returns 404. So I am leaning towards that it is a SmartFox BlueBox problem, not a Unity problem.

This occurs in Unity WebPlayer mode. (I can get BlueBox working, sorta, in Standalone mode.)

Code: Select all


[SFS DEBUG] ## BlueBox Error: System.Net.WebException: Error: ConnectFailure (Unexpected error while trying to call method_GetSecurityPolicyBlocking : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper+WebRequestPolicyProvider.GetPolicy (System.String policy_url) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicy (System.String requesturi_string, IPolicyProvider policyProvider) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicyForDotNetWebRequest (System.String requesturi_string, System.Reflection.MethodInfo policyProvidingMethod) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Net.WebConnection.CheckUnityWebSecurity (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0 ) ---> System.Security.SecurityException: Unexpected error while trying to call method_GetSecurityPolicyBlocking : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper+WebRequestPolicyProvider.GetPolicy (System.String policy_url) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicy (System.String requesturi_string, IPolicyProvider policyProvider) [0x00000] in <filename unknown>:0
  at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicyForDotNetWebRequest (System.String requesturi_string, System.Reflection.MethodInfo policyProvidingMethod) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Net.WebConnection.CheckUnityWebSecurity (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0
  at System.Net.WebConnection.LoggedThrow (System.Exception e) [0x00000] in <filename unknown>:0
  at System.Net.WebConnection.CheckUnityWebSecurity (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0
  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
  at System.Net.WebClient.UploadValuesCore (System.Uri uri, System.String method, System.Collections.Specialized.NameValueCollection data, System.Object userToken) [0x00000] in <filename unknown>:0
  at System.Net.WebClient.<UploadValuesAsync>m__15 (System.Object state) [0x00000] in <filename unknown>:0    at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
  at System.Net.WebClient.UploadValuesCore (System.Uri uri, System.String method, System.Collections.Specialized.NameValueCollection data, System.Object userToken) [0x00000] in <filename unknown>:0
  at System.Net.WebClient.<UploadValuesAsync>m__15 (System.Object state) [0x00000] in <filename unknown>:0



I am serving this crossdomain file on port 443:

<?xml version='1.0'?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 25 Aug 2011, 11:10

Just to sum up here.

BlueBox in standalone and iOS/Android works. BlueBox in webplayer works. BlueBox in webplayer via proxy seems to have issues (I dont run via proxy, so I've never had problems).

As described earlier, the API itself uses the standard mono/C# WebClient class to access the BlueBox server. There is no difference in the code what so ever between platforms here - not a single line of Unity specific code is in the API.

So any issue that come from executing something in a webplayer vs. standalone should only come from the Unity webplayer security sandbox.

Any issue from running straight network vs. a proxy environment CAN be API related or Unity related.

As COB sniffed out earlier with Wireshark, it seems that running WebClient via Unity doesnt seem to read the operating system proxy setting as it should. Described here: http://msdn.microsoft.com/en-us/library/fze2ytx2.aspx

jimbobway - I never heard back on my offer to help in the bugtracking process. I'll get a hold of Unity guys myself now and see if they can help us along here.

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 24 guests