├── LICENSE
├── README.md
├── dump
└── universe_dump.php
├── images
├── map_classic.png
├── map_classic_no_sec.png
├── map_classic_options.png
├── map_in_game.png
├── map_jita.png
├── map_jita_radial.png
├── map_on_ipad.png
├── map_on_s4.png
├── map_overview.png
├── tracker_in_map.png
└── tracker_option.png
├── sql
└── eve_live_intel.sql
└── website
├── .htaccess
├── .ovhconfig
├── d3.js
├── d3.min.js
├── data
├── factions.json
└── region_KS.json
├── include
├── common.php
├── config.php
├── db_handler.php
├── eve_header.php
└── security.php
├── index.php
├── intelMap.js
├── intel_map.min.js
├── login.php
├── logout.php
├── mapData.js
├── mapData.min.js
└── services
├── intel.php
└── send_intel.php
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014, Roy Jeremie. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without modification,
4 | are permitted provided that the following conditions are met:
5 |
6 | 1. Redistributions of source code must retain the above copyright notice, this
7 | list of conditions and the following disclaimer.
8 |
9 | 2. Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR
14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
16 | SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
21 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
22 | OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
24 | https://github.com/jeremieroy/EVELiveIntel
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EVELiveIntel - Live Intel Map for EVE Online
2 |
3 | ## What is it ?
4 | An online map that centralize and visualize Intel knowledge (hostile players positions) in the game EVE Online.
5 |
6 | This knowledge consist of a status for every system:
7 | Blue: no enemies - Red: enemies - Gray: no info or outdated info
8 |
9 | * The map is dynamic, so whenever someone update the Intel status of a system every other connected players will see it within 5 seconds.
10 | * The map is fancy and support drag and zoom (mousewheel) and various systems layouts for increased readability.
11 | * The map works in the IGB and can be synchronized with an external browser (Tested with Chrome, Firefox, Safari and IE) including Android and IOS browsers (phone and tablets).
12 | * The map is not organized by region but centered around your actual position and the neighboring systems, if you jump in another system, the map will detect it and adapt accordingly. So the map cover the whole known EVE universe, except I'm afraid the wormholes.
13 | Supporting WH is definitely doable but would require this tool to became a mapping tool as well and thus may clutter the UI.
14 |
15 | ## Overview
16 |
17 | 
18 |
19 | "Dude, that security status is confusing and I can't see the intel well !"
20 | Sure, disable it.
21 | Open the options and uncheck "Show security status":
22 | 
23 |
24 | Is that what you wanted ?
25 | 
26 |
27 | "Ok, but what about a highly connected system... like Jita ?"
28 | 
29 |
30 | "This is a mess, I cannot see what is close to me or what is far !"
31 | That is what the radial layout is for.
32 | Open the options and select the "Radial" map layout.
33 | It will reorganize that mess so that every system that is at X jumps of you (using shortest path) is visually at X jumps, and optimize the system position so that they don't overlap too much.
34 | 
35 |
36 | "Mmh, that is cool, but dude, I want to play, I cannot waste half of my screen with that map all the time.
37 | Also I need to have a very quick understanding of the situation so that I can react quickly."
38 | I hear you my friend, our pixels are precious, that is what the Tactical layout is for.
39 | In this mode, all the systems are spread out evenly along the "jumps circles".
40 | Let's zoom out, disable the system names, links and security status. (And the browser bars)
41 | And let me show you how it look in game:
42 | 
43 |
44 | ## Browser synchronization:
45 | You can synchronize your in game browser with an out of game browser (e.g. on a tablet) using an identification token, these token are random and unique for each game session.
46 | 
47 | How to:
48 | * log on the map with the IGB
49 | * retrieve your identification token on the option panel
50 | * log on the map with another browser and refer the token at login
51 |
52 | Here is the map on an Ipad 2:
53 | 
54 | Here is the map on a Samsung Galaxy S4:
55 | 
56 |
57 | ## Follow friends
58 | You can also follow friendly players if they give you their identification token:
59 | Just add their token as Tracker 1,2 or 3 in the option panel.
60 | 
61 |
62 | ## Quick guide:
63 | 1. go to the map website (see with your Corporation)
64 | 2. enter the password (see with your Corporation)
65 | 3. trust the website
66 | 4. Look at the map, play with the options and find the layout you like.
67 | 4b. (optional) make a bookmark or set the map as homepage
68 | 5. Look at locals if you enemies (war target), report them by clicking the "Hostile" button.
69 | If you don't, report it by clicking the "Clear" button.
70 | If you stay in the system remember to refresh that information. The timer counter and the gauge in the buttons will help you remember it.
71 | 6. There is no 6.
72 | 7. If you see a red dot on the map, react immediately. The radial and tactical layout will help you assess whether the target is far or close form you.
73 | Dock, flee, join a fleet. At your judgment.
74 | 8. Fly safe.
75 |
76 |
77 | ## Installation:
78 | 1. generate the minimalist database using the sql file.
79 | 2. edit "intelMap.js" first line to update your website URL (for the trust popup).
80 | 3. edit "security.php" to setup a suitable password
81 | 4. copy the content of the website folder on your webserver
82 | 5. share the map url to your corporation members (and give them the password)
83 |
84 | ## About security:
85 | The security model of the map is purposely simple and stupid. That way big corporations that have their own security model can easily replace this minimalist system by their own.
86 |
87 | ## 3rd Party Libraries
88 | * D3.js Data-Driven Documents
89 | http://d3js.org/
90 | Library released under BSD license. Copyright 2013 Mike Bostock.
91 |
92 | ## Tech stuff:
93 | * I used php as the server tech because it works on every (cheap) web hosting solution.
94 | * I use polling on database for the same reason, a live table in memory would be better but this require a more expensive web hosting solution.
95 |
96 |
97 | ## Thanks:
98 | * Eve University for they are awesome.
99 | * D3.js for the same reason.
100 |
101 | [License (BSD 2-clause)](https://github.com/jeremieroy/EVELiveIntel/LICENSE)
102 | -------------------------------------------------------------------------------
103 | Copyright (c) 2014, Roy Jeremie. All rights reserved.
104 |
105 | Redistribution and use in source and binary forms, with or without modification,
106 | are permitted provided that the following conditions are met:
107 |
108 | 1. Redistributions of source code must retain the above copyright notice, this
109 | list of conditions and the following disclaimer.
110 |
111 | 2. Redistributions in binary form must reproduce the above copyright notice,
112 | this list of conditions and the following disclaimer in the documentation
113 | and/or other materials provided with the distribution.
114 |
115 | THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR
116 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
117 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
118 | SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
119 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
120 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
121 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
122 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
123 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
124 | OF THE POSSIBILITY OF SUCH DAMAGE.
125 |
--------------------------------------------------------------------------------
/dump/universe_dump.php:
--------------------------------------------------------------------------------
1 | $maxX) $maxX = $p["x"];
20 | if($p["y"] < $minY) $minY = $p["y"];
21 | if($p["y"] > $maxY) $maxY = $p["y"];
22 | }
23 |
24 | /*
25 | $w = $maxX - $minX;
26 | $h = $maxY - $minY;
27 | $scale_size = 1.0 / max($w,$h);
28 |
29 | //normalize and invert axes
30 | foreach ($array as &$p) {
31 | $p["x"] = ($p["x"] - $minX)*$scale_size;
32 | $p["y"] = ($h - $p["y"] + $minY)*$scale_size;
33 | }
34 | $w*=$scale_size;
35 | $h*=$scale_size;
36 | */
37 |
38 | return array( "min_x"=>$minX,
39 | "max_x"=>$maxX,
40 | "min_y"=>$minY,
41 | "max_y"=>$maxY);
42 | }
43 |
44 | function dump($filename, $res)
45 | {
46 | file_put_contents( $filename,json_encode($res) );
47 | echo "dumped: $filename
";
48 | }
49 |
50 | $faction_map = array();
51 | $regions_map = array();
52 | $system_map = array();
53 |
54 | function init_maps($db)
55 | {
56 | global $faction_map, $regions_map, $system_map;
57 |
58 | $sql = "SELECT factionID AS id FROM chrfactions WHERE 1 ORDER BY factionID";
59 | $result = mysqli_query($db, $sql);
60 |
61 | $count = 0;
62 | while($item = mysqli_fetch_assoc( $result )) {
63 | $id = intval($item['id']);
64 | $faction_map[$id] = $count;
65 | $count++;
66 | }
67 | echo "factions count= $count
";
68 | //*********************************************
69 | $sql = "SELECT regionID AS id FROM mapRegions WHERE 1 ORDER BY regionID";
70 | $result = mysqli_query($db, $sql);
71 |
72 | $count = 0;
73 | while($item = mysqli_fetch_assoc( $result )) {
74 | $id = intval($item['id']);
75 | $regions_map[$id] = $count;
76 | $count++;
77 | }
78 | echo "regions count= $count
";
79 | //*********************************************
80 | $sql = "SELECT solarSystemID AS id FROM mapSolarSystems WHERE 1 ORDER BY solarSystemID";
81 | $result = mysqli_query($db, $sql);
82 |
83 | $count = 0;
84 | $d = array();
85 | while($item = mysqli_fetch_assoc( $result )) {
86 | $id = intval($item['id']);
87 | $system_map[$id] = $count;
88 | $count++;
89 | array_push($d, $id);
90 | }
91 | echo "systems count= $count
";
92 | }
93 |
94 | $faction_offset = 500001;
95 | $regions_KS_offset = 10000001;
96 | $regions_WS_offset = 11000001;
97 | $system_KS_offset = 30000001;
98 |
99 | function get_factions($db)
100 | {
101 | global $faction_offset;
102 | $sql = "SELECT factionID AS id,
103 | factionName AS name,
104 | description AS description
105 | FROM chrfactions
106 | WHERE 1 ORDER BY factionID ";
107 |
108 | $result = mysqli_query($db, $sql);
109 | $factions_array = array();
110 | while($faction = mysqli_fetch_assoc( $result )) {
111 | $faction['id'] = intval($faction['id'] -$faction_offset );
112 | array_push($factions_array, $faction);
113 | }
114 |
115 | $out = array();
116 | $out["faction_offset"] = $faction_offset;
117 | $out["factions"] = $factions_array;
118 | return $out;
119 | }
120 |
121 | function get_KS_regions($db)
122 | {
123 | global $faction_offset, $regions_KS_offset, $regions_WS_offset,$system_KS_offset;
124 | $sql = "SELECT regionID AS id,
125 | regionName AS name,
126 | factionID AS factionID,
127 | ROUND(x) / 10000000000000000 AS x,
128 | ROUND(z) / 10000000000000000 AS y
129 | FROM mapRegions
130 | WHERE regionID < $regions_WS_offset";
131 |
132 | $result = mysqli_query($db, $sql);
133 | $regions_array= array();
134 | while($region = mysqli_fetch_assoc( $result )) {
135 | $region_out = array();
136 | $region_out['id'] = intval($region['id'] - $regions_KS_offset);
137 | $region_out['name'] = $region['name'];
138 | $region_out['x'] = floatval($region['x']);
139 | $region_out['y'] = floatval($region['y']);
140 | if($region['factionID']!=NULL)
141 | {
142 | $region_out['factionID'] = intval($region['factionID'] - $faction_offset);
143 | }else
144 | {
145 | $region_out['factionID'] = -1;
146 | }
147 | $region_out['systems'] = get_system($db, $region, $system_KS_offset );
148 | array_push($regions_array, $region_out);
149 | }
150 |
151 | $out = array();
152 | $out["region_offset"] = $regions_KS_offset;
153 | $out["system_offset"] = $system_KS_offset;
154 | $out["faction_offset"] = $faction_offset;
155 | $out["regions"] = $regions_array;
156 | return $out;
157 | }
158 |
159 | function getSystemsLinks($db, $system_id, $system_offset) {
160 | $sql = "SELECT toSolarSystemID AS id FROM mapSolarSystemJumps WHERE fromSolarSystemID = $system_id";
161 | $result = mysqli_query($db, $sql);
162 | $jumps = array();
163 | while($system = mysqli_fetch_assoc( $result )) {
164 | array_push($jumps, intval( $system['id'] - $system_offset));
165 | }
166 | return $jumps;
167 | }
168 |
169 | function get_system($db, $region, $system_offset)
170 | {
171 | global $faction_offset;
172 |
173 | $sql = "SELECT solarSystemID AS id,
174 | solarSystemName AS name,
175 | factionID AS factionID,
176 | security AS security,
177 | ROUND(x) / 10000000000000000 AS x,
178 | ROUND(z) / 10000000000000000 AS y
179 | FROM mapSolarSystems
180 | WHERE regionID=".$region['id'];
181 |
182 | $result = mysqli_query($db, $sql);
183 |
184 | $system_array= array();
185 | while($system = mysqli_fetch_assoc( $result )) {
186 | $system_out = array();
187 |
188 | $system_out['id'] = intval( $system['id'] - $system_offset);
189 | $system_out['name'] = $system['name'];
190 | $system_out['x'] = floatval($system['x']);
191 | $system_out['y'] = floatval($system['y']);
192 | $system_out['sec']= floatval($system['security']);
193 |
194 | if($system['factionID'] != $region['factionID'])
195 | {
196 | if($system['factionID']!=NULL)
197 | {
198 | $system_out["factionID"] = intval($system['factionID'] - $faction_offset);
199 | }else{
200 | $system_out["factionID"] = -1;
201 | }
202 | }
203 | $system_out['links'] = getSystemsLinks($db, $system['id'], $system_offset );
204 |
205 |
206 | array_push($system_array, $system_out);
207 | }
208 | return $system_array;
209 | }
210 |
211 | ?>
212 |
213 |
214 |
215 |
216 |
217 |
219 |
220 |
237 |
238 |
239 |
--------------------------------------------------------------------------------
/images/map_classic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_classic.png
--------------------------------------------------------------------------------
/images/map_classic_no_sec.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_classic_no_sec.png
--------------------------------------------------------------------------------
/images/map_classic_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_classic_options.png
--------------------------------------------------------------------------------
/images/map_in_game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_in_game.png
--------------------------------------------------------------------------------
/images/map_jita.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_jita.png
--------------------------------------------------------------------------------
/images/map_jita_radial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_jita_radial.png
--------------------------------------------------------------------------------
/images/map_on_ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_on_ipad.png
--------------------------------------------------------------------------------
/images/map_on_s4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_on_s4.png
--------------------------------------------------------------------------------
/images/map_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/map_overview.png
--------------------------------------------------------------------------------
/images/tracker_in_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/tracker_in_map.png
--------------------------------------------------------------------------------
/images/tracker_option.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremieroy/EVELiveIntel/381e3c5bd98e8ffa1dac03212c25f0f18622f633/images/tracker_option.png
--------------------------------------------------------------------------------
/sql/eve_live_intel.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 4.1.14
3 | -- http://www.phpmyadmin.net
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: Sep 22, 2014 at 06:03 PM
7 | -- Server version: 5.6.17
8 | -- PHP Version: 5.5.12
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | SET time_zone = "+00:00";
12 |
13 |
14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17 | /*!40101 SET NAMES utf8 */;
18 |
19 | --
20 | -- Database: `eve_live_intel`
21 | --
22 |
23 | -- --------------------------------------------------------
24 |
25 | --
26 | -- Table structure for table `intel`
27 | --
28 |
29 | CREATE TABLE IF NOT EXISTS `intel` (
30 | `system_id` int(11) NOT NULL,
31 | `seen_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
32 | `status` int(11) NOT NULL,
33 | `updated_by` varchar(16) NOT NULL,
34 | KEY `system_id` (`system_id`),
35 | KEY `seen_at` (`seen_at`)
36 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
37 |
38 | -- --------------------------------------------------------
39 |
40 | --
41 | -- Table structure for table `tmp_users`
42 | --
43 |
44 | CREATE TABLE IF NOT EXISTS `tmp_users` (
45 | `unique_id` varchar(16) NOT NULL,
46 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
47 | `system_id` int(11) NOT NULL,
48 | UNIQUE KEY `unique_id` (`unique_id`)
49 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
50 |
51 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
52 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
53 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
54 |
--------------------------------------------------------------------------------
/website/.htaccess:
--------------------------------------------------------------------------------
1 | Options -Indexes
2 | SetEnv PHP_VER 5_4
3 | SetEnvIfNoCase EVE_TRUSTED "(.*)" HTTP_EVE_TRUSTED=$1
4 | SetEnvIfNoCase EVE_SERVERIP "(.*)" HTTP_EVE_SERVERIP=$1
5 | SetEnvIfNoCase EVE_CHARNAME "(.*)" HTTP_EVE_CHARNAME=$1
6 | SetEnvIfNoCase EVE_CHARID "(.*)" HTTP_EVE_CHARID=$1
7 | SetEnvIfNoCase EVE_CORPNAME "(.*)" HTTP_EVE_CORPNAME=$1
8 | SetEnvIfNoCase EVE_CORPID "(.*)" HTTP_EVE_CORPID=$1
9 | SetEnvIfNoCase EVE_ALLIANCENAME "(.*)" HTTP_EVE_ALLIANCENAME=$1
10 | SetEnvIfNoCase EVE_ALLIANCEID "(.*)" HTTP_EVE_ALLIANCEID=$1
11 | SetEnvIfNoCase EVE_REGIONNAME "(.*)" HTTP_EVE_REGIONNAME=$1
12 | SetEnvIfNoCase EVE_CONSTELLATIONNAME "(.*)" HTTP_EVE_CONSTELLATIONNAME=$1
13 | SetEnvIfNoCase EVE_SOLARSYSTEMNAME "(.*)" HTTP_EVE_SOLARSYSTEMNAME=$1
14 | SetEnvIfNoCase EVE_STATIONNAME "(.*)" HTTP_EVE_STATIONNAME=$1
15 | SetEnvIfNoCase EVE_STATIONID "(.*)" HTTP_EVE_STATIONID=$1
16 | SetEnvIfNoCase EVE_CORPROLE "(.*)" HTTP_EVE_CORPROLE=$1
17 | SetEnvIfNoCase EVE_SOLARSYSTEMID "(.*)" HTTP_EVE_SOLARSYSTEMID=$1
18 | SetEnvIfNoCase EVE_WARFACTIONID "(.*)" HTTP_EVE_WARFACTIONID=$1
19 | SetEnvIfNoCase EVE_SHIPID "(.*)" HTTP_EVE_SHIPID=$1
20 | SetEnvIfNoCase EVE_SHIPNAME "(.*)" HTTP_EVE_SHIPNAME=$1
21 | SetEnvIfNoCase EVE_SHIPTYPEID "(.*)" HTTP_EVE_SHIPTYPEID=$1
22 | SetEnvIfNoCase EVE_SHIPTYPENAME "(.*)" HTTP_EVE_SHIPTYPENAME=$1
--------------------------------------------------------------------------------
/website/.ovhconfig:
--------------------------------------------------------------------------------
1 | app.engine=php
2 | app.engine.version=5.5
3 | http.firewall=none
4 | environment=production
--------------------------------------------------------------------------------
/website/data/factions.json:
--------------------------------------------------------------------------------
1 | {"faction_offset":500001,"factions":[{"id":0,"name":"Caldari State","description":"The Caldari State is ruled by several mega-corporations. There is no central government to speak of - all territories within the State are owned and ruled by corporations. Duty and discipline are required traits in Caldari citizens, plus unquestioning loyalty to the corporation they live to serve. The corporations compete aggressively amongst themselves and with companies outside the State, resulting in a highly capitalistic society."},{"id":1,"name":"Minmatar Republic","description":"The Minmatar Republic was formed over a century ago when the Minmatar threw out their Amarrian overlords in what is now known as the Minmatar Rebellion. In this the Minmatar had the support of the Gallente Federation, and to this day the two nations remain close allies. Yet, only a quarter of the Minmatar people reside within the Republic. The rest are scattered around the star cluster, including a large portion who are still enslaved within the Amarr Empire. Minmatar individuals are independent and proud, possessing a strong will and a multitude of tribal traditions."},{"id":2,"name":"Amarr Empire","description":"The largest of the five main empires, the Amarr Empire is a sprawling patch-work of feudal-like provinces held together by the might of the emperor. Religion has always played a big part in Amarrian politics and the Amarrians believe they are the rightful masters of the world, souring their relations with their neighbours. Another source of ill-feelings on part of the other empires is the fact that the Amarrians embrace slavery."},{"id":3,"name":"Gallente Federation","description":"The Gallente Federation encompasses several races, the Gallenteans the largest by far. The Federation is democratic and very liberal in a world full of dictators and oligarchies. The Caldari State was once part of the Federation, but a severe dispute resulted in their departure and a long war between the Gallente Federation and the Caldari State. The Gallenteans are the masters of pleasure and entertainment and their rich trade empire has given the world many of its most glorious and extravagant sights. "},{"id":4,"name":"Jove Empire","description":"The Jove Empire is isolated from the rest of the world to all but a selected few. The Jovians are a mystery to the other races, fueled not only by their elusiveness, but also their highly advanced technology, eons ahead of the other races. The Jovians have been civilized longer than any other race in the world of EVE and have gone through several golden ages, now long-since shrouded in the past. The current Jovian Empire is only a pale shadow of its former self, mainly because of the Jovian Disease - a psychological disorder that is always fatal."},{"id":5,"name":"CONCORD Assembly","description":"CONCORD is an independent organization founded a century ago to facilitate negotiations between the races to improve relations, as well as to foster inter-stellar trade through policing and regulations. Starting as a fledgling meeting ground for diplomats CONCORD has in the decades since it was founded slowly increased its power and influence. It has become an entity independent of the races, as it is able to largely fund its own operation through customs, confiscation of contraband goods, and other means."},{"id":6,"name":"Ammatar Mandate","description":"The Ammatars are part of the Amarr Empire, but are of Minmatar origin. During the time the Amarrians occupied the Minmatar home worlds one of the Minmatar tribes, the Nefantars, collaborated heavily with the Amarrians. The Nefantars fled Minmatar space during the Minmatar Rebellion and the Amarr Emperor set them up in Amarr controlled areas close to Minmatar space. Soon everyone had started calling them Ammatars. Today, the Ammatars enjoy a semi-autonomy in their own space and are still embroiled in war with their former Minmatar brethren."},{"id":7,"name":"Khanid Kingdom","description":"The Khanid Kingdom, also known as the Dark Amarr, was founded a few centuries ago when the last Amarr Emperor was chosen. Khanid was one of the royal heirs at the time and, in accordance with tradition, should have killed himself after failing to become emperor. This Khanid refused to do and split his vast domains from the Amarr Empire. The empire retaliated, but only managed to conquer some of the vulnerable outer regions from Khanid. The Kingdom still upholds many of the traditions of Amarr society, but has also wholeheartedly embraced the customs of others, mainly the Caldari. Many visitors to the Kingdom feel like it is a surreal mix of the Amarr and Caldari empires. "},{"id":8,"name":"The Syndicate","description":"Formed by Intaki exiles from the Gallente Federation during the Caldari-Gallente War. The Syndicate has slowly grown in stature and influence and now serves as an important link between the empires and the illegal elements in the outer regions. Syndicate space is a pirate haven, but still retains enough civility to allow pretty much anyone to travel there to do business. The Syndicate markets are always chockfull of contraband goods and illegal wares that are hard or impossible to come by elsewhere. Each Syndicate station is an autonomous entity, but they cooperate on security and information issues. The unofficial leader of the Syndicate is Silphy en Diabel, a former Sister of EVE that returned to Syndicate space to save her family's fortune. Since then she's turned out to be just as resourceful and ruthless as her late father."},{"id":9,"name":"Guristas Pirates","description":"Formed by two former members of the Caldari Navy, the pair go by the names Fatal and the Rabbit, the Guristas are a constant thorn in the side of the Caldari State. The Guristas are traditional pirates in the sense that their operation is not based around some creed or ideology, but rather a plain and simple greed. The Guristas have bases close to Caldari space and from them they embark on daring raids, often into the State itself. Though the Guristas are considered more honorable than many of their counterparts, they are still extremely dangerous and not to be tampered with."},{"id":10,"name":"Angel Cartel","description":"Operating from the heart of the Curse region, the Angel Cartel is today the largest and best organized of the space-based criminal factions. The Angels are divided into several groups, each with a very special function. It is commanded by the Dominations and in the century they've been lurking in deep space they have stolen, plundered or sabotaged countless number of ships and kidnapped, molested or murdered thousands of people. The Angels recruit members from all the races, and are thus not bound to any one zone of operation, which spans almost the entire known world. Many believe that the Angels got their power by uncovering Jovian technologies hidden in their ancient homes, now infested by the Angel Cartel. "},{"id":11,"name":"Blood Raider Covenant","description":"The Amarr Empire has had its share of religious cults and fanatics in the past, but few have been as successful, or been feared as much, as the Blood Raiders. The Blood Raiders are a sect of an ancient cult called Sani Sabik, which uses blood in their rituals. The Blood Raiders believe that cloned bodies have 'purer' blood than other bodies and this explains why they operate mainly in space, attacking unwary space farers and draining their bodies of blood. The Blood Raiders are led by the fearsome Omir Sarikusa, who has remained on top of the DED most wanted list for many years now. Under his leadership the Blood Raiders have become more organized and they have established several bases in the Bleak Lands region."},{"id":12,"name":"The InterBus","description":"The InterBus is one of the more successful joint ventures the empires have undertaken. It was formed some 30 years ago to act as a neutral passenger transportation company that would span the entire known world. Since then it has evolved a bit, especially when it started to ferry goods too. The InterBus is used by the SCC to ferry goods between stations, as they are reliable and operate in every station in the world. As InterBus has to operate not only in empire stations, but also in pirate havens and other stations associated with organized crime, the company has to uphold a very strict policy regarding neutrality and secrecy. Even if the company is owned by the empires, no information regarding to shipments or station locations is ever given out. The strict adherence to these rules has allowed InterBus to operate without harassment in every corner of the world of EVE, making them one of the pillars of the inter-stellar community."},{"id":13,"name":"ORE","description":"Outer Ring Excavations, or ORE, is the largest independent mining corporation around. ORE was originally a fledgling Gallentean company, but struck gold when they found extremely rich Nocxium asteroid belts in the Outer Ring region. When the Gallente Federation tried to force ORE to reveal the location of the asteroid fields the company left Gallentean space and set up base in the Outer Ring region. They used their massive wealth to buy protection for their bases and keep their operation secret. Several pirate factions have tried to muscle in on the ORE territories, but with little success."},{"id":14,"name":"Thukker Tribe","description":"The Thukker tribe is one of the seven original Minmatar tribes. After the Minmatar Rebellion the Thukkers left Minmatar space and took up the nomadic lifestyles of their ancestors, only this time in space. The closest thing they've got to home is the Great Wildlands region, where they are very numerous, but the Thukkers like to be on the move, constantly going from one solar system to another in their huge caravans, trading and scavenging. Respectable citizens of EVE frown upon the Thukkers, considering them to be nothing but scoundrels and thieves. Indeed, the Thukkers often operate on the shadier side of the law, but their resourcefulness and diligence count a lot more for their success than their criminal activities."},{"id":15,"name":"Servant Sisters of EVE","description":"The Sisters of EVE are mainly known for their humanitarian aid efforts to those suffering because of war, famine or even just being lost in space. But the Sisters of EVE base their existence on strong religious beliefs, which they have coupled with scientific facts. They believe that the EVE gate is a gateway to heaven - that god resides on the other side of the gate. As well as dedicating themselves to aiding those in need they are also busy with scientific experiments around the EVE gate, hoping to gain a better understanding of the forces at work there."},{"id":16,"name":"The Society of Conscious Thought","description":"The Society of Conscious Thought is three centuries old and was founded by a Jovian named Ior Labron, who was in search of spiritual enlightenment. The Society has since then taken many guises and been anything from a religious sect full of hermits to a political institute playing the power game. Today, the Society is mainly known for their scholastic achievements, their schools are widely regarded as the best ones in the world of EVE and rich and influential parents everywhere fight to get their kids admitted. Offering large sums of money is, however, no guarantee for admittance, as the Society has its own peculiar selection process that seems to have little rhyme or reason to outsiders. The Society operates in remote areas, where they build strongholds called kitz. Not all kitz are schools, some are still devoted to spiritual enlightenment or scientific pursuits. "},{"id":17,"name":"Mordu's Legion Command","description":"The origin of Mordu's Legion lies in the Gallente-Caldari War when a group Intaki military personnel sided with the Caldari. The Intakis were put into a separate unit with a Caldari officer named Mordu. After the war the Intakis settled in Caldari space, but unwillingly became entangled with Caldari locals in the Waschi Uprising. Mordu's Legion was formed at that time as a mercenary fighting force and after the uprising it continued in existence. The Legion is loosely associated with the Caldari Navy, but are in most part totally independent. Mordu's Legion is commonly hired by companies to protect valuable assets outside empire space, for instance Outer Ring Excavations pays them handsomely to patrol the Outer Ring region."},{"id":18,"name":"Sansha's Nation","description":"Sansha's Nation was founded more than a century ago, shortly after all the empires had come into contact, just when space exploration and colonization was taking off. Sansha was a Caldari tycoon that carved out a sizeable piece of space for himself. There, he set out to create an utopian state. His vision and charm attracted thousands of people and for some time the Nation flourished. But Sansha became ever more warped as his success increased. He started experiments, combining capsule technology with the human mind, creating zombie-like creatures that had the cold, calculating mind of a computer, but the ingenuity of humans. When this became public knowledge Sansha was condemned and the other empires joined forces to bring him down. His forces were decimated and scattered to the winds. Remnants still remain far in the outer regions, but the once glorious Nation has been reduced to pirates and pillagers."},{"id":19,"name":"Serpentis","description":"The Serpentis Corporation was founded a few decades ago by V.Salvador Sarpati. At first it was engaged in hi-tech research, but with time its ties with the underworld grew and the Serpentis research stations, scattered around in remote areas, became infamous pirate havens. Sarpati made a deal with the Angel Cartel early on to provide protection for his stations and the duty was taken on by the Guardian Angels. Both sides have prospered enormously for this deal - Serpentis can operate in peace and the Angel Cartel gets access to the illegal research efforts of the Serpentis. It is strongly believed that Serpentis is the main developer and manufacturer of illegal neural boosters, especially since Sarpati's father was a renown specialist in that field. The home of Serpentis is in the Phoenix constellation in the Fountain region."}]}
--------------------------------------------------------------------------------
/website/include/common.php:
--------------------------------------------------------------------------------
1 | updateUser($_SESSION["unique_id"], $local_system_id);
29 | }
30 | //check if a user is tracked
31 | else if( isset($_SESSION["track_token"]) )
32 | {
33 | //then local is tracked user system
34 | $tracked_user = $db->getUser($_SESSION["track_token"]);
35 | if($tracked_user != NULL)
36 | {
37 | $user_token = $tracked_user["unique_id"];
38 | $local_system_id = $tracked_user["system_id"];
39 | }
40 | }
41 | //check if we are in igb
42 | else if($igb->isInGame())
43 | {
44 | //then local is the igb current system
45 | $local_system_id = $igb->getSolarSystemID();
46 | //die ("id: ".$local_system_id );
47 | $db->updateUser($_SESSION["unique_id"], $local_system_id);
48 | $user_token = $_SESSION["unique_id"];
49 | }else
50 | {
51 | //default to Jita
52 | $local_system_id = 30000142;
53 | $user_token = "debug";
54 | //$db->updateUser($_SESSION["unique_id"], $local_system_id);
55 | }
56 | }
57 |
58 | ?>
--------------------------------------------------------------------------------
/website/include/config.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/website/include/db_handler.php:
--------------------------------------------------------------------------------
1 | store_result();
14 |
15 | $meta = $stmt->result_metadata();
16 | while ($field = $meta->fetch_field())
17 | {
18 | $params[] = &$row[$field->name];
19 | }
20 |
21 | call_user_func_array(array($stmt, 'bind_result'), $params);
22 |
23 | while ($stmt->fetch()) {
24 | foreach($row as $key => $val)
25 | {
26 | $c[$key] = $val;
27 | }
28 | $result[] = $c;
29 | }
30 | if(isset($result)){
31 | return $result;
32 | } else {
33 | return array();
34 | }
35 | }
36 |
37 | class EveDB {
38 |
39 | public $conn;
40 |
41 | function __construct() {
42 | include_once 'config.php';
43 | // Connecting to mysql database
44 | $this->conn = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);
45 |
46 | // Check for database connection error
47 | if (mysqli_connect_errno()) {
48 | echo "Failed to connect to MySQL: " . mysqli_connect_error();
49 | }
50 |
51 | $sql = "SET time_zone = '+00:00'";
52 | $result = mysqli_query($this->conn, $sql);
53 | }
54 |
55 | // ****************** USERS MGMT ******************
56 |
57 | public function getUser($unique_id) {
58 | $stmt = $this->conn->prepare("SELECT updated_at, system_id FROM tmp_users WHERE unique_id = ?");
59 | $stmt->bind_param("s", $unique_id);
60 | $stmt->execute();
61 | $stmt->store_result();
62 | $stmt->bind_result($updated_at,$system_id);
63 | $stmt->fetch();
64 | $stmt->close();
65 |
66 | if($updated_at == NULL)
67 | {
68 | return NULL;
69 | }
70 |
71 | $res["updated_at"]=$updated_at;
72 | $res["system_id"]=$system_id;
73 | $res["unique_id"]=$unique_id;
74 | return $res;
75 | }
76 |
77 | function generate_random_string($length) {
78 | $random = '';
79 | for ($i = 0; $i < $length; $i++) {
80 | $random .= chr(rand(ord('a'), ord('z')));
81 | }
82 | return $random;
83 | }
84 |
85 | public function deleteUser($unique_id)
86 | {
87 | $stmt = $this->conn->prepare("DELETE FROM tmp_users WHERE unique_id = ?");
88 | $stmt->bind_param("s", $unique_id);
89 | if ($stmt->execute()) {
90 | $stmt->close();
91 | } else {
92 | return NULL;
93 | }
94 | }
95 |
96 | //delete old temp users
97 | public function deleteOldUsers()
98 | {
99 | mysqli_query($this->conn,"DELETE FROM tmp_users WHERE updated_at < (NOW() - INTERVAL 8 HOUR");
100 | }
101 |
102 | //return the unique_id of the created user
103 | public function createUser($system_id)
104 | {
105 | $found = false;
106 | $count = 5;
107 | $unique_id = NULL;
108 | while($found==false && $count-- > 0)
109 | {
110 | $unique_id = $this->generate_random_string(5);
111 | $usr = $this->getUser($unique_id);
112 | $found = ($usr == NULL);
113 | }
114 | if($found == false) return NULL;
115 |
116 | $stmt = $this->conn->prepare("INSERT INTO tmp_users(unique_id, system_id) values(?, ?)");
117 | $stmt->bind_param("si", $unique_id, $system_id);
118 | $result = $stmt->execute();
119 | $stmt->close();
120 |
121 | return $unique_id;
122 | }
123 |
124 | public function updateUser($unique_id, $system_id)
125 | {
126 | $stmt = $this->conn->prepare("UPDATE tmp_users SET system_id = ?, updated_at = now() WHERE unique_id = ?");
127 | $stmt->bind_param("is", $system_id, $unique_id);
128 | $result = $stmt->execute();
129 | $stmt->close();
130 | if ($result) {
131 | return TRUE;
132 | } else {
133 | return FALSE;
134 | }
135 | }
136 |
137 |
138 | // ****************** INTEL MGMT ******************
139 |
140 | public function updateIntel($system_id, $status, $token)
141 | {
142 | //$stmt = $this->conn->prepare("INSERT INTO intel(system_id, status, updated_by) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE status = VALUES(status), seen_at=now(), updated_by = VALUES(updated_by)");
143 | $stmt = $this->conn->prepare("INSERT INTO intel(system_id, status, updated_by) VALUES (?, ?, ?)");
144 | $stmt->bind_param("iis", $system_id, $status,$token);
145 |
146 | $result = $stmt->execute();
147 | $stmt->close();
148 | if ($result) {
149 | return TRUE;
150 | } else {
151 | return FALSE;
152 | }
153 | }
154 |
155 | public function resetIntel($system_id, $token)
156 | {
157 | return true;
158 |
159 | $stmt = $this->conn->prepare("UPDATE intel SET status = 3 WHERE system_id = ? AND updated_by = ? AND status = 0");
160 | $stmt->bind_param("is", $system_id, $token);
161 | $result = $stmt->execute();
162 | $stmt->close();
163 | if ($result) {
164 | return TRUE;
165 | } else {
166 | return FALSE;
167 | }
168 | }
169 |
170 | public function getIntelBySystem($systemList) {
171 | $systemStr = implode(",", $systemList);
172 | $sql = "SELECT seen_at, status, system_id FROM intel WHERE system_id IN (".$systemStr.")";
173 | $stmt = $this->conn->prepare($sql);
174 | $stmt->execute();
175 | $intels = stmt_get_result($stmt);
176 | $stmt->close();
177 | return $intels;
178 | }
179 |
180 | public function getIntelByTime($timestamp) {
181 | $stmt = $this->conn->prepare("SELECT seen_at, status, system_id FROM intel WHERE seen_at > ? ORDER BY seen_at ASC");
182 | $stmt->bind_param("s", $timestamp);
183 | $stmt->execute();
184 | $intels = stmt_get_result($stmt);
185 | $stmt->close();
186 | return $intels;
187 | }
188 |
189 | public function getLastIntel() {
190 | $stmt = $this->conn->prepare("SELECT seen_at, status, system_id FROM intel WHERE seen_at > (NOW() - INTERVAL 1 HOUR) ORDER BY seen_at ASC");
191 | $stmt->execute();
192 | $intels = stmt_get_result($stmt);
193 | $stmt->close();
194 | return $intels;
195 | }
196 |
197 | }
198 |
199 | ?>
--------------------------------------------------------------------------------
/website/include/eve_header.php:
--------------------------------------------------------------------------------
1 | headers = $_SERVER;
10 | }
11 |
12 | function isInGame() { return ($this->headers['HTTP_EVE_TRUSTED']=="Yes"); }
13 | function getCharName() { return ($this->headers['HTTP_EVE_CHARNAME']); }
14 | function getCharID() { return ($this->headers['HTTP_EVE_CHARID']); }
15 | function getSolarSystemName() { return ($this->headers['HTTP_EVE_SOLARSYSTEMNAME']); }
16 | function getSolarSystemID() { return ($this->headers['HTTP_EVE_SOLARSYSTEMID']); }
17 | }
18 |
19 | ?>
--------------------------------------------------------------------------------
/website/include/security.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/website/index.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 | Eve Online Live Intel
16 |
307 |
308 |
309 |
320 |
321 |
381 |
382 |
383 |
384 |
385 | ';
387 | if( isset($_GET["system_name"]) )
388 | {
389 | echo 'var forced_system_name="'.$_GET["system_name"].'";';
390 | }
391 |
392 | if( isset($_GET["track_token"]) )
393 | {
394 | echo 'var track_token="'.$_GET["track_token"].'";';
395 | }
396 | echo '';
397 | ?>
398 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
--------------------------------------------------------------------------------
/website/intelMap.js:
--------------------------------------------------------------------------------
1 | /* Copyright 2014 Jeremie Roy. All rights reserved.
2 | * License: http://www.opensource.org/licenses/BSD-2-Clause
3 | */
4 |
5 | if (typeof (CCPEVE) !== "undefined" ) {CCPEVE.requestTrust('http://www.yourwebsite.org'); }
6 |
7 | function parse_date(str){
8 | var arr = str.split(/[- :]/);
9 | return new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);
10 | }
11 |
12 | function shorten_date(str){
13 | var arr = str.split(/[- :]/);
14 | return arr[3]+":"+arr[4];
15 | }
16 |
17 |
18 | function update_hostile() {
19 | EveLiveData.update_local_hostile();
20 | }
21 |
22 | function update_clear() {
23 | EveLiveData.update_local_clear();
24 | }
25 |
26 | function toggle_options() {
27 | var options_div = document.getElementById("header_options");
28 | if (options_div.style.display == "block") {
29 | options_div.style.display = "none";
30 | } else {
31 | options_div.style.display = "block";
32 | }
33 | }
34 |
35 | //storage for the global options
36 | var Options = {
37 | map_mode: 0,
38 | show_links: true,
39 | show_names: true,
40 | show_elapsed_times: true,
41 | show_security_status: true,
42 | orbit_targets : false
43 | };
44 |
45 | var JUMP_CIRCLE_RADIUS = 80;
46 | var NODE_RADIUS = 8;
47 |
48 | function set_map_mode(mode) {
49 | Options.map_mode = mode;
50 | draw_map();
51 | }
52 |
53 | function toggle_show_links() {
54 | Options.show_links = !Options.show_links;
55 | draw_map();
56 | }
57 |
58 | function toggle_show_names() {
59 | Options.show_names = !Options.show_names;
60 | draw_map();
61 | }
62 |
63 | function toggle_show_elapsed_times() {
64 | Options.show_elapsed_times = !Options.show_elapsed_times;
65 | draw_map();
66 | }
67 |
68 |
69 | function toggle_show_security_status() {
70 | Options.show_security_status = !Options.show_security_status;
71 | draw_map();
72 | }
73 | function toggle_show_intel_panel() {
74 | var intel_panel = document.getElementById("intel_container");
75 | if (intel_panel.style.display == "none") {
76 | intel_panel.style.display = "inline-block";
77 | } else {
78 | intel_panel.style.display = "none";
79 | }
80 | }
81 |
82 |
83 | function toggle_orbit_target() {
84 | Options.orbit_targets = !Options.orbit_targets;
85 | }
86 |
87 | var Data = {
88 | max_jumps:1,
89 | max_x:1,
90 | min_x:-1,
91 | max_y:1,
92 | min_y:-1,
93 | nodes: [],
94 | links:[],
95 | nodes_per_jumps:[]
96 | };
97 |
98 | var map_container = document.getElementById('map_container');
99 | width = map_container.clientWidth;
100 | height = map_container.clientHeight;
101 |
102 | var message_overlay = null;
103 | function setMessageOverlay(text)
104 | {
105 | removeMessageOverlay();
106 | message_overlay = d3.select("svg")
107 | .append("text")
108 | .attr("class", "info")
109 | .attr("x", map_container.clientWidth / 2)
110 | .attr("y", map_container.clientHeight / 2)
111 | .attr("dy", ".35em")
112 | .text("text");
113 | }
114 |
115 | function removeMessageOverlay()
116 | {
117 | if(message_overlay != null)
118 | {
119 | message_overlay.remove();
120 | message_overlay = null;
121 | }
122 | }
123 |
124 | function print_error(txt)
125 | {
126 | setMessageOverlay("Error: "+txt);
127 | }
128 |
129 |
130 | var security_status_color_V = [-1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1];
131 | var security_status_color_C = ["#8B0000", "#960001", "#A10002", "#AC0002", "#B80002", "#C30002", "#CF0002", "#DB0001", "#E70001", "#F30001", "#FF0000", "#FF5F00", "#FF8C00", "#FF9500", "#FF9D00", "#FFA500", "#D4C800", "#9BE500", "#00FF00", "#46FF9C", "#00FFFF"];
132 |
133 | // unfortunately, this break the IGB
134 | //var security_status_color = d3.scale.linear()
135 | // .domain(security_status_color_V)
136 | // .range(security_status_color_C);
137 |
138 | function security_status_color(v) {
139 | var idx = 10 + Math.floor(v * 10);
140 | return security_status_color_C[idx];
141 | }
142 | //console.log("l: "+security_status_color_V.length);
143 | //console.log("-1: "+security_status_color(-1));
144 | //console.log("1: "+security_status_color(1));
145 | //console.log("0: "+security_status_color(0));
146 |
147 | /*
148 | function show_system_menu(d) {
149 | hide_system_menu();
150 |
151 |
152 | var x = translation[0] + scaleFactor * d.x;
153 | var y = translation[1] + scaleFactor * d.y;
154 |
155 | system_menu = map_svg.append("text")
156 | .attr("dx", x)
157 | .attr("dy", y)
158 | .text("set destination: " + d.name);
159 | }
160 |
161 | function hide_system_menu() {
162 | if (system_menu != null) {
163 | system_menu.remove();
164 | }
165 | }*/
166 |
167 |
168 | //create root svg node
169 | var main_svg = d3.select("#map_container")
170 | .append("svg")
171 | .style("width","100%")
172 | .style("height","100%");
173 |
174 | var map_svg = null;
175 | var system_menu = null;
176 |
177 | var nodes = null;
178 | var node_names = null;
179 | var node_circles = null;
180 |
181 | var links = null;
182 |
183 | var circles_ref = null;
184 |
185 | var scaleFactor = 1;
186 | var translation = [0, 0];
187 |
188 | //append zoom behavior to the map container
189 | d3.select("#map_container")
190 | .call(zm = d3.behavior.zoom()
191 | .scaleExtent([0.25, 12])
192 | .on("zoom", zoom)
193 | .on("zoomstart", zoom_start)
194 | .on("zoomend", zoom_end));
195 |
196 | function draw_map() {
197 |
198 | //console.log("draw_map");
199 | // Remove map layout and data
200 | if (map_svg != null) {
201 | map_svg.remove();
202 | }
203 |
204 | map_svg = main_svg.append("g")
205 | .attr("id", "map_svg");
206 |
207 | //append jumps reference circles
208 | if (Options.map_mode != 0 ) {
209 | var radiuses = Array();
210 | for (var i = 1; i <= Data.max_jumps; ++i) {
211 | radiuses.push(JUMP_CIRCLE_RADIUS * i);
212 | }
213 |
214 | circles_ref = map_svg.selectAll(".jump_circle")
215 | .data(radiuses)
216 | .enter()
217 | .append("circle")
218 | .attr("class", "jump_circle")
219 | .attr("cx", width / 2)
220 | .attr("cy", height / 2)
221 | .attr("r", function (d) {
222 | return d;
223 | });
224 | } else {
225 | circles_ref = null;
226 | }
227 |
228 | //setup force system
229 | var force = d3.layout.force()
230 | .gravity(0)
231 | .charge(-700)
232 | //.charge( function(d) { return Math.pow(4, 1 + Data.max_jumps-d.jumps) * (-100); } )
233 | //.charge( function(d) { return Math.pow(4, 1 + d.jumps) * (-100); } )
234 | .linkStrength(1)
235 | .linkDistance(10)
236 | //.linkDistance( function(link) { return JUMP_CIRCLE_RADIUS * Math.max(0.1, Math.abs(link.source.jumps - link.target.jumps)); })
237 | .size([width, height]);
238 |
239 | var decalX = 0;
240 | var decalY = 0;
241 |
242 | var map_width = Data.max_x - Data.min_x;
243 | var map_height = Data.max_y - Data.min_y;
244 |
245 | //rescale the systems positions to fit 90% of the map area
246 | var scale_size = 0.9 * Math.min(width / map_width, height / map_height);
247 |
248 | Data.nodes.forEach(function (node) {
249 | node.px = (node.system.x - Data.min_x) * scale_size;
250 | node.py = (map_height - node.system.y + Data.min_y) * scale_size;
251 |
252 | if (node.jumps == 0) {
253 | decalX = width / 2 - node.px;
254 | decalY = height / 2 - node.py;
255 | node.fixed = true;
256 | } else
257 | node.fixed = (Options.map_mode == 0);
258 | });
259 |
260 | if (Options.map_mode != 0) {
261 | //center on current system
262 | Data.nodes.forEach(function (node) {
263 | node.px += decalX;
264 | node.py += decalY;
265 | node.x = node.px;
266 | node.y = node.py;
267 | });
268 | } else {
269 | //center on screen
270 | Data.nodes.forEach(function (node) {
271 | node.px += (width - scale_size * map_width) / 2;
272 | node.py += (height - scale_size * map_height) / 2;
273 | node.x = node.px;
274 | node.y = node.py;
275 | });
276 | }
277 |
278 | force
279 | .nodes(Data.nodes)
280 | .links(Data.links)
281 | .on("tick", tick);
282 |
283 | if (Options.show_links) {
284 | links = map_svg.selectAll(".link")
285 | .data(Data.links)
286 | .enter()
287 | .append("line")
288 | .attr("class", "link");
289 | } else {
290 | links = null;
291 | }
292 |
293 | nodes = map_svg.selectAll(".node")
294 | .data(Data.nodes)
295 | .enter()
296 | .append("g") //set a group for the node
297 | .attr("class", "node")
298 | .attr("id", function (d) {
299 | return "system_" + d.system.id;
300 | });
301 | //.on("click", function(d) { show_system_menu(d); });
302 | //.call(force.drag)
303 | //.on("mousedown", function() { d3.event.stopPropagation(); });
304 |
305 | if (Options.show_security_status) {
306 | nodes.style("stroke", function (d) {
307 | return security_status_color(d.system.sec);
308 | });
309 | }
310 |
311 | node_circles = nodes.append("circle")
312 | //.attr("r", function(d) { return 4 + 2*(Data.max_jumps - d.jumps); } )
313 | .attr("r", NODE_RADIUS);
314 | //.attr("id", function (d) {
315 | //return "system_" + d.id;
316 | //});
317 |
318 | if (Options.show_names) {
319 | node_names = nodes.append("text")
320 | .attr("text-anchor","middle")
321 | .text(function (d) {
322 | return d.system.name;
323 | });
324 | }else if(Options.show_elapsed_times)
325 | {
326 | node_names = nodes.append("text")
327 | .attr("text-anchor","middle");
328 | }
329 |
330 | function tick(e) {
331 | if (Options.map_mode == 1) {
332 | nodes.each(function (node) {
333 | if (node.jumps > 0) {
334 | var dx = node.x - width / 2;
335 | var dy = node.y - height / 2;
336 | var l = Math.sqrt(dx * dx + dy * dy);
337 | node.x = (width / 2 + dx / l * node.jumps * JUMP_CIRCLE_RADIUS);
338 | node.y = (height / 2 + dy / l * node.jumps * JUMP_CIRCLE_RADIUS);
339 |
340 | } else {
341 | node.x = width / 2;
342 | node.y = height / 2;
343 | }
344 | });
345 | } else if (Options.map_mode == 2) {
346 | var index_per_jumps = Array();
347 | for (var i = 0; i < Data.max_jumps + 1; ++i) {
348 | index_per_jumps.push(0);
349 | }
350 | nodes.each(function (node) {
351 | if (node.jumps > 0) {
352 |
353 | var angle = -Math.PI / 2 + Math.PI * 2 * index_per_jumps[node.jumps] / Data.nodes_per_jumps[node.jumps];
354 |
355 | node.x = width / 2 + Math.cos(angle) * node.jumps * JUMP_CIRCLE_RADIUS;
356 | node.y = height / 2 + Math.sin(angle) * node.jumps * JUMP_CIRCLE_RADIUS;
357 | index_per_jumps[node.jumps]++;
358 | } else {
359 | node.x = width / 2;
360 | node.y = height / 2;
361 | }
362 | });
363 | }
364 | /*else if (Options.map_mode == 3) {
365 | var index_per_jumps = Array();
366 | for (var i = 0; i < Data.max_jumps + 1; ++i) {
367 | index_per_jumps.push(0);
368 | }
369 |
370 | var base_count = 10;
371 | var ref_angle = (Math.PI*2) / base_count;
372 |
373 | nodes.each(function (node) {
374 | if (node.jumps > 0) {
375 | var angle_step = Math.PI * 2 / Data.nodes_per_jumps[node.jumps];
376 | angle_step = Math.min(angle_step, ref_angle/node.jumps);
377 |
378 | var angle_start = (-Math.PI/2);
379 | //center it
380 | angle_start-= angle_step * (Data.nodes_per_jumps[node.jumps]-1)/2;
381 |
382 | var angle = angle_start + angle_step * index_per_jumps[node.jumps];
383 |
384 | node.x = width / 2 + Math.cos(angle) * node.jumps * JUMP_CIRCLE_RADIUS;
385 | node.y = height / 2 + Math.sin(angle) * node.jumps * JUMP_CIRCLE_RADIUS;
386 | index_per_jumps[node.jumps]++;
387 | } else {
388 | node.x = width / 2;
389 | node.y = height / 2;
390 | }
391 | });
392 | }*/
393 |
394 | }//end of tick
395 |
396 | if (Options.map_mode == 1) {
397 | // Run the layout a fixed number of times.
398 | force.start();
399 | var n = 100;
400 | for (var i = n; i > 0; --i) force.tick();
401 | force.stop();
402 | } else {
403 | force.start();
404 | force.tick();
405 | force.stop();
406 | }
407 |
408 | draw_node_names();
409 |
410 | //update intel layout
411 | draw_intel();
412 |
413 | zoom();
414 | } //end draw_map
415 |
416 | function draw_node_names()
417 | {
418 | //optimize system name position
419 | node_names.each(function (d) {
420 | var d_this = d3.select(this);
421 |
422 | var dx = d.x - width / 2;
423 | var dy = d.y - height / 2;
424 | var l2 = dx * dx + dy * dy;
425 |
426 | var b = this.getBBox();
427 |
428 | if( l2 < 1 ){
429 | dx = 0;
430 | dy = -1;
431 | }else{
432 | var l = Math.sqrt(l2);
433 | dx /= l;
434 | dy /= l;
435 | }
436 | d_this.attr("dx", 12*dx + dx*b.width/2 );
437 | d_this.attr("dy", 12*dy + (dy+0.5)*b.height/2 );
438 | });
439 | }
440 |
441 | function zoom_start() {}
442 |
443 | function zoom_end() {}
444 |
445 | function zoom() {
446 |
447 | if (d3.event != null) {
448 | scaleFactor = d3.event.scale;
449 | translation = d3.event.translate;
450 | }
451 |
452 | //diameter = 2*PI*R
453 | var radius= NODE_RADIUS;
454 | for(var i=1;i oldTime || intel.status == 3 ) {
603 | system_circle.attr("class", "gray");
604 | if(Options.show_elapsed_times)
605 | {
606 | var system_text = system_node.select("text");
607 | system_text.text( function (d) {
608 | if (Options.show_names) {
609 | return d.system.name;
610 | }else{
611 | return "";
612 | }
613 | });
614 | }
615 | } else
616 | {
617 | //0 = clear
618 | if (intel.status == 0) {
619 | if (timeSpanSeconds > middleTime)
620 | system_circle.attr("class", "oldBlue");
621 | else if (timeSpanSeconds > freshTime)
622 | system_circle.attr("class", "middleBlue");
623 | else
624 | system_circle.attr("class", "freshBlue");
625 | } else {
626 | if (timeSpanSeconds > middleTime)
627 | system_circle.attr("class", "oldRed");
628 | else if (timeSpanSeconds > freshTime)
629 | system_circle.attr("class", "middleRed");
630 | else
631 | system_circle.attr("class", "freshRed");
632 | }
633 |
634 | if(Options.show_elapsed_times)
635 | {
636 | var system_text = system_node.select("text");
637 | var elapsed = Math.min(timeSpanSeconds, 30 * 60);
638 | system_text.text( function (d) {
639 |
640 | if (Options.show_names) {
641 | return d.system.name+" "+toMMSS(elapsed);
642 | }else{
643 | return toMMSS(elapsed);
644 | }
645 | });
646 | }
647 | }
648 | }
649 | });
650 |
651 | if(Options.show_elapsed_times)
652 | {
653 | draw_node_names();
654 | }
655 | }
656 |
657 | function toMMSS (val ) {
658 | var seconds = Math.floor(val),
659 | hours = Math.floor(seconds / 3600);
660 | seconds -= hours * 3600;
661 | var minutes = Math.floor(seconds / 60);
662 | seconds -= minutes * 60;
663 |
664 | if (hours < 10) {
665 | hours = "0" + hours;
666 | }
667 | if (minutes < 10) {
668 | minutes = "0" + minutes;
669 | }
670 | if (seconds < 10) {
671 | seconds = "0" + seconds;
672 | }
673 | return /*hours+':'+*/ minutes + ':' + seconds;
674 | }
675 |
676 |
677 | var local_server_timespan_seconds = 0;
678 | var timer_start = new Date();
679 | var local_status = 0;
680 | var timer_interval = 0;
681 |
682 | function update_local_timer() {
683 | var elapsed = (new Date() - timer_start) * 0.001;
684 | elapsed += local_server_timespan_seconds;
685 | var timeElem = document.getElementById("local_timer_text");
686 | var friendlyElem = document.getElementById("progress_friendly");
687 | var hostileElem = document.getElementById("progress_hostile");
688 |
689 | if((elapsed > 30 * 60) || local_status==3 )
690 | {
691 | timeElem.innerHTML = "??:??";
692 | elapsed = 30*60;
693 | }else
694 | {
695 | timeElem.innerHTML = toMMSS(elapsed);
696 | }
697 |
698 | var ratio = 1 - elapsed / (30 * 60);
699 | if (local_status == 0) {
700 | friendlyElem.style.width = Math.round(100 * ratio) + "%";
701 | //friendlyElem.setAttribute("style","width:"+Math.floor(100*ratio)+"%");
702 | hostileElem.style.width = null;
703 | } else if (local_status == 1) {
704 | friendlyElem.style.width = null;
705 | hostileElem.style.width = Math.round(100 * ratio) + "%";
706 | //hostileElem.setAttribute("style","width:"+Math.floor(100*ratio)+"%");
707 | }else{
708 | friendlyElem.style.width = null;
709 | hostileElem.style.width = null;
710 | }
711 | }
712 |
713 |
714 | EveLiveData.tracker1Elem = document.getElementById("tracker_1");
715 | EveLiveData.tracker2Elem = document.getElementById("tracker_2");
716 | EveLiveData.tracker3Elem = document.getElementById("tracker_3");
717 |
718 |
719 | EveLiveData.on_local_change=function(local_system_id){
720 | Data = EveStaticData.getSystemsWithin(local_system_id, 4);
721 | draw_map();
722 | var local_system = EveStaticData.getSystemByID(local_system_id);
723 | document.getElementById("local_system_name").innerHTML = local_system.name;
724 |
725 | };
726 |
727 | EveLiveData.on_local_status_change=function(intel){
728 |
729 | clearInterval(timer_interval);
730 | if(typeof(intel) !== "undefined")
731 | {
732 | //console.log("local:"+intel.system_id+" at:"+intel.seen_at);
733 | var serverTime = EveLiveData.get_server_time();
734 | var seen_at = parse_date(intel.seen_at);
735 | var timeSpanSeconds = (serverTime - seen_at) * 0.001;
736 |
737 | local_server_timespan_seconds = timeSpanSeconds;
738 | timer_start = new Date();
739 | local_status = intel.status;
740 | update_local_timer();
741 | timer_interval = setInterval(update_local_timer, 1000);
742 | }else{
743 | console.log("no local intel");
744 | local_status = 3;
745 | }
746 | update_local_timer();
747 | };
748 |
749 | EveLiveData.on_new_intel=function(intels){
750 | //new intel loaded
751 | var intel_panel = d3.select("#intel_container");
752 |
753 | intels.forEach(
754 | function (intel) {
755 | var div = intel_panel.insert("div", ":first-child");
756 | if(intel.status==0)
757 | div.attr("style","background-color: #0000AA");
758 | else if(intel.status==1)
759 | div.attr("style","background-color:#AA0000");
760 |
761 | var system =EveStaticData.getSystemByID(intel.system_id);
762 | var region =EveStaticData.getRegionByID(system.region_id);
763 | //div.html(shorten_date(intel.seen_at)+" "+system.name);//+" "+intel.status);
764 | div.html(shorten_date(intel.seen_at)+" - "+region.name+" - "+system.name);
765 | }
766 | );
767 | };
768 |
769 | EveLiveData.on_tracker_change=function(trackers){
770 | draw_targets(trackers);
771 | };
772 |
773 | EveLiveData.on_intel_update=function(){
774 | draw_intel();
775 | }
776 |
777 | EveStaticData.init(function()
778 | {
779 | draw_map();
780 | //load the first intel
781 | EveLiveData.init();
782 | });
783 |
784 | // window.onresize = function(){
785 | // console.log("resize event detected!");
786 | // }
787 |
--------------------------------------------------------------------------------
/website/intel_map.min.js:
--------------------------------------------------------------------------------
1 | "undefined"!==typeof CCPEVE&&CCPEVE.requestTrust("http://www.yourwebsite.org");function parse_date(a){a=a.split(/[- :]/);return new Date(a[0],a[1]-1,a[2],a[3],a[4],a[5])}function shorten_date(a){a=a.split(/[- :]/);return a[3]+":"+a[4]}function update_hostile(){EveLiveData.update_local_hostile()}function update_clear(){EveLiveData.update_local_clear()}function toggle_options(){var a=document.getElementById("header_options");a.style.display="block"==a.style.display?"none":"block"}
2 | var Options={map_mode:0,show_links:!0,show_names:!0,show_elapsed_times:!0,show_security_status:!0,orbit_targets:!1},JUMP_CIRCLE_RADIUS=80,NODE_RADIUS=8;function set_map_mode(a){Options.map_mode=a;draw_map()}function toggle_show_links(){Options.show_links=!Options.show_links;draw_map()}function toggle_show_names(){Options.show_names=!Options.show_names;draw_map()}function toggle_show_elapsed_times(){Options.show_elapsed_times=!Options.show_elapsed_times;draw_map()}
3 | function toggle_show_security_status(){Options.show_security_status=!Options.show_security_status;draw_map()}function toggle_show_intel_panel(){var a=document.getElementById("intel_container");a.style.display="none"==a.style.display?"inline-block":"none"}function toggle_orbit_target(){Options.orbit_targets=!Options.orbit_targets}var Data={max_jumps:1,max_x:1,min_x:-1,max_y:1,min_y:-1,nodes:[],links:[],nodes_per_jumps:[]},map_container=document.getElementById("map_container");width=map_container.clientWidth;
4 | height=map_container.clientHeight;var message_overlay=null;function setMessageOverlay(a){removeMessageOverlay();message_overlay=d3.select("svg").append("text").attr("class","info").attr("x",map_container.clientWidth/2).attr("y",map_container.clientHeight/2).attr("dy",".35em").text("text")}function removeMessageOverlay(){null!=message_overlay&&(message_overlay.remove(),message_overlay=null)}function print_error(a){setMessageOverlay("Error: "+a)}
5 | var security_status_color_V=[-1,-.9,-.8,-.7,-.6,-.5,-.4,-.3,-.2,-.1,0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],security_status_color_C="#8B0000 #960001 #A10002 #AC0002 #B80002 #C30002 #CF0002 #DB0001 #E70001 #F30001 #FF0000 #FF5F00 #FF8C00 #FF9500 #FF9D00 #FFA500 #D4C800 #9BE500 #00FF00 #46FF9C #00FFFF".split(" ");function security_status_color(a){return security_status_color_C[10+Math.floor(10*a)]}
6 | var main_svg=d3.select("#map_container").append("svg").style("width","100%").style("height","100%"),map_svg=null,system_menu=null,nodes=null,node_names=null,node_circles=null,links=null,circles_ref=null,scaleFactor=1,translation=[0,0];d3.select("#map_container").call(zm=d3.behavior.zoom().scaleExtent([.25,12]).on("zoom",zoom).on("zoomstart",zoom_start).on("zoomend",zoom_end));
7 | function draw_map(){null!=map_svg&&map_svg.remove();map_svg=main_svg.append("g").attr("id","map_svg");if(0!=Options.map_mode){for(var a=[],b=1;b<=Data.max_jumps;++b)a.push(JUMP_CIRCLE_RADIUS*b);circles_ref=map_svg.selectAll(".jump_circle").data(a).enter().append("circle").attr("class","jump_circle").attr("cx",width/2).attr("cy",height/2).attr("r",function(a){return a})}else circles_ref=null;var a=d3.layout.force().gravity(0).charge(-700).linkStrength(1).linkDistance(10).size([width,height]),c=0,d=
8 | 0,e=Data.max_x-Data.min_x,f=Data.max_y-Data.min_y,g=.9*Math.min(width/e,height/f);Data.nodes.forEach(function(a){a.px=(a.system.x-Data.min_x)*g;a.py=(f-a.system.y+Data.min_y)*g;0==a.jumps?(c=width/2-a.px,d=height/2-a.py,a.fixed=!0):a.fixed=0==Options.map_mode});0!=Options.map_mode?Data.nodes.forEach(function(a){a.px+=c;a.py+=d;a.x=a.px;a.y=a.py}):Data.nodes.forEach(function(a){a.px+=(width-g*e)/2;a.py+=(height-g*f)/2;a.x=a.px;a.y=a.py});a.nodes(Data.nodes).links(Data.links).on("tick",function(a){if(1==
9 | Options.map_mode)nodes.each(function(a){if(0d?(c=0,a=-1):(d=Math.sqrt(d),c/=d,a/=d);b.attr("dx",12*c+c*e.width/2);b.attr("dy",12*a+(a+.5)*e.height/2)})}function zoom_start(){}function zoom_end(){}
13 | function zoom(){null!=d3.event&&(scaleFactor=d3.event.scale,translation=d3.event.translate);for(var a=NODE_RADIUS,b=1;bb&&(b="0"+b);10>a&&(a="0"+a);return b+":"+a}
20 | var local_server_timespan_seconds=0,timer_start=new Date,local_status=0,timer_interval=0;
21 | function update_local_timer(){var a=.001*(new Date-timer_start),a=a+local_server_timespan_seconds,b=document.getElementById("local_timer_text"),c=document.getElementById("progress_friendly"),d=document.getElementById("progress_hostile");1800getUser($_POST["track_token"]);
23 | if($tracked_user ==NULL)
24 | {
25 | echo 'Incorrect track token. Please, try again.';
26 | }else{
27 | $_SESSION["track_token"] = $_POST["track_token"];
28 | $_SESSION["logged"] = $_POST["username"];
29 | }
30 | }else
31 | {
32 | //check if sender is IGB
33 | $system_id = NULL;
34 | if($igb->isInGame())
35 | {
36 | $system_id = $igb->getSolarSystemID();
37 | }
38 |
39 | if($system_id == NULL)
40 | {
41 | echo("Please log using the Eve Online Browser or use a track token.");
42 | }else{
43 |
44 | $db->deleteOldUsers();
45 |
46 | $unique_id = $db->createUser($system_id);
47 | $_SESSION["logged"]=$_POST["username"];
48 | $_SESSION["unique_id"] = $unique_id;
49 | }
50 | }
51 | } else {
52 | echo 'Incorrect password. Please, try again.';
53 | };
54 | };
55 |
56 | if (isset($_SESSION["logged"]) && array_key_exists($_SESSION["logged"],$USERS)) { //// check if user is logged or not
57 | //var_dump($_SESSION);
58 | header("Location: index.php");
59 | } else { //// if not logged show login form
60 | ?>
61 |
62 |
63 |
64 |
65 | Eve Online Live Intel
66 |
67 |
68 | Give a clue to you member about where to find/or ask the password...
69 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/website/logout.php:
--------------------------------------------------------------------------------
1 | deleteUser($_SESSION["unique_id"]);
11 | }
12 |
13 | // Unset all of the session variables.
14 | $_SESSION = array();
15 | if (ini_get("session.use_cookies")) {
16 | $params = session_get_cookie_params();
17 | setcookie(session_name(), '', time() - 42000,
18 | $params["path"], $params["domain"],
19 | $params["secure"], $params["httponly"]
20 | );
21 | }
22 |
23 | session_destroy();
24 |
25 | header("Location: login.php");
26 | ?>
--------------------------------------------------------------------------------
/website/mapData.js:
--------------------------------------------------------------------------------
1 | /* Copyright 2014 Jeremie Roy. All rights reserved.
2 | * License: http://www.opensource.org/licenses/BSD-2-Clause
3 | */
4 | var EveStaticData = function() {
5 |
6 | var factions_url = 'data/factions.json';
7 | var regions_KS_url = 'data/region_KS.json';
8 |
9 | var StaticData = {
10 | factions:[],
11 | regions:[],
12 | systems:[]
13 | };
14 |
15 | function loadData(onDataLoaded)
16 | {
17 | d3.json(factions_url, onFactionsLoaded);
18 |
19 | function onFactionsLoaded (error, json) {
20 | //console.log("onFactionsLoaded: " + error);
21 | for(var i=0, l=json.factions.length; i maxX ) maxX = system.x;
146 | if(system.y < minY ) minY = system.y;
147 | if(system.y > maxY ) maxY = system.y;
148 | for(var j=0, k = system.links.length; j 0);
226 | var newLocal = false;
227 | var newLocalStatus = false;
228 | var newTracker = false;
229 |
230 | if(last_intel_time_str != json.serverTime){
231 | last_intel_time_str = json.serverTime;
232 | last_intel_time = parse_date(last_intel_time_str);
233 | }
234 |
235 | if (local_system_id != json.system_id){
236 | local_system_id = json.system_id;
237 | newLocal = true;
238 | newLocalStatus = true;
239 | }
240 |
241 | json.intels.forEach(
242 | function (intel) {
243 | all_intels.push(intel);
244 | if(typeof(intel_by_system[intel.system_id]) === "undefined")
245 | {
246 | intel_by_system[intel.system_id] = intel;
247 | if( intel.system_id == local_system_id )
248 | {
249 | newLocalStatus = true;
250 | }
251 | }else
252 | {
253 | if( parse_date(intel_by_system[intel.system_id].seen_at) < parse_date(intel.seen_at) )
254 | {
255 | intel_by_system[intel.system_id] = intel;
256 | if( intel.system_id == local_system_id )
257 | {
258 | newLocalStatus = true;
259 | }
260 | }
261 | }
262 |
263 | }
264 | );
265 |
266 | //if(json.trackers.length>0)
267 | {
268 | newTracker = true;
269 | }
270 |
271 | if(newLocal)
272 | {
273 | api.on_local_change(local_system_id);
274 | }
275 | if(newLocalStatus)
276 | {
277 | api.on_local_status_change(intel_by_system[local_system_id]);
278 | }
279 | if(newIntel)
280 | {
281 | api.on_new_intel(json.intels);
282 | }
283 | if(newTracker)
284 | {
285 | api.on_tracker_change(json.trackers);
286 | }
287 |
288 | api.on_intel_update();
289 |
290 | //relaunch intel polling
291 | load_intel_timeout = setTimeout(load_intel, intel_polling_time);
292 | }
293 | );
294 | }
295 |
296 | function update_local_hostile() {
297 | var xhr = new XMLHttpRequest();
298 | xhr.open("GET", send_intel_hostile_url, true);
299 | xhr.onload = load_intel;
300 | xhr.send();
301 | }
302 |
303 | function update_local_clear() {
304 | var xhr = new XMLHttpRequest();
305 | xhr.open("GET", send_intel_clear_url, true);
306 | xhr.onload = load_intel;
307 | xhr.send();
308 | }
309 |
310 | var api = {
311 | // textbox to bind from the view who should contains potentials tracker elements
312 | tracker1Elem:null,
313 | tracker2Elem:null,
314 | tracker3Elem:null,
315 |
316 | // these event function can be replaced at will, if multiple occurs at the same time
317 | // they occurs in the same order as presented here
318 |
319 | //called whenever the local system change
320 | on_local_change:function(local_system_id){ console.log("local:"+local_system_id); },
321 | //called whenever the intel status of the local system change
322 | on_local_status_change:function(intel){ console.log("local:"+local_system_id+" at:"+intel.seen_at); },
323 | //called whenever a new list of intels arrives
324 | on_new_intel:function(intels){ console.log(intels); },
325 | //called whenever a tracker change
326 | on_tracker_change:function(trackers){ console.log(trackers); },
327 | //called whenever an update is received from server even if it is empty
328 | on_intel_update:function(){ },
329 |
330 | init:function(){
331 | load_intel();
332 | },
333 | get_server_time:function(){
334 | return last_intel_time;
335 | },
336 | get_local_system_id:function(){
337 | return local_system_id;
338 | },
339 | get_intel_by_system:function(system_id)
340 | {
341 | return intel_by_system[system_id];
342 | },
343 |
344 | //actions
345 | update_local_hostile:update_local_hostile,
346 | update_local_clear:update_local_clear
347 | };
348 |
349 | return api;
350 | }();
351 |
--------------------------------------------------------------------------------
/website/mapData.min.js:
--------------------------------------------------------------------------------
1 | var EveStaticData=function(){function r(d){function m(n,f){for(var e=0,k=f.regions.length;ea&&(a=h.x);h.yg&&(g=h.y);for(var l=0,u=h.links.length;lgetIntelByTime($_GET["last_update"]);
27 | }else{
28 | $intel_list = $db->getLastIntel();
29 | }
30 |
31 | $response = array();
32 | $response["error"] = false;
33 | $response["serverTime"] = date("Y-m-d H:i:s", time());
34 | $response["system_id"] = $local_system_id;
35 | //$response["system_name"] = $local_system_name;
36 |
37 | $response["intels"] = $intel_list;
38 |
39 |
40 | $trackers = array();
41 |
42 | if( isset($_GET["t1"]) && $_GET["t1"]!="")
43 | {
44 | $target_user = $db->getUser(trim($_GET["t1"]));
45 | if($target_user!=NULL)
46 | {
47 | $trackers["t1"] = $target_user["system_id"];
48 | }
49 | }
50 |
51 | if( isset($_GET["t2"]) && $_GET["t2"]!="")
52 | {
53 | $target_user = $db->getUser(trim($_GET["t2"]));
54 | if($target_user!=NULL)
55 | {
56 | $trackers["t2"] = $target_user["system_id"];
57 | }
58 | }
59 |
60 | if( isset($_GET["t3"]) && $_GET["t3"]!="")
61 | {
62 | $target_user = $db->getUser(trim($_GET["t3"]));
63 | if($target_user!=NULL)
64 | {
65 | $trackers["t3"] = $target_user["system_id"];
66 | }
67 | }
68 |
69 | $response["trackers"] = $trackers;
70 | echo_JSON(200, $response);
71 |
72 | ?>
--------------------------------------------------------------------------------
/website/services/send_intel.php:
--------------------------------------------------------------------------------
1 | updateIntel($local_system_id, $status, $user_token);
43 |
44 | $response = array();
45 | $response['error'] = false;
46 | $response['message'] = "Intel updated";
47 | echo_JSON(200, $response);
48 | ?>
--------------------------------------------------------------------------------