Jump to content
MakeWebGames

Tabbed Browsing


UCC

Recommended Posts

This is a long shot question, I wasnt going to post but since I logged in to reply to Scarlet, I thought I would post this too.

Does anyone know how to prevent users from playing a PHP game via tabbed Firefox browsing? The ability to refresh multiple tabs at the same time can create an unfair advantage. I dont think it is even possible to detect when users are doing this. Any ideas?

Link to comment
Share on other sites

Re: Tabbed Browsing

A great example of how to do this lies within the Legend Of The Green Dragon codes which can be downloaded via www.dragonprime.net (I think that's the url.) I've been meaning to dig into the codes and see what they do but I haven't had the time or desire to pick through it lately, but I intend to soon. You can't even refresh a page in LOGD if I remember correctly.

Link to comment
Share on other sites

Re: Tabbed Browsing

 

AJAX and XML works good for this, You cannot open a tab at all, It will just show the XML of the page.

Example is at: www.criminalfire.com

And here is how you exploit it:

var ajaxPost = function(page, data)
{
var ajax = new CustAjax();
try
{
	var loader = document.getElementById('content');
	loader.innerHTML = '<center>[img=images/loading3.gif]</center>';
}
catch(error) {}
ajax.doPost(page, handleContent, 'xml', data);
return false;
}
Link to comment
Share on other sites

  • 3 months later...

Re: Tabbed Browsing

Another idea for how they can exploit it is using the top tab functions and click extremely fast before the page even loads for them though. The best way to avoid that is to make almost every page refresh before they can get the coding. I know that I've seen that on a game before. What that does is basically when they use an item it revamps to inventory.php but they can still hit the stop button

Link to comment
Share on other sites

Re: Tabbed Browsing

Why not just put in something that store that time when the last page was loaded, and if the next page is loaded within say one second of the last, have the script die in the header?

 

if (!isset($_SESSION['time_of_last_page_load'])) {
   $_SESSION['time_of_last_page_load'] = time();
} else {

   if ($_SESSION['time_of_last_page_load'] == time()) {
       Echo "Pages cannot be loaded faster than one page per second."
       die;
   }
   $_SESSION['time_of_last_page_load'] = time();
}

 

It would be super easy to modify that to increase that to two seconds if you wanted.

Sure beats changing a bunch of stuff around in some complex way eh? :-)

Link to comment
Share on other sites

Re: Tabbed Browsing

Although I understand the desire to prevent tabbed browsing, speaking just from a players point of view, if I were playing a game that all of the sudden prevented me from doing that, I would be sorely disappointed.

I can think of numerous instances where I use multiple tabs, especially as staff.

Doing investigations into multies could be hampered. Perhaps at least excluding staff from any restrictions should be considered.

Link to comment
Share on other sites

Re: Tabbed Browsing

maybe this will work

if (!isset($_SESSION['time_of_last_page_load'])) {
   $_SESSION['time_of_last_page_load'] = time();
} else {
if (!isset($_SESSION['time_of_last_page_load'])) {
   $_SESSION['time_of_last_page_load'] = time() AND $user_level>1;
} else {

   if ($_SESSION['time_of_last_page_load'] == time()) {
       Echo "Pages cannot be loaded faster than one page per second."
       die;
}
   }
   $_SESSION['time_of_last_page_load'] = time();
}

just a thought. expanding the coding some :wink: I might have done it wrong but I believe something like that *should* work.

Link to comment
Share on other sites

Re: Tabbed Browsing

That'd be great for allowing staff to do their thing.

The only thing that remains is the compromise: is it worth hampering your players from playing in a way that is comfortable with them (realizing of course not everyone surfs this way, but some do) and at the same time reducing server load, or is accepting more server load, and making the game more comfortable to those that do surf that way (within reason) the way to go?

Personally, I put those kinds of restrictions only on the training page.

But someone that likes to surf the forums by opening multiple forum topics in tabs isn't really creating a strain on the server, right?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...