Small changes
This commit is contained in:
parent
e702bd61b4
commit
53941abebd
@ -41,7 +41,7 @@ class LobbieActor(hostUser: LobbyUser) extends Actor with LazyLogging {
|
||||
|
||||
private var status: LobbyStatus = NotStarted()
|
||||
|
||||
private var lobbyType: LobbyType = Last3()
|
||||
private var lobbyType: LobbyType = LooserPick()
|
||||
|
||||
private val mapsLobby: Set[DeciderMap] = {
|
||||
val configMaps = config.getStringList("maps").asScala
|
||||
|
||||
BIN
app/assets/images/maps/4p_imperial_area.jpg
Normal file
BIN
app/assets/images/maps/4p_imperial_area.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
@ -89,6 +89,8 @@
|
||||
"4p_van_de_mar_mountains": "Van de Mar Mountains (4)",
|
||||
"4p_sands_of_victory":"Sands of Victory (4)",
|
||||
"4p_antiga_bay":"Antiga Bay (4)",
|
||||
"4p_testcake":"Testcake [Rem] (4)",
|
||||
"4p_imperial_area":"Imperial Area [Ed] (4)",
|
||||
"4p_volcanic_reaction": "Volcanic Reaction (4)",
|
||||
"4p_broken_lands": "Broken Lands (4)",
|
||||
"5p_vyasastan": "Vyasastan (5)",
|
||||
|
||||
@ -38,10 +38,10 @@ window.onload = function() {
|
||||
var lobbiesAsTableRows = _.reduce(this.lobbies, function (memo, lobby) {
|
||||
|
||||
var joinButton = (lobby.status === "NotStarted()") ? '<button class="btn btn-primary join-as-player" onclick="joinDecider(\''+lobby.lobbyActorName+'\')">' +
|
||||
'<img src="assets/images/buttons/isAuto.png" style="height: 25px;"> Join lobby <img src="assets/images/buttons/isAuto.png" style="height: 25px;">' +
|
||||
'<img src="/assets/images/buttons/isAuto.png" style="height: 25px;"> Join lobby <img src="/assets/images/buttons/isAuto.png" style="height: 25px;">' +
|
||||
'</button>' : "";
|
||||
var observerButton = '<button class="btn btn-success join-as-observer" onclick="observerDecider(\''+lobby.lobbyActorName+'\')">' +
|
||||
'<img src="assets/images/buttons/Ulthwe.png" style="height: 25px;"> Observer <img src="assets/images/buttons/Ulthwe.png" style="height: 25px;">' +
|
||||
'<img src="/assets/images/buttons/Ulthwe.png" style="height: 25px;"> Observer <img src="/assets/images/buttons/Ulthwe.png" style="height: 25px;">' +
|
||||
'</button>';
|
||||
|
||||
return memo + '<tr>\n' +
|
||||
@ -118,12 +118,12 @@ window.onload = function() {
|
||||
message = JSON.parse(event.data);
|
||||
switch (message.type) {
|
||||
case "refreshLobby":
|
||||
renderMaps(message.lobby.maps);
|
||||
renderMaps(message.lobby.maps, message.lobby.status);
|
||||
renderPlayersAndStats(message.lobby);
|
||||
break;
|
||||
case "switchToLobby":
|
||||
console.log(message);
|
||||
switchToLobby(message.lobby.maps);
|
||||
switchToLobby(message.lobby.maps, message.lobby.status);
|
||||
renderPlayersAndStats(message.lobby);
|
||||
break;
|
||||
case "sendMessage":
|
||||
@ -180,9 +180,9 @@ function changeNick() {
|
||||
|
||||
// -----ф-ии прихода с сервера
|
||||
|
||||
function switchToLobby(maps) {
|
||||
function switchToLobby(maps, status) {
|
||||
console.log(maps);
|
||||
renderMaps(maps);
|
||||
renderMaps(maps, status);
|
||||
$("#lobbies").hide();
|
||||
$(".navbar").hide();
|
||||
$("#decider").show();
|
||||
@ -199,7 +199,7 @@ function disconnectLobby(error) {
|
||||
alert(error);
|
||||
}
|
||||
|
||||
function renderMaps(maps) {
|
||||
function renderMaps(maps, lobbyStatus) {
|
||||
var resHtml = "";
|
||||
|
||||
_.each(maps, function (map) {
|
||||
@ -210,8 +210,9 @@ function renderMaps(maps) {
|
||||
banHtml = "<div class = 'banX'>✕</div>";
|
||||
banClass = "bannedMap";
|
||||
}
|
||||
|
||||
|
||||
if(lobbyStatus === "NotStarted()"){
|
||||
banClass = "bannedMap";
|
||||
}
|
||||
|
||||
resHtml = resHtml + '<div class="col-xs-4 col-md-3 col-lg-2"><button class = "mapSelect" onmousedown="banMap(\''+map.map+'\')">'+
|
||||
'<div class="mapImageAndText '+banClass+'">' +
|
||||
@ -303,8 +304,8 @@ function renderPlayersAndStats(lobby) {
|
||||
disabledText = "disabled";
|
||||
}
|
||||
resHtml += "<br/><select class=\"form-control\" id = 'deciderOption' onChange='changeLobbyType()' "+disabledText+" >" +
|
||||
"<option "+last3Selected+" value = 'last3'>Play on last 3 maps</option>" +
|
||||
"<option "+last4Selected+" value = 'last4'>Play on last 4 maps</option>" +
|
||||
/*"<option "+last3Selected+" value = 'last3'>Play on last 3 maps</option>" +
|
||||
"<option "+last4Selected+" value = 'last4'>Play on last 4 maps</option>" +*/
|
||||
"<option "+looserPickSelected+" value = 'looserpick'>Decide first, then looserpick</option>" +
|
||||
"</select>"
|
||||
resHtml += "</div>";
|
||||
|
||||
87
app/assets/stylesheets/main.css
Normal file
87
app/assets/stylesheets/main.css
Normal file
@ -0,0 +1,87 @@
|
||||
|
||||
.readyImg{
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
#playerName{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.banX{
|
||||
font-size: 128px;
|
||||
margin-top: -174px;
|
||||
left: 34px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.bannedMap{
|
||||
-webkit-filter: grayscale(1); /* Webkit браузеры */
|
||||
}
|
||||
|
||||
.mapSelect{
|
||||
margin: 4px;
|
||||
position:relative;
|
||||
width: 175px;
|
||||
height: 155px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@keyframes glowing {
|
||||
0% {
|
||||
box-shadow: 0 0 2px #074673;
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 9px #0e87de;
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 2px #094d7d;
|
||||
}
|
||||
}
|
||||
|
||||
.warningButton {
|
||||
animation: glowing 1300ms infinite;
|
||||
}
|
||||
|
||||
#chat{
|
||||
width: 354px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#chatbox {
|
||||
text-align:left;
|
||||
margin:0 auto;
|
||||
margin-bottom:3px;
|
||||
padding:10px;
|
||||
background:#fff;
|
||||
height:200px;
|
||||
width:352px;
|
||||
border:1px solid #ACD8F0;
|
||||
overflow:auto; }
|
||||
|
||||
.inputMsg{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#usermsg {
|
||||
border: 1px solid #ACD8F0;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#exit{
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#mapList {
|
||||
border: 1px solid #0f0f0f;
|
||||
padding: 10px;
|
||||
background-color: #e3e3e3;
|
||||
}
|
||||
|
||||
#submit { width: 60px; }
|
||||
|
||||
.error { color: #ff0000; }
|
||||
|
||||
#menu { padding:12.5px 25px 12.5px 25px; }
|
||||
@ -1,145 +0,0 @@
|
||||
.perspective (@value) {
|
||||
-webkit-perspective: @value;
|
||||
-moz-perspective: @value;
|
||||
perspective: @value;
|
||||
}
|
||||
|
||||
.transform (@value) {
|
||||
-webkit-transform: rotateY(@value);
|
||||
-moz-transform: rotateY(@value);
|
||||
transform: rotateY(@value);
|
||||
}
|
||||
|
||||
.border-radius (@value) {
|
||||
-webkit-border-radius: @value;
|
||||
-moz-border-radius: @value;
|
||||
border-radius: @value;
|
||||
}
|
||||
|
||||
|
||||
#lobbies {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.flip-container {
|
||||
.perspective(1000);
|
||||
margin-bottom: 20px;
|
||||
&:hover .flipper {
|
||||
.transform(10deg);
|
||||
}
|
||||
&.flipped .flipper {
|
||||
.transform(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
.flipper {
|
||||
height: 250px;
|
||||
|
||||
background-color: #fafafa;
|
||||
border: 1px solid #ddd;
|
||||
|
||||
.border-radius(4px);
|
||||
|
||||
cursor: hand;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: 0.6s;
|
||||
-moz-transition: 0.6s;
|
||||
transition: 0.6s;
|
||||
|
||||
-webkit-transform-style: preserve-3d;
|
||||
-moz-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
|
||||
&:after {
|
||||
content: attr(data-content);
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
padding: 3px 7px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #ddd;
|
||||
color: #9da0a4;
|
||||
|
||||
.border-radius(4px 0 4px 0);
|
||||
}
|
||||
}
|
||||
|
||||
.readyImg{
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
#playerName{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.banX{
|
||||
font-size: 128px;
|
||||
margin-top: -174px;
|
||||
left: 34px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.bannedMap{
|
||||
-webkit-filter: grayscale(1); /* Webkit браузеры */
|
||||
}
|
||||
|
||||
.mapSelect{
|
||||
margin: 4px;
|
||||
position:relative;
|
||||
width: 175px;
|
||||
height: 155px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@keyframes glowing {
|
||||
0% {
|
||||
box-shadow: 0 0 2px #074673;
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 9px #0e87de;
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 2px #094d7d;
|
||||
}
|
||||
}
|
||||
.warningButton {
|
||||
animation: glowing 1300ms infinite;
|
||||
}
|
||||
|
||||
#chat{
|
||||
width: 354px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#chatbox {
|
||||
text-align:left;
|
||||
margin:0 auto;
|
||||
margin-bottom:3px;
|
||||
padding:10px;
|
||||
background:#fff;
|
||||
height:200px;
|
||||
width:352px;
|
||||
border:1px solid #ACD8F0;
|
||||
overflow:auto; }
|
||||
|
||||
.inputMsg{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#usermsg {
|
||||
border: 1px solid #ACD8F0;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
|
||||
#submit { width: 60px; }
|
||||
|
||||
.error { color: #ff0000; }
|
||||
|
||||
#menu { padding:12.5px 25px 12.5px 25px; }
|
||||
@ -8,6 +8,7 @@ import akka.pattern.ask
|
||||
import akka.stream._
|
||||
import akka.stream.scaladsl._
|
||||
import akka.util.Timeout
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import javax.inject._
|
||||
import org.reactivestreams.Publisher
|
||||
import play.api.libs.json._
|
||||
@ -28,9 +29,6 @@ class AdminController @Inject()(cc: ControllerComponents) extends AbstractContro
|
||||
// Use a direct reference to SLF4J
|
||||
private val logger = org.slf4j.LoggerFactory.getLogger("controllers.HomeController")
|
||||
|
||||
val lobbiesActror: ActorRef = actorSystem.actorOf(Props[LobbiesActor]())
|
||||
val userParentActor: ActorRef = actorSystem.actorOf(Props(classOf[UserParentActor], actorSystem))
|
||||
|
||||
// Home page that renders template
|
||||
def viewAllLobbies() = Action { implicit request =>
|
||||
logger.info(s"Received request from: ${request.remoteAddress}")
|
||||
@ -41,14 +39,9 @@ class AdminController @Inject()(cc: ControllerComponents) extends AbstractContro
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the value of the Origin header contains an acceptable value.
|
||||
*/
|
||||
def originMatches(origin: String): Boolean = {
|
||||
origin.contains("139.59.210.74") || origin.contains("localhost") || origin.contains("localhost:9000") || origin.contains("localhost:19001")
|
||||
def reloadConfig()= Action { implicit request =>
|
||||
ConfigFactory.invalidateCaches()
|
||||
logger.info("Config reloaded")
|
||||
Ok("Config reloaded")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
*/
|
||||
def sameOriginCheck(rh: RequestHeader): Boolean = {
|
||||
rh.headers.get("Origin") match {
|
||||
case Some(originValue) if originMatches(originValue) =>
|
||||
case Some(originValue) if originMatches(originValue, rh.remoteAddress) =>
|
||||
logger.debug(s"originCheck: originValue = $originValue")
|
||||
true
|
||||
|
||||
@ -88,7 +88,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
/**
|
||||
* Returns true if the value of the Origin header contains an acceptable value.
|
||||
*/
|
||||
def originMatches(origin: String): Boolean = {
|
||||
def originMatches(origin: String, remoteAddress: String): Boolean = {
|
||||
origin.contains("139.59.210.74") || origin.contains("localhost") || origin.contains("localhost:9000") || origin.contains("localhost:19001")
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<script type='text/javascript' src='@routes.Assets.at("lib/backbonejs/backbone.js")'></script>
|
||||
<script type="text/javascript" src="@routes.Assets.at("lib/jquery-cookie/jquery.cookie.js")"></script>
|
||||
|
||||
<script type='text/javascript' src='@routes.Assets.at("javascripts/index.js?020121")'></script>
|
||||
<script type='text/javascript' src='@routes.Assets.at("javascripts/index.js?040421")'></script>
|
||||
</head>
|
||||
<body data-ws-url="@routes.HomeController.ws.webSocketURL()">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
@ -23,6 +23,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div class ="container">
|
||||
<div id = "lobbies">
|
||||
@ -32,13 +34,14 @@
|
||||
</center><br/>
|
||||
<div id = "lobbiesList"></div>
|
||||
</div>
|
||||
|
||||
<div id = "decider" style="display:none">
|
||||
<button id = "exit" class="btn btn-primary">Exit</button>
|
||||
<br/>
|
||||
<div id = "mapList"></div>
|
||||
<div style="clear: both"></div>
|
||||
<div id = "mapList" class="container"></div>
|
||||
<div id = "playersStatsList"></div>
|
||||
<div id="chat">
|
||||
<br/>
|
||||
<div id="chatbox">
|
||||
</div>
|
||||
|
||||
@ -47,9 +50,18 @@
|
||||
<button type="submit" id="submitmsg" >Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<div><i><b>TournamentPatch Cup:</b><br/>
|
||||
Первая карта - десайдер, выбирается методом вычеркивания, далее лузерпики, повтор карт категорически запрещен.
|
||||
В суперфинале команда из сетки победителей начинает с +1 очком, но команда из сетки проигравших имеет лузерпик со старта встречи(десайдер в суперфинале не используется).<br/><br/>
|
||||
</i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
# https://www.playframework.com/documentation/latest/AllowedHostsFilter
|
||||
# Allow requests to localhost:9000.
|
||||
play.filters.hosts {
|
||||
allowed = ["localhost:9000", "localhost", "139.59.210.74"]
|
||||
allowed = ["localhost:9000", "localhost", "139.59.210.74", "*"]
|
||||
}
|
||||
play.http.secret.key="QCY?tAnfk?aZ?iwrNwnxIlR6CTf:123123Latabg@5241AB`R5W:1uDFN];Ik@n"
|
||||
play.server.http.port = 80
|
||||
|
||||
maps = ["2p_battle_marshes", "2p_fallen_city", "2p_fata_morgana_[Rem]", "2p_meeting_of_minds", "2p_deadly_fun_archeology", "2p_quests_triumph", "2p_shrine_of_excellion_[Rem]", "2p_titan_fall_[Rem]", "2p_tranquilitys_end_[rem]", "2p_blood_river_[Rem]", "2p_sugaroasis", "2p_emerald_river", "2p_fraziersdemise", "2p_vortex_plateau", "2p_chaos_gate"]
|
||||
maps = ["2p_battle_marshes", "2p_fallen_city", "2p_fata_morgana_[Rem]", "2p_meeting_of_minds", "2p_faceoff", "2p_quests_triumph", "2p_shrine_of_excellion_[Rem]", "2p_titan_fall_[Rem]", "2p_tranquilitys_end_[rem]", "2p_blood_river_[Rem]", "2p_sugaroasis", "2p_outer_reaches","2p_fraziersdemise"]
|
||||
|
||||
|
||||
@ -2,9 +2,11 @@
|
||||
# This file defines all application routes (Higher priority routes first)
|
||||
# ~~~~
|
||||
|
||||
GET / controllers.HomeController.index
|
||||
GET /tpmodcup controllers.HomeController.index
|
||||
GET /ws controllers.HomeController.ws
|
||||
|
||||
GET /reloadconfig controllers.AdminController.reloadConfig
|
||||
|
||||
GET /lobbyadmin controllers.AdminController.viewAllLobbies
|
||||
|
||||
# Map static resources from the /public folder to the /assets URL path
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user