Skip to content

Commit

Permalink
Stalking
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgressoRU committed Jun 18, 2015
1 parent 43d2821 commit 698bb04
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 17 additions & 1 deletion controller_v_second.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ applicationKPP.controller('controllerVSecond', function ($http, $timeout, $inter
vm.newRooms = [];
vm.autoRefresh = true;
vm.maxPlayers = 1400;
vm.accountsSearch = [10098050, 133090071, 68758347];
vm.accountsSearch = [10098050, 133090071];
vm.is_start = false;
vm.lastRoomId = 45620;
vm.refreshTimeout = 10000;
vm.foundedRooms = [];
vm.stalkRoom = 0;

vm.start = function () {
vm.is_start = true;
Expand All @@ -30,6 +31,21 @@ applicationKPP.controller('controllerVSecond', function ($http, $timeout, $inter
vm.is_start = false;
};

vm.stalk = function () {
$http.post('./account_in_room.php', {
room_id: vm.stalkRoom,
account_id: vm.accountsSearch
}).then(function (response) {
if (!response.data.exists) {
var alert = new Audio('alert.mp3');
alert.play();
}
$timeout(function () {
vm.stalk();
}, 5000);
})
};

vm.searchNewRoom = function () {
if (!vm.is_start) {
return;
Expand Down
4 changes: 4 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ <h2>КПП — {{vm.version}}</h2>
<div data-ng-controller="controllerVSecond as vm">
<h2>КПП — {{vm.version}}</h2>

<H3>Stalking</H3>
Room ID: <input type="number" data-ng-model="vm.stalkRoom">
<button data-ng-click="vm.stalk()">PRESS ME!</button>

<h3>Search new Room</h3>
<button data-ng-click="vm.startSearch()">Start scan</button>
<button data-ng-click="vm.stop()">Stop scan</button>
Expand Down

0 comments on commit 698bb04

Please sign in to comment.