-
Client Software Programmer
disconnected users now log out all the time! be it your laptops outa battery, you exit the window, or you click the logout button
-
Client Software Programmer
chat now appears over users heads
-
Client Software Programmer
Chat uses 10000()(()()x less bandwidth now, scrollbar for chat is also fixed, and chat is clear for users who just logged in and chat logs are stored in a closed environment
-
.
Hi Alooy,
I tried to look today but it would not load - 4 times.
Your hit counter tells not the truth, if you refresh as I did to see if the game would load again(which it did not), the counter went up.
I use a counter that only adds if you have a new ip address (not in the list of visited addresses), makes it slightly more real. I cam imagine that at least a third or more of the visits are bots and of course people refreshing or perhaps logging out.
I wouldnt mind a quick glance if all these updates you keep saying are true and working.
Last edited by fruitbeard; 05-04-2015 at 07:44 AM.
-
Client Software Programmer
Hi, I removed the actual game for a day, I have to remove this bug that exposes the way a certain part of the game works sorry about that, I dont advise playing the game yet, its just pre alpha testing stuff but yeah all the updates are true
-
Client Software Programmer
I will try out ip collection than, is it legal?
-
.
HI,
I'm not sure if it's legal or illegal, however ,all you are doing is creating a list of which ones have visited your site, not doing anything with them, most peoples ip change after a while automatically anyway.
Saying that, Google and other places store your ip for certain things, I think this place even uses your ip for something or another!!
How I do it is like so,
PHP Code:
<script language="JavaScript">
function countUnique()
{
count = '<?php
//error_reporting(0);
$ip = (getenv("HTTP_X_FORWARDED_FOR")) ? getenv("HTTP_X_FORWARDED_FOR") : getenv("REMOTE_ADDR");
$theFile ='ipvisits.txt';
$lines = file($theFile,FILE_IGNORE_NEW_LINES);
$count = count($lines);
if (in_array($ip,$lines))
{
echo $count;
}
else
{
$count++;
$addNew = fopen($theFile,"a+");
fwrite($addNew, "\n".$ip);
fclose($addNew);
echo $count;
}
?>'
return count;
}
</script>
and use vistText.text = ExternalInterface.call('countUnique'); in flash
then you need a txt file (ipvisits.txt in this example) in the same directory or wherever you like it but change the code accordingly
but you would also need to give your page a .php extension for this to work
-
Client Software Programmer
Hey nice, Ill try it out I've never tried ExternalInterface.call on flash
-
Client Software Programmer
Works great
-
.
Hi,
Excellent, I was just in the process of sending the sample files, but FK had an error so it didn't post.
I asume you also used
PHP Code:
import flash.external.ExternalInterface; if(ExternalInterface) { visitText.text = ExternalInterface.call('countUnique'); }
-
Client Software Programmer
nope, i didnt use your flash code, I just ended up using your php js + also making it w+ to another textfile the actual output number and from flash just loading up the textfile, im going to make a new hitcounter design now :P
-
Client Software Programmer
If you want to try this slightly different method that I tried its
flash code:
PHP Code:
loadFile = new LoadVars();
loadFile.onData = function(data){
hits.text = data;
}
loadFile.load("http://www.indocastles.com/play/hits.txt");
php+js code:
PHP Code:
<script language="JavaScript">
function countUnique()
{
count = '<?php
//error_reporting(0);
$ip = (getenv("HTTP_X_FORWARDED_FOR")) ? getenv("HTTP_X_FORWARDED_FOR") : getenv("REMOTE_ADDR");
$theFile ='ipvisits.txt';
$theFileNum = 'hits.txt';
$lines = file($theFile,FILE_IGNORE_NEW_LINES);
$count = count($lines);
if (in_array($ip,$lines))
{
echo $count;
}
else
{
$count++;
$addNew = fopen($theFile,"a+");
fwrite($addNew, "\n".$ip);
fclose($addNew);
$addNum = fopen($theFileNum,"w+");
fwrite($addNum, $count);
fclose($addNum);
echo $count;
}
?>'
return count;
}
</script>
thanks for contributing
-
.
Hi,
It's just the same exept you make it go through two files thats all and without using external interface.
You could also avoid using the javascript the way you are doing it by just calling the php file, it works for you anyway.
I'm not sure where you are calling the javascript from though
Glad I helped.
-
Client Software Programmer
It seems to be called upon page load without even having had the swf on it, anyways the counters up, the game will be up tonight
-
Client Software Programmer
ok i fixed le bug, you are welcome to test it out and make 2 accounts and try to talk to your self walk around: note the game is still in pre alpha and you cant attack anyone, you can just walk around with anyone online, and chat with em and shoot and them but not hurt them, 0 game play is released as of now,
-
Client Software Programmer
in version 0.2.9t patched a bug that would logout random players who were logged on for no reason, and game uses 6% less cpu usage overall than previous versions
-
Client Software Programmer
lol one of the unique ip visits was a web crawler xD @fruitbeard
-
.
Hi,
I had a look but didnt regsiter.
Out of the 12 visits you have had ( remember your own ip changes randomly too, or you can reset your router), one being me the other being a crawler, that makes around 10%, thats quite high especially when the visitor numbers get bigger.
I imagine you might get more robots and crawlers as and when you advertise your web address more.
-
Client Software Programmer
hmm idk, still doesn't seem reliable I have a feeling someone can just use a proxy and make abunch of hits too, but the hit counters just for looks I dont really care much about its other purposes
Last edited by AS3.0; 05-10-2015 at 11:45 PM.
-
.
Hi,
Theres nothing meant to be reliable about it Alloy, it merely stops people making an extra log count if they have already visited using their current ip.
Of course somebody can use a proxy, but it will add that proxy address to the list once and therefore only one hit given no matter how many times they visit or refresh.
I'm not so sure you understand what it is doing really and it certainly isn't any security system.
Hit counters are so nineties anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|