Button Webplayer problem

Hi,

i have a problem with GUI Buttons in the webplayer. In my login screen i have a login button. That button works perfectly fine the first time. But after closing and restarting the browser, the button doesn’t work anymore. I can click on it, but it won’t react.

When i use another browser or restart my machine it seems to work again. In a standalone version the application just works fine.

I have searched through the forums but i didn’t find any quick answers for that.

So does any body know what the problem and solution might be? Any help would be appreciated.

thanks

Mike

Sorry but I don’t know of a solution as I’m not sure why it’s even happening as you can definitely create buttons that are clickable no matter how many times you quit/restart the browser. Can you share your code and/or post an example that demonstrates this? Also, does this occur on Mac or Windows or both? What browsers produce this behavior? What version of the web player are you using (and what version of authoring are you using)?

Sorry to only have questions but I’m just not sure what’s causing this so I go into Q&A mode. :slight_smile:

Thanks for your answer HiggyB.

I am developing and testing our game on a mac. The problems occur right now in firefox and on safari as well. I have unity 2.5.1 Pro. So the webplayer version should also be 2.5.1.

Here is a link to a preliminary older alpha version of our game running live on our test server using unity/darkstar. So you can test it out. In this older version there is no authentication, so the user name / password doesn’t matter.

http://www.3dtacticsonline.com/JapaneseTacticsOnline.html

When i log in and out, quit the browser, restart, it happens that after a while it happens that i cannot login anymore. The button won’t react. And it only happens in the webplayer , but not in a standalone version. I am just not sure where the problem might be. If you need the project file, i can also upload them to the support or so, if it is needed.

thanks for you help
Cheers
Mike

sounds like some kind of caching if it works with other browsers and standalone.
do you have cache clean / temp file cleaning applications installed hat clean your privacy related folders on shut down? That would support the assumption of caching.

Browsers work significantly different in various aspects so its possible that this is impacting this actually.

A question on the button: Does it have any condition that has to be met for it to be active? If so would you mind sharing the related code and potentially a description what is setting those “check states”.

With the other browsers (safari and firefox) i had the same problems. At the beginning it worked and after a while (restarting browser and so on) it didn’t react anymore. Only the standalone version works without problems and of course inside Unity. And i don’t have any applications for cleaning up installed.

This is the code. A simple GUI.Button call

usernameText = GUI.TextField(usernameFieldRect,usernameText);
	            
	        GUI.Label(passwordLabelRect,passwordLabelText);
	            
	        passwordText = GUI.PasswordField(passwordFieldRect,passwordText,'*');
	            
	        if(GUI.Button(loginButtonRect,"Login"))
			{
	              LoginOnClick(usernameText,passwordText);
	        }

This is part of a Draw method of a class inside of a Dll. I mainly use monodevelop to compile code into dlls which land in the Assets/Plugin folder and wrapper scripts instantiate those classes and call those methods. May that be problematic with the webplayer with having dlls in the project?

May I guess: loginOnClick uses networking behind the scene?
If so then this might be the reason because if you don’t shut the networking fully down yourself again before the player is closed, it will not be closed and the socket potentially locked, making any further connection attempt failing

the standalone build is commonly less to not affected by such networking related things as it does not run “under the masterhood of something less smart as a browser”.

If you are using sockets directly, you can potentially use the force flag to enforce the usage of a specific port even if it is already in use.

Good point. And my gut was saying “the GUI code is working fine if you see the button press action on reload, it may just be the code trying to be called that’s not working”, and dreamora just hit on a possible cause of that.

See if you can do something else in that code, make a GUI.Box() visible or something like that, just to definitively see if the code is being called. If so then you know to track down the problem in loginOnClick. If not then, well, I dunno… :stuck_out_tongue:

Thank you guys.

Yeah, there is network code behind that login button.

It is kinda embarrassing to not have thought of that earlier with all the testing and debugging i did. But because i mostly tested it in unity and with a standalone version that i didn’t quite think of restrictions in the browser environment. And it is good to know about those restrictions now.

I will look at the networking code tomorrow and test things out. So thanks for the hints and getting me to look in the right direction now.

thanks
Mike

Don’t even think of it like that. We all get a little to close to things at times and often that fresh outside view can spot the obvious, that’s why we’re all here. :slight_smile:

Give that a look and post up if you still have problems. Rock on!