ITalianBadBoy

tool
Web Player's Statistic Calculator

43 posts in this topic

3 hours ago, MightyHoot said:

yyy you don't have that data :D 

The line graph at the top center was calculated with the "Average In A Battle" multiplied per battles.

The line graph at the bottom left  and bottom right were calculated with the frequencies of "Average Time For" multiplied per hours.

Spoiler

What's the average kill in one hour?

TimeFor1Kill  = TotalBattleTime / TotalKill

 

XKill : TimeForXKill = 1Kill : TimeFor1Kill                  number : time = number : time

X : 1Hour = 1 : TimeFor1Kill                                     number : time = number : time

X = 1 / TimeFor1Kill * 1Hour                                     number = number / time * time

X = 1 * 1Hour / TimeFor1Kill                                     number = number * time / time

KillIn1Hour = 1Hour / TimeFor1Kill                            number = time / time

 


 myObj.data.pvp.HK = (3600000 / myObj.data.pvp.KillTime).toFixed(2);

 

 

0

Share this post


Link to post
Share on other sites

Added the "Average Probability For" and the relative chart.

In the chart you'll find the probability of kill, die and assist 0/5, 1/5, 2/5, 3/5 , 4/5 and 5/5.

EMkMrE2.jpg

The graph's values are calculated using a binomial distribution.

 

Spoiler

IanGUML.png


function DoBi(n, x, p) {
return binomial(n, x) * Math.pow(p, x) * Math.pow(1 - p, n - x);
}
function binomial(n, k) {
  var x, coeff = 1;
  for (x = n-k+1; x <= n; x++) coeff *= x;
  for (x = 1; x <= k; x++) coeff /= x;
  return coeff;
}

 

 

0

Share this post


Link to post
Share on other sites

ZcmoZPZ.jpg

Added 95 custom images of the corp. :D

The Img are uploaded in a Imgur Album available to anyone. The ID is i8Q2q

If there's any problems with your custom logo write it here, i'll fix it as soon as possible.

Improvements of code and layout afterwards.

Spoiler

function GetImg() {
  TextArea = document.getElementById("TextArea");
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = function() {
    if (this.readyState == 4) {
      TextArea.value +="\n- Img Corp loaded and ready.";
      TextArea.scrollTop = TextArea.scrollHeight;
      ImgCorp = JSON.parse(this.responseText);
      console.log(ImgCorp);
    }  
  };
  xmlhttp.open("GET", "https://api.imgur.com/3/album/i8Q2q/images", true);
  xmlhttp.setRequestHeader("Authorization","Client-ID xxxx");
  xmlhttp.setRequestHeader("Accept","application/json");
  xmlhttp.send();
  return;
}

 

 

2

Share this post


Link to post
Share on other sites

Implemented the locally store of the image's index for 1 day.

For to improve the loading of the corporations images and decrease the requests to the Imgur server.

Spoiler

function LoadIDImgCorp() {  
  var ImgTime, TimeNow = new Date().getTime(), Day = 24 * 60 * 60 * 1000;
  if (typeof(Storage) !== "undefined") if (localStorage.IDImgCorp && localStorage.IDImgTime) {
    ImgTime = Number(localStorage.getItem('IDImgTime'));
    if (ImgTime + Day > TimeNow) {
      ImgCorp = JSON.parse(localStorage.getItem('IDImgCorp'));
      TextArea.value +="\n- IDImgCorp loaded from memory.";
      return;
    }
    TextArea.value +="\n- IDImgCorp not loaded, older than a day.";
  }
  TextArea.value +="\n- IDImgCorp not found in memory.";
  GetImg();
  return;
}
function GetImg() {
  var TimeNow, xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      ImgCorp = JSON.parse(this.responseText);
      TextArea.value +="\n- Img Corp loaded and ready.";
      if (Tag) PrintImgCorp();
      if (typeof(Storage) !== 'undefined') {
        TimeNow = new Date().getTime();
        localStorage.setItem('IDImgTime', TimeNow);
        localStorage.setItem('IDImgCorp', this.responseText);
        TextArea.value +="\n- Img Corp uploaded in local storage.";
      }
      TextArea.scrollTop = TextArea.scrollHeight;
      console.log(ImgCorp);
    }  
  };
  xmlhttp.open("GET", "https://api.imgur.com/3/album/i8Q2q/images", true);
  xmlhttp.setRequestHeader("Authorization","Client-ID xxx");
  xmlhttp.setRequestHeader("Accept","application/json");
  xmlhttp.send();
  return;
}

 

 

0

Share this post


Link to post
Share on other sites

Why did you added a captcha, they are just stupidly annoing since it takes like 1min to solve them since the solution is never what it should be.

0

Share this post


Link to post
Share on other sites
46 minutes ago, ITalianBadBoy said:

The reCAPTCHA protect the site against spam and other types of automated abuse.

I can try to add a new version: "Invisible reCAPTCHA"  does not require the user to click on a checkbox.

I don*t have a problem with clicking a box, I have only the problem that the box always says I'm a robot and I have to solve a puzzle.

And do you really think that anyone would spam this site by making autonatic player stats requests?

0

Share this post


Link to post
Share on other sites
12 hours ago, John161 said:

And do you really think that anyone would spam this site by making autonatic player stats requests?

I don't think that there is anyone with this interest. And even if it happens, a request every 10 seconds, would not be a problem.

I must to implement in the client a system that prevents at a botnet to make a Distributed Denial of Service (DDoS) at the Star Conflict API.

 

12 hours ago, John161 said:

I don*t have a problem with clicking a box, I have only the problem that the box always says I'm a robot and I have to solve a puzzle.

However, several players have informed me that they have the same discomfort in solving this puzzle.

We are working on a system that demands solving the reCAPTCHA after 10 inputs or that requires only once at the beginning.

 

0

Share this post


Link to post
Share on other sites

Tool will be unavailable for a few hours.

The reason is because we are changing the content management system (CMS) ...

Enabled the FTP, database with phpmyadmin, the protections of CloudFlare and

a personal site API for verifying the user's response of the reCAPTCHA .

0

Share this post


Link to post
Share on other sites

Performed a modification to the upper part of the layout, added a checkbox for to display the advanced information:

gnTDkWf.jpg

Several improvements to the code, in particular a filter was added at the nickname for to remove special characters:

(In order to prevent illegitimate requests: Cross-site Scripting attacks)

NickName = document.getElementById('NickName').value.replace(/[^\w\s]/gi, '');

Then write "ItalianBadBoy" or "@It*a%lian(Bad)Boy!" is the same.

0

Share this post


Link to post
Share on other sites

Implemented CryptoJS and improved the storage of the images index:

  • The data are saved to gether the checksum for to verify its integrity. (SHA3)
  • Before of saving the data are encrypted with a public key. (AES)

So the ID and URL of the corporations images will be kept in local memory for a week, when it's possible.

Spoiler

/*
<script src='http://it4ly.altervista.org/CryptoJS/core.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/x64-core.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/sha3.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/evpkdf.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/cipher-core.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/aes.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/enc-base64.js'></script>
<script src='http://it4ly.altervista.org/CryptoJS/ObjFormatter.js'></script>
*/

function LoadIDImg() {
  var Now = {Time: new Date().getTime()}, Days = 7 * 24 * 60 * 60 * 1000,
      key = CryptoJS.enc.Base64.parse('xxxxx'), // 256 bit
      iv = CryptoJS.enc.Base64.parse('xxxxx');  // 256 bit
  AdvText.value +='\n- Tool: ';
  try {
    if(typeof(Storage) === 'undefined') throw "Can't access to the memory.";
    if(typeof(localStorage.IDImgCorp) === 'undefined') throw 'IDImgCorp not found in memory.';
    var IDImgCorp = JSON.parse(localStorage.getItem('IDImgCorp'));
    if (IDImgCorp.Time + Days < Now.Time) throw 'IDImgCorp not loaded, older than a week.';
    Now.Data = CryptoJS.AES.decrypt(ObjFormatter.toCipher(IDImgCorp.Data), key, {iv : iv});
    Now.Data = Now.Data.toString(CryptoJS.enc.Utf8);
    Now.Checksum = CryptoJS.SHA3(Now.Data).toString();
    if (IDImgCorp.Checksum !== Now.Checksum) throw 'IDImgCorp not loaded, damaged.';
  } catch(err) {
    AdvText.value += err;
    return(false);
  }
  ImgCorp = JSON.parse(Now.Data);
  AdvText.value +='IDImgCorp loaded from memory.';
  return(true);
}

function UpLoadIDImg(JSONData) {
  var key = CryptoJS.enc.Base64.parse('xxxxx'), // 256 bit
      iv = CryptoJS.enc.Base64.parse('xxxxx');  // 256 bit
  AdvText.value +='\n- Tool: ';
  try {
    if (typeof(Storage) === 'undefined') throw "Can't access to the memory.";
    var IDImgCorp = {
          Time: new Date().getTime(),
          Checksum: CryptoJS.SHA3(JSONData).toString(), 
          Data: ObjFormatter.toObj(CryptoJS.AES.encrypt(JSONData, key, {iv: iv}))
        };
    localStorage.setItem('IDImgCorp', JSON.stringify(IDImgCorp)); 
  } catch(err) {
    AdvText.value += err;
    return;
  }
  AdvText.value +='IDImgCorp uploaded in memory.';
  return;
}

pKJapAF.jpg

 

0

Share this post


Link to post
Share on other sites

 Made several improvements:

  • Changed the layout with a two-column  for adaptation to the next update...
  • The corporation logo has been slightly enlarged.
  • Enlarge the graphics and add their titles.
  • The graphics have been brought closer to the source data.
  • Improved data loading for charts.
  • The calculation weight of the binomial distribution has been reduced by 2/3.
  • Enabled HTTPS protocol for secure access to CMS.
0

Share this post


Link to post
Share on other sites

To increase the speed and lighten the page loading we remove the link that led to the iFrame in the Italian forum.

  • Now the link goes directly to the tool.
  • Added an anti-brute force plugin.
  • Fixed some HTML writing errors.
0

Share this post


Link to post
Share on other sites

As you like graphs... you should add something like this :D

qCeiZJI.png

1

Share this post


Link to post
Share on other sites

It's really a good suggestion, i really like this radar chart! (Note taking)

I would use only the charts provided by google and I don't see it in the Gallery.

But maybe I can do it with the Area Chart and some trigonometry equation... I'll read  and try some things ;)

 

0

Share this post


Link to post
Share on other sites
3 minutes ago, ITalianBadBoy said:

It's really a good suggestion, i really like this radar chart! (Note taking)

I would use only the charts provided by google and I don't see it in the Gallery.

But maybe I can do it with the Area Chart and some trigonometry equation... I'll read  and try some things ;)

 

I have no idea how those internet stuff are working but I'd love to get more pilot names coz 2k is not enough to make proper rating :D 

 

 

0

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.