WARNING: The forum is now in read-only mode as we will soon be transitioning to different forum software. Feel free to join our Discord server in the meantime.
User avatar
Radwan_The_Black_Eagle
Posts:24
Joined:Mon Feb 11, 2013 5:15 pm
Battlefield 3 SQL

Thu Aug 01, 2013 4:44 pm

Hello.
Is there SQL file for battlefield 3? (BF3.sql) ? like Battlefield Bad Company 2 (BFBC2.sql).
Thanks.
The Cake Is A Lie

User avatar
Lapin
Posts:262
Joined:Mon Dec 24, 2012 12:35 pm
Location:There's no place like 127.0.0.1
Contact: Website

Re: Bettlefold 3 SQL

Thu Aug 01, 2013 6:02 pm

Why would you use a Database ?
Ding dong bannu

User avatar
Kerrigan
Posts:1614
Joined:Mon Dec 17, 2012 6:15 pm
Location:Your nightmares

Re: Bettlefold 3 SQL

Thu Aug 01, 2013 6:33 pm

Since there is no (public) emulator for BF3 yet, there is no use for a database...

Also i would prefer a NoSQL format.

User avatar
aXeSwY
Posts:405
Joined:Tue Dec 18, 2012 3:27 am
Location:•Milky Way→•Terra→•Africa→•Tunisia
Contact: Website

Re: Bettlefold 3 SQL

Fri Aug 02, 2013 3:00 am

This is a PHP Example to obtain userinfo for BF3 :

Code: Select all


<?php
$data=array('players'=>array(),'opt'=>array());

// List of players
$data['players'][]='zh1nt0';
$data['players'][]='DocDurchschnitt';

// List of options
$data['opt']['all']=true;

// Platform can be pc, 360, ps3
$platform='pc';

// Convert lists to JSON
$postdata=array();
$postdata['players']=json_encode($data['players']);
$postdata['opt']=json_encode($data['opt']);

// Run POST Request via CURL
$c=curl_init('http://api.bf3stats.com/'.$platform.'/playerlist/');
curl_setopt($c,CURLOPT_HEADER,false);
curl_setopt($c,CURLOPT_POST,true);
curl_setopt($c,CURLOPT_USERAGENT,'BF3StatsAPI/0.1');
curl_setopt($c,CURLOPT_HTTPHEADER,array('Expect:'));
curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
curl_setopt($c,CURLOPT_POSTFIELDS,$postdata);
$data=curl_exec($c);
$statuscode=curl_getinfo($c,CURLINFO_HTTP_CODE);
curl_close($c);

if($statuscode==200) {
   // Decode JSON Data
   $data=json_decode($data,true);
   
   // Print data for debugging
   echo '<pre>';
   print_r($data);
   
   
   // print list of players with rank and score
   foreach($data['list'] as $d) {
      $stats=$d['stats'];
      echo $d['name']." | ".$stats['rank']['name']." (".$stats['rank']['nr'].") Score: ".$stats['scores']['score']."\n";
   }
   echo '</pre>';
   // ... now you use $data to do whatever
   
} else {
   echo "BF3 Stats API error status: ".$statuscode;
   
}

?>


Image

Return to “Game Discussion”

Who is online

Users browsing this forum: No registered users and 22 guests