Jacksonville Developers User Group

Learn new things...write better code.
Welcome to Jacksonville Developers User Group Sign in | Join | Help
in
Home Blogs Forums

Need help with Web game front end

Last post 08-26-2008, 8:11 AM by Jonathan Bates. 3 replies.
Sort Posts: Previous Next
  •  08-23-2008, 8:43 PM 2343

    Need help with Web game front end

    Hope someone can help!

    I am developing a VB front end to a web-based game as an MDI application. One form (frmBrowser) contains a web browser object, and one form (frmCapture) sends "HTTP Requests", and displays "HTTP Response" strings.

    I use the web browser form to navigate to the web site, and to log in. Obviously, if I attempted to navigate to a secured page, I would be redirected to the login page. Once logged in, I can navigate to the secured pages, just as we would expect.

    However, even after I have logged into the web site using  browser form, and I can navigate around using the browser, any HTTP requests submitted from the capture page still get redirected to the login page. It is as if the server establishes a session with the browser object only. Other requests, even from the same program, are redirected to the login page.

    Following login, the appliation does create a new cookie. This cookie contains the text "e-mail", followed by some random text, and also the server name "alpha.astroempires.com", followed by some more random text. Deleting this cookie seems to have no effect on the function of the web application, and does not cause the user to have to login again.

    I usually use FireFox to access this web site. I can open links in new tabs, and I don't have to login again. So, I guess there should be a way to manipulate multiple connections to the web site, as if they were multiple tabs in FireFox.

    More details available if needed.
  •  08-24-2008, 11:52 AM 2344 in reply to 2343

    Re: Need help with Web game front end

    it is an issue of session.  This is why Firefox works with you log into the site and then open additional tabs. the browser app is maintaining session.  I would be surprised in IE7 didn't exhibit the same behaviour.

    When you are creating those seperate browser instances within your application, each one is getting its own session, not sharing them.  In this case, its requests from browsers that are important.  when you say "Other requests, even from the same program, are redirected to the login page.", none of those requests are truly coming from that application, they are coming from the browser instances that the application contains.

    Have you considered not using the browser control, but instead implementing some type of web service interaction or more pure http request/response type of interaction?  I realize this may not be an option if the server you are interacting with requires some type of browser cookie.


    The Universe has no center and I am it.



    The superior man is modest in his speech, but exceeds in his actions.

  •  08-24-2008, 1:42 PM 2345 in reply to 2344

    Re: Need help with Web game front end

    Johnithan, thanx for your reply.

    Yes, I get it. The server is basically establishing a session with the browser object, not the actual process of the VB application. Basically, the server establishes a communication channel with the browser object.

    This web application requires cookies and java be enabled. Additionally, my concept is to have a browser window so that the user can interact with the game, but also have my program send other HTTP requests and process HTTP responses. For that part of the program, I am using HTTP request/response.

    Is there any way to either get access to the browser object's session with the server? Or to create a separate "Connection Session Object" that I could use kind of like a data source, for both the browser object, and for the other HTTP request/responses"?

       Don!
  •  08-26-2008, 8:11 AM 2347 in reply to 2345

    Re: Need help with Web game front end

    My first instinct would be to use the IE7 instance of the web browser object.  It supports tabs (so you could get a FireFox behviour like you described).

    I honestly don't know if the session and cookie cache can be accessed or injected via the broser API, but its likely worth at least investigating.

    I am afraid I can't readily think of anything easy or elegant based on the constraints you are describing.  The hack that comes to mind is building your own iframe page to host the page that you have to, and then use javascript to do your additional manipulations.


    The Universe has no center and I am it.



    The superior man is modest in his speech, but exceeds in his actions.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems