diff --git a/controller_v_second.js b/controller_v_second.js index bace7e1..085f4f8 100644 --- a/controller_v_second.js +++ b/controller_v_second.js @@ -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; @@ -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; diff --git a/search.html b/search.html index be85627..c302010 100644 --- a/search.html +++ b/search.html @@ -56,6 +56,10 @@

КПП — {{vm.version}}

КПП — {{vm.version}}

+

Stalking

+ Room ID: + +

Search new Room