{"id":474736,"date":"2025-09-12T09:00:35","date_gmt":"2025-09-12T09:00:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=474736"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=474736","title":{"rendered":"<span>\u041d\u0430\u043f\u0435\u0440\u0434\u043e\u043b\u0438\u043b \u0446\u0435\u043b\u0443\u044e \u0438\u0433\u0440\u0443<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77f\/c84\/f13\/77fc84f13e57a4633e7ad14d61c12eac.png\" width=\"600\" height=\"599\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/77f\/c84\/f13\/77fc84f13e57a4633e7ad14d61c12eac.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77f\/c84\/f13\/77fc84f13e57a4633e7ad14d61c12eac.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0423\u0443\u0443\u0443, \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u0441\u043c\u0435\u0448\u043d\u043e\u0433\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a. \u0427\u0442\u043e\u0431\u044b \u043c\u0435\u043c\u043e\u0432 \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441 \u043f\u0430\u0446\u0430\u043d\u0430\u043c\u0438 \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c <strong>&#171;TANKOLINI NAPIERDOLKI&#187;<\/strong>.<\/p>\n<p>\u0421\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d, \u0442\u0435\u0442\u0440\u0438\u0441, \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0432\u0441\u0451 \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435, \u0441 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c\u0438, \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0430\u0441\u0441\u0435\u0442\u043e\u0432 \u0438 \u0434\u0432\u0438\u0436\u043a\u043e\u0432. Python \u043d\u0430 \u0431\u044d\u043a\u0435, PostgreSQL \u0434\u043b\u044f \u043a\u0430\u0440\u0442 \u0438 Redis \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u043d\u0430\u0442. \u041e\u0431\u043e \u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u2014 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h2>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b \u0444\u0440\u043e\u043d\u0442<\/h2>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e \u043f\u043e\u0447\u0435\u043c\u0443, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 \u0438\u0433\u0440\u0435, \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435. \u041d\u0430\u0447\u0430\u043b \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u2014 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">BackgroundBrick.prototype.render = function (context2d) {         \/\/ a + d + b + c + b + d + a = 2a + 2d + 2b + c = 2*7.5% + 2x5% + 2x10% + 55% = 100%         \/\/         \/\/      |------------------------------------------------|         \/\/      |    |-------------------------------------|     |         \/\/      |    |                                     |     |         \/\/      |    |       |----------------------|      |     |         \/\/  7.5%| 5% |  10%  |         55%          |  10% |  5% |7.5%         \/\/  ---&gt;|&lt;--&gt;|&lt;-----&gt;|&lt;--------------------&gt;|&lt;----&gt;|&lt;---&gt;|&lt;---         \/\/    a | d  |   b   |          c           |  b   |  d  | a         \/\/         \/\/ 2a - space between pixels         \/\/ b - outer border of pixel         \/\/ d - filled body rectangle         \/\/         \/\/ Center at the point (a + b + d + c\/2, a + b + d + c\/2)          if (this.color === colorScheme.regular) {             context2d.strokeStyle = elementColor.blockBorderColor;             context2d.fillStyle = elementColor.blockCenterFillingColor;          } else if (this.color === colorScheme.active) {             context2d.strokeStyle = elementColor.blockBorderColorActive;             context2d.fillStyle = elementColor.blockCenterFillingColorActive;          } else if (this.color === colorScheme.highlight) {             context2d.strokeStyle = elementColor.blockBorderColorActive;             context2d.fillStyle = elementColor.blockBorderColorHighlight;          } else if (this.color === colorScheme.highlightContrast) {             context2d.strokeStyle = elementColor.blockBorderColorHighlightContrast;             context2d.fillStyle = elementColor.blockBorderColorHighlightContrast;         }          let d = Math.trunc(this.__width*5\/100);         let b = Math.trunc(this.__width*10\/100);         let c = Math.trunc(this.__width*55\/100);         let a = (this.__width - 2*d - 2*b - c)\/2          let strokeWith = 2*d + 2*b + c;         context2d.lineWidth = d;         context2d.strokeRect(this.newX() + a, this.newY() + a, strokeWith, strokeWith);          let fillStart = a + d + b;         context2d.fillRect(this.newX() + fillStart, this.newY() + fillStart, c, c); }; <\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u043a\u0438\u0445 \u0447\u0451\u0440\u043d\u044b\u0445 \u0438 \u0437\u0435\u043b\u0451\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">TankFigure.prototype.render = function (context2d) {     context2d.translate(this.elementWidth()\/2, this.elementHeight()\/2);     context2d.rotate(this.direction);     context2d.translate(-this.elementWidth()\/2, -this.elementHeight()\/2)      let indicatorColor = this.friend ? this.color: colorScheme.regular;     let bricks = [         \/\/top        new BackgroundBrick(1, 0, this.__width, this.__height, this.color),          \/\/center         new BackgroundBrick(0, 1, this.__width, this.__height, this.color),         new BackgroundBrick(1, 1, this.__width, this.__height, this.color),         new BackgroundBrick(2, 1, this.__width, this.__height, this.color),          \/\/bottom         new BackgroundBrick(0, 2, this.__width, this.__height, this.color),         new BackgroundBrick(2, 2, this.__width, this.__height, this.color),     ];     if (this.friend) {         bricks.push(new BackgroundBrick(1, 2, this.__width, this.__height, indicatorColor))     }     bricks.forEach(function (pixel) {         pixel.render(context2d);     }.bind(this)); }<\/code><\/pre>\n<p>\u042d\u0442\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0436\u0435 \u0432 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445, \u0433\u0434\u0435 \u0442\u043e\u0447\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0430\u0448 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a, \u043a\u043e\u0438\u0445 \u0432 \u0438\u0433\u0440\u0435 50 \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 50 \u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435. \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043d\u043e\u0432\u0430 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u0433\u043b\u044b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0438\u0433\u0440\u0435.<\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u0433\u0440\u044b, \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441-\u0432\u043e\u0440\u043a\u0435\u0440\u0430\u0445. \u0418\u043d\u0430\u0447\u0435 \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043b\u0430\u0433\u0438. \u041e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0418\u0433\u0440\u043e\u0432\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u043b\u0435\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0443\u043b\u044c \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u0433\u0440\u044b. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u043e\u0432\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438 \u043e\u043d\u043e \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435, \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ \u0412\u044b\u0437\u043e\u0432 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u0430 page.engine.postMessage({     name: 'bulletStart',     params: [         message.data.user_id,         message.data.uid,         {             x: message.data.x,             y: message.data.y,             direction: rotationAngle[message.data.direction]         }     ] });  \/\/ \u0412\u044b\u0437\u043e\u0432 \u0438\u0437 \u0442\u0440\u0435\u0434\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 GameEngine.prototype.bulletStart = function (tankName, bulletName, positionCopy){     let tank = this.__tanks[tankName];      \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438     \/\/ ....      \/\/ \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u0430\u044f, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440     postMessage({         name: 'bulletAdd',         params: [bulletName, positionCopy]     });      setTimeout(this.bulletFly.bind(this), 50, newBullet); }  \/\/ \u0442\u0440\u0435\u0434 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Scene.prototype.bulletAdd = function (name, positionCopy) {     this.__bullets[name] = new BulletFigure(         positionCopy.x,         positionCopy.y,         this.blockWidth,         this.blockHeight     ); } \/\/ \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0435\u043d\u0434\u0435\u0440 \u043f\u043e requestAnimationFrame<\/code><\/pre>\n<h2>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442<\/h2>\n<p>\u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f <strong>Scene<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0438\u0441\u043e\u0432\u0430\u043b \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a6\/bf1\/e8a\/3a6bf1e8ad596815bd461bf40c6fed34.png\" alt=\"InGame Map Editor\" title=\"InGame Map Editor\" width=\"1684\" height=\"933\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3a6\/bf1\/e8a\/3a6bf1e8ad596815bd461bf40c6fed34.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a6\/bf1\/e8a\/3a6bf1e8ad596815bd461bf40c6fed34.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>InGame Map Editor<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u044b\u0439 \u0430\u0440\u0442 \u043f\u0440\u044f\u043c\u043e \u0432 \u0438\u0433\u0440\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0439.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/483\/b34\/776\/483b347766a080a845b17252be6e3621.png\" alt=\"Editor Prototype\" title=\"Editor Prototype\" width=\"818\" height=\"542\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/483\/b34\/776\/483b347766a080a845b17252be6e3621.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/483\/b34\/776\/483b347766a080a845b17252be6e3621.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Editor Prototype<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e, \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u0431\u0430\u0437\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u0435\u0447\u0435\u0440 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439, \u043f\u0440\u044f\u043c\u043e \u0432 Flask-Admin \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043a\u0430\u0440\u0442.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eee\/2d4\/6c1\/eee2d46c11c6d35df06c445c520e9a98.png\" alt=\"Flask-Admin GameMap Editor Widget\" title=\"Flask-Admin GameMap Editor Widget\" width=\"1191\" height=\"915\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/eee\/2d4\/6c1\/eee2d46c11c6d35df06c445c520e9a98.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eee\/2d4\/6c1\/eee2d46c11c6d35df06c445c520e9a98.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Flask-Admin GameMap Editor Widget<\/figcaption><\/div>\n<\/figure>\n<h2>\u0411\u0435\u043a\u0435\u043d\u0434 \u043d\u0430 FastAPI<\/h2>\n<p>\u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u044f \u043d\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0449\u0438\u043a, \u043c\u043e\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u0431\u044d\u043a\u0435\u043d\u0434. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0448\u0443 \u0435\u0433\u043e \u043d\u0430 Python. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, Python \u043d\u0435 \u0434\u0430\u0451\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u043b\u044e\u0441\u043e\u0432 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u2014 \u043b\u0443\u0447\u0448\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 C\/C++ \u0438\u043b\u0438 Rust, \u043d\u043e \u044f \u0434\u0432\u0438\u0433\u0430\u044e\u0441\u044c \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0430 \u0431\u044d\u043a\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0445\u043e\u0434 \u0438 \u043f\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Telegram), \u043f\u043b\u044e\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u044b. \u042f \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0440\u043e\u043c \u0434\u043e\u0431\u0440\u043e\u043c JSON. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0430\u0442\u044c \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443.<\/p>\n<p>\u0411\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u044f \u0432\u044b\u0431\u0440\u0430\u043b PostgreSQL \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u044e \u0438 \u043e\u043d\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a \u043a\u0430\u043a JSON-\u0444\u0430\u0439\u043b \u0438 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 Nginx.<\/p>\n<h2>\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0431\u044d\u043a\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432 PostgreSQL \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0438 \u0442. \u0434. \u2014 \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430. \u0420\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0451, \u043d\u043e \u0437\u0430\u0447\u0435\u043c?<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b Redis. \u041e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u0441\u0451 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0433\u043e\u043d\u043a\u0438, \u043d\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a: \u0441\u043e\u0431\u044b\u0442\u0438\u0435 (\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b) \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u041f\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u0432 \u043f\u0443\u0442\u0438\u00bb, \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<p>\u0421 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430\u043c\u0438 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0430 \u0432\u043e\u0442 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0410 \u043f\u043e\u043f\u0430\u043b \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0411, \u0435\u0441\u043b\u0438 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043d\u0433 20, \u0430 \u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e 80, \u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0438\u0434\u0438\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u0435\u0442? \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0432\u0438\u0434\u044f\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e: \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0433 \u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0443\u043b\u044c \u0438 \u00ab\u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u00bb \u043f\u0438\u043d\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443 \u0432\u0441\u0435\u0445 \u0431\u044b\u043b\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439. \u041d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u0433\u0440\u044b \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0449\u0438\u0439 \u043e\u0442 \u0447\u0438\u0442\u043e\u0432 \u2014 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 50% \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043a\u043e\u043c\u043d\u0430\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0410 \u043f\u043e\u043f\u0430\u043b \u0432 \u0411, \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a \u0438 \u0435\u0441\u0442\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0433\u043e\u043d\u043a\u0430. \u041d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 Lua-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 Redis. \u0418\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0435\u0439.<\/p>\n<pre><code class=\"lua\">local status = redis.call('get', '{bullet_status}');              if (status == '1') then   return nil; end;              local total_players = redis.call('hget', '{room_stats}', 'total_players');              if (total_players == false) then      total_players = 0; end;              local consensus_amount = total_players \/ 2;              if (consensus_amount &lt; 1) then   return nil; end;              redis.call('sadd', '{bullet_hits}', '{user_id}'); redis.call('expire', '{bullet_hits}', 60);              local confirmations = redis.call('scard', '{bullet_hits}');               if (confirmations &lt; consensus_amount) then   redis.call('set', '{bullet_status}', 0);   redis.call('expire', '{bullet_status}', 10);   return nil; end;              redis.call('set', '{bullet_status}', 1); redis.call('expire', '{bullet_status}', 10); redis.call('hset', '{room_players}', '{killer}', '{killer_data}');              return 1;       <\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>1<\/code>, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u044b\u043b \u0443\u0431\u0438\u0442, \u0438 <code>nil<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u044e\u0430\u043d\u0441\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0438\u0433\u0440\u0435 1 \u043d\u0430 1 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043e \u0441 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043f\u0438\u043d\u0433\u0435 \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 80 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0431\u0430\u0433\u0438: \u043b\u0438\u0431\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u043e\u043d\u043e \u0431\u044b\u043b\u043e, \u043b\u0438\u0431\u043e \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u2014 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043c, \u0433\u0434\u0435 \u0435\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u043a\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0443\u0441\u043f\u0435\u043b \u0432\u043b\u044e\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u043e\u0437\u0432\u0443\u0447\u043a\u0443 \u2014 \u0438 \u043f\u043e\u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0440\u043e\u0432\u0430\u043b, \u0438 \u043f\u043e\u0441\u043c\u0435\u044f\u043b\u0441\u044f.<\/p>\n<p>\u0421 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430 \u043e\u0434\u043d\u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435, \u043d\u043e \u0438 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>\u0412\u0440\u044f\u0434 \u043b\u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430\u0439\u0434\u0443\u0442 \u0437\u0434\u0435\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u2014 \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438\u043c \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u0435 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u041d\u043e \u044f \u043f\u0438\u0441\u0430\u043b \u044d\u0442\u043e \u0434\u043b\u044f \u043c\u043e\u043b\u043e\u0434\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0445\u043e\u0447\u0443 \u0432\u0441\u0435\u043b\u0438\u0442\u044c \u0432 \u043d\u0438\u0445 \u0438\u0441\u043a\u0440\u0443 \u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f: \u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 AI, \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0441\u043b\u0435\u043f\u0443\u044e \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u043d \u0432\u0430\u043c \u0432\u044b\u0434\u0430\u0451\u0442. \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u043d\u0438\u044f, \u0438\u043d\u0430\u0447\u0435 \u0441 AI \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u00ab\u043f\u0440\u043e\u043b\u0435\u0442\u0430\u0442\u044c \u043c\u0438\u043c\u043e \u0443\u0448\u0435\u0439\u00bb.<\/p>\n<p>\u0416\u0434\u0443 \u043e\u0442 \u0432\u0430\u0441 \u0442\u043e\u043d\u043d\u044b \u0445\u0435\u0439\u0442\u0430. \u041d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e\u0442\u0432\u0435\u0447\u0443. \u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0439\u0434\u0451\u0442 \u2014 \u043d\u0430\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p><a href=\"http:\/\/tankolini-napierdolki.com\/?t=1\" rel=\"noopener noreferrer nofollow\">http:\/\/tankolini-napierdolki.com\/?t=1<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/946222\/\"> https:\/\/habr.com\/ru\/articles\/946222\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0423\u0443\u0443\u0443, \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u0441\u043c\u0435\u0448\u043d\u043e\u0433\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a. \u0427\u0442\u043e\u0431\u044b \u043c\u0435\u043c\u043e\u0432 \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441 \u043f\u0430\u0446\u0430\u043d\u0430\u043c\u0438 \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c <strong>&#171;TANKOLINI NAPIERDOLKI&#187;<\/strong>.<\/p>\n<p>\u0421\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d, \u0442\u0435\u0442\u0440\u0438\u0441, \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0432\u0441\u0451 \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435, \u0441 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c\u0438, \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0430\u0441\u0441\u0435\u0442\u043e\u0432 \u0438 \u0434\u0432\u0438\u0436\u043a\u043e\u0432. Python \u043d\u0430 \u0431\u044d\u043a\u0435, PostgreSQL \u0434\u043b\u044f \u043a\u0430\u0440\u0442 \u0438 Redis \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u043d\u0430\u0442. \u041e\u0431\u043e \u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u2014 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h2>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b \u0444\u0440\u043e\u043d\u0442<\/h2>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e \u043f\u043e\u0447\u0435\u043c\u0443, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 \u0438\u0433\u0440\u0435, \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435. \u041d\u0430\u0447\u0430\u043b \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u2014 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">BackgroundBrick.prototype.render = function (context2d) {         \/\/ a + d + b + c + b + d + a = 2a + 2d + 2b + c = 2*7.5% + 2x5% + 2x10% + 55% = 100%         \/\/         \/\/      |------------------------------------------------|         \/\/      |    |-------------------------------------|     |         \/\/      |    |                                     |     |         \/\/      |    |       |----------------------|      |     |         \/\/  7.5%| 5% |  10%  |         55%          |  10% |  5% |7.5%         \/\/  ---&gt;|&lt;--&gt;|&lt;-----&gt;|&lt;--------------------&gt;|&lt;----&gt;|&lt;---&gt;|&lt;---         \/\/    a | d  |   b   |          c           |  b   |  d  | a         \/\/         \/\/ 2a - space between pixels         \/\/ b - outer border of pixel         \/\/ d - filled body rectangle         \/\/         \/\/ Center at the point (a + b + d + c\/2, a + b + d + c\/2)          if (this.color === colorScheme.regular) {             context2d.strokeStyle = elementColor.blockBorderColor;             context2d.fillStyle = elementColor.blockCenterFillingColor;          } else if (this.color === colorScheme.active) {             context2d.strokeStyle = elementColor.blockBorderColorActive;             context2d.fillStyle = elementColor.blockCenterFillingColorActive;          } else if (this.color === colorScheme.highlight) {             context2d.strokeStyle = elementColor.blockBorderColorActive;             context2d.fillStyle = elementColor.blockBorderColorHighlight;          } else if (this.color === colorScheme.highlightContrast) {             context2d.strokeStyle = elementColor.blockBorderColorHighlightContrast;             context2d.fillStyle = elementColor.blockBorderColorHighlightContrast;         }          let d = Math.trunc(this.__width*5\/100);         let b = Math.trunc(this.__width*10\/100);         let c = Math.trunc(this.__width*55\/100);         let a = (this.__width - 2*d - 2*b - c)\/2          let strokeWith = 2*d + 2*b + c;         context2d.lineWidth = d;         context2d.strokeRect(this.newX() + a, this.newY() + a, strokeWith, strokeWith);          let fillStart = a + d + b;         context2d.fillRect(this.newX() + fillStart, this.newY() + fillStart, c, c); }; <\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u043a\u0438\u0445 \u0447\u0451\u0440\u043d\u044b\u0445 \u0438 \u0437\u0435\u043b\u0451\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">TankFigure.prototype.render = function (context2d) {     context2d.translate(this.elementWidth()\/2, this.elementHeight()\/2);     context2d.rotate(this.direction);     context2d.translate(-this.elementWidth()\/2, -this.elementHeight()\/2)      let indicatorColor = this.friend ? this.color: colorScheme.regular;     let bricks = [         \/\/top        new BackgroundBrick(1, 0, this.__width, this.__height, this.color),          \/\/center         new BackgroundBrick(0, 1, this.__width, this.__height, this.color),         new BackgroundBrick(1, 1, this.__width, this.__height, this.color),         new BackgroundBrick(2, 1, this.__width, this.__height, this.color),          \/\/bottom         new BackgroundBrick(0, 2, this.__width, this.__height, this.color),         new BackgroundBrick(2, 2, this.__width, this.__height, this.color),     ];     if (this.friend) {         bricks.push(new BackgroundBrick(1, 2, this.__width, this.__height, indicatorColor))     }     bricks.forEach(function (pixel) {         pixel.render(context2d);     }.bind(this)); }<\/code><\/pre>\n<p>\u042d\u0442\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0436\u0435 \u0432 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445, \u0433\u0434\u0435 \u0442\u043e\u0447\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0430\u0448 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a, \u043a\u043e\u0438\u0445 \u0432 \u0438\u0433\u0440\u0435 50 \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 50 \u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435. \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043d\u043e\u0432\u0430 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u0433\u043b\u044b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0438\u0433\u0440\u0435.<\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u0433\u0440\u044b, \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441-\u0432\u043e\u0440\u043a\u0435\u0440\u0430\u0445. \u0418\u043d\u0430\u0447\u0435 \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043b\u0430\u0433\u0438. \u041e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0418\u0433\u0440\u043e\u0432\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u043b\u0435\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0443\u043b\u044c \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u0433\u0440\u044b. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u043e\u0432\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438 \u043e\u043d\u043e \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435, \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ \u0412\u044b\u0437\u043e\u0432 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u0430 page.engine.postMessage({     name: 'bulletStart',     params: [         message.data.user_id,         message.data.uid,         {             x: message.data.x,             y: message.data.y,             direction: rotationAngle[message.data.direction]         }     ] });  \/\/ \u0412\u044b\u0437\u043e\u0432 \u0438\u0437 \u0442\u0440\u0435\u0434\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 GameEngine.prototype.bulletStart = function (tankName, bulletName, positionCopy){     let tank = this.__tanks[tankName];      \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438     \/\/ ....      \/\/ \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u0430\u044f, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440     postMessage({         name: 'bulletAdd',         params: [bulletName, positionCopy]     });      setTimeout(this.bulletFly.bind(this), 50, newBullet); }  \/\/ \u0442\u0440\u0435\u0434 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Scene.prototype.bulletAdd = function (name, positionCopy) {     this.__bullets[name] = new BulletFigure(         positionCopy.x,         positionCopy.y,         this.blockWidth,         this.blockHeight     ); } \/\/ \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0435\u043d\u0434\u0435\u0440 \u043f\u043e requestAnimationFrame<\/code><\/pre>\n<h2>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442<\/h2>\n<p>\u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f <strong>Scene<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0438\u0441\u043e\u0432\u0430\u043b \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u0430\u0440\u0442.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>InGame Map Editor<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u044b\u0439 \u0430\u0440\u0442 \u043f\u0440\u044f\u043c\u043e \u0432 \u0438\u0433\u0440\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0439.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Editor Prototype<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e, \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u0431\u0430\u0437\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u0435\u0447\u0435\u0440 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439, \u043f\u0440\u044f\u043c\u043e \u0432 Flask-Admin \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043a\u0430\u0440\u0442.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Flask-Admin GameMap Editor Widget<\/figcaption><\/div>\n<\/figure>\n<h2>\u0411\u0435\u043a\u0435\u043d\u0434 \u043d\u0430 FastAPI<\/h2>\n<p>\u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u044f \u043d\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0449\u0438\u043a, \u043c\u043e\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u0431\u044d\u043a\u0435\u043d\u0434. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0448\u0443 \u0435\u0433\u043e \u043d\u0430 Python. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, Python \u043d\u0435 \u0434\u0430\u0451\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u043b\u044e\u0441\u043e\u0432 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u2014 \u043b\u0443\u0447\u0448\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 C\/C++ \u0438\u043b\u0438 Rust, \u043d\u043e \u044f \u0434\u0432\u0438\u0433\u0430\u044e\u0441\u044c \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0430 \u0431\u044d\u043a\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0445\u043e\u0434 \u0438 \u043f\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Telegram), \u043f\u043b\u044e\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u044b. \u042f \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0440\u043e\u043c \u0434\u043e\u0431\u0440\u043e\u043c JSON. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0430\u0442\u044c \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443.<\/p>\n<p>\u0411\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u044f \u0432\u044b\u0431\u0440\u0430\u043b PostgreSQL \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u044e \u0438 \u043e\u043d\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a \u043a\u0430\u043a JSON-\u0444\u0430\u0439\u043b \u0438 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 Nginx.<\/p>\n<h2>\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0431\u044d\u043a\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432 PostgreSQL \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0438 \u0442. \u0434. \u2014 \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430. \u0420\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0451, \u043d\u043e \u0437\u0430\u0447\u0435\u043c?<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b Redis. \u041e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u0441\u0451 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0433\u043e\u043d\u043a\u0438, \u043d\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a: \u0441\u043e\u0431\u044b\u0442\u0438\u0435 (\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b) \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u041f\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u0432 \u043f\u0443\u0442\u0438\u00bb, \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<p>\u0421 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430\u043c\u0438 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0430 \u0432\u043e\u0442 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0410 \u043f\u043e\u043f\u0430\u043b \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0411, \u0435\u0441\u043b\u0438 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043d\u0433 20, \u0430 \u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e 80, \u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0438\u0434\u0438\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u0435\u0442? \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0432\u0438\u0434\u044f\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e: \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0433 \u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0443\u043b\u044c \u0438 \u00ab\u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u00bb \u043f\u0438\u043d\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443 \u0432\u0441\u0435\u0445 \u0431\u044b\u043b\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439. \u041d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u0433\u0440\u044b \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0449\u0438\u0439 \u043e\u0442 \u0447\u0438\u0442\u043e\u0432 \u2014 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 50% \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043a\u043e\u043c\u043d\u0430\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0410 \u043f\u043e\u043f\u0430\u043b \u0432 \u0411, \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a \u0438 \u0435\u0441\u0442\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0433\u043e\u043d\u043a\u0430. \u041d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 Lua-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 Redis. \u0418\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0435\u0439.<\/p>\n<pre><code class=\"lua\">local status = redis.call('get', '{bullet_status}');              if (status == '1') then   return nil; end;              local total_players = redis.call('hget', '{room_stats}', 'total_players');              if (total_players == false) then      total_players = 0; end;              local consensus_amount = total_players \/ 2;              if (consensus_amount &lt; 1) then   return nil; end;              redis.call('sadd', '{bullet_hits}', '{user_id}'); redis.call('expire', '{bullet_hits}', 60);              local confirmations = redis.call('scard', '{bullet_hits}');               if (confirmations &lt; consensus_amount) then   redis.call('set', '{bullet_status}', 0);   redis.call('expire', '{bullet_status}', 10);   return nil; end;              redis.call('set', '{bullet_status}', 1); redis.call('expire', '{bullet_status}', 10); redis.call('hset', '{room_players}', '{killer}', '{killer_data}');             <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-474736","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/474736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=474736"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/474736\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=474736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=474736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=474736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}