Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions apps/backend/modules/matchs/actions/actions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function executeReset(sfWebRequest $request)
$match->setStatus(0);
$match->setIngameEnable(NULL);
$match->setIsPaused(NULL);
// $match->setIp(null);
// $match->setIp(null);
// $match->setServer(null);
$match->save();
foreach ($match->getMaps() as $map) {
Expand Down Expand Up @@ -368,7 +368,8 @@ public function executeMatchsInProgress(sfWebRequest $request)
$table = MatchsTable::getInstance();
$this->pager = null;
$this->pager = new sfDoctrinePager(
'Matchs', 12
'Matchs',
12
);
$this->pager->setQuery($query->andWhere("status >= ? AND status <= ?", array(Matchs::STATUS_NOT_STARTED, Matchs::STATUS_END_MATCH))->orderBy("enable DESC, status DESC"));
$this->pager->setPage($request->getParameter('page', 1));
Expand Down Expand Up @@ -396,7 +397,8 @@ public function executeMatchsArchived(sfWebRequest $request)
$table = MatchsTable::getInstance();
$this->pager = null;
$this->pager = new sfDoctrinePager(
'Matchs', 12
'Matchs',
12
);
$this->pager->setQuery($query->andWhere("status = ?", Matchs::STATUS_ARCHIVE)->orderBy("id DESC"));
$this->pager->setPage($request->getParameter('page', 1));
Expand Down Expand Up @@ -526,6 +528,7 @@ public function executeDuplicate(sfWebRequest $request)
$newMatch->config_full_score = $match->config_full_score;
$newMatch->config_ot = $match->config_ot;
$newMatch->config_streamer = $match->config_streamer;
$newMatch->config_ready_on_halftime = $match->config_ready_on_halftime;
$newMatch->config_knife_round = $match->config_knife_round;
$newMatch->config_password = $match->config_password;
$newMatch->map_selection_mode = $match->map_selection_mode;
Expand Down Expand Up @@ -788,7 +791,8 @@ public function executeMatchsActions(sfWebRequest $request, $match = null)
$result[] = array("label" => "End Knife", "action" => "forceknifeend", "type" => "doRequest");
} else if (in_array($match->getStatus(), array(Matchs::STATUS_WU_1_SIDE, Matchs::STATUS_WU_2_SIDE, Matchs::STATUS_WU_OT_1_SIDE, Matchs::STATUS_WU_OT_2_SIDE))) {
$result[] = array("label" => "End warmup / halftime", "action" => "forcestart", "type" => "doRequest");
} else if ($match->getStatus() == Matchs::STATUS_FIRST_SIDE ||
} else if (
$match->getStatus() == Matchs::STATUS_FIRST_SIDE ||
$match->getStatus() == Matchs::STATUS_SECOND_SIDE ||
$match->getStatus() == Matchs::STATUS_OT_FIRST_SIDE ||
$match->getStatus() == Matchs::STATUS_OT_SECOND_SIDE
Expand Down Expand Up @@ -878,6 +882,7 @@ public function executeToornamentImport(sfWebRequest $request)
}
$match->config_full_score = false;
$match->config_streamer = false;
$match->config_ready_on_halftime = false;
$match->config_knife_round = true;
$match->identifier_id = $identifier;

Expand All @@ -901,16 +906,19 @@ public function executeToornamentImport(sfWebRequest $request)

$match->save();

return $this->renderText(json_encode(array(
return $this->renderText(json_encode(
array(
"status" => true,
"matchId" => $match->getId())
"matchId" => $match->getId()
)
));
}
}
} catch (\Exception $e) {
return $this->renderText(json_encode(array(
"status" => false,
"error" => "apiError")));
"error" => "apiError"
)));
}
}

Expand Down Expand Up @@ -985,7 +993,8 @@ public function executeExport(sfWebRequest $request)
'result' => $round->getTeamWin() == 'a' ? 1 : 3,
'side' => $sideA,
'players' => array()
), array(
),
array(
'number' => 2,
'result' => $round->getTeamWin() == 'b' ? 1 : 3,
'side' => $sideB,
Expand Down
33 changes: 18 additions & 15 deletions config/doctrine/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ Matchs:
config_full_score: { type: boolean }
config_ot: { type: boolean }
config_streamer: { type: boolean }
config_ready_on_halftime: { type: boolean }
config_knife_round: { type: boolean }
config_switch_auto: { type: boolean }
config_auto_change_password: { type: boolean }
config_password: { type: varchar(50) }
config_heatmap: { type: boolean }
config_authkey: { type: varchar(200) }
enable: { type: boolean }
map_selection_mode: { type: enum, values: [ bo2, bo3_modea, bo3_modeb, normal ]}
map_selection_mode: { type: enum, values: [bo2, bo3_modea, bo3_modeb, normal] }
ingame_enable: { type: boolean }
current_map: { type: integer(20) }
force_zoom_match: { type: boolean }
Expand All @@ -54,9 +55,9 @@ Maps:
map_name: { type: varchar(50) }
score_1: { type: integer(5) }
score_2: { type: integer(5) }
current_side: { type: enum, values: [ ct, t ] }
current_side: { type: enum, values: [ct, t] }
status: { type: integer(3) }
maps_for: { type: enum, values: [ default, team1, team2 ]}
maps_for: { type: enum, values: [default, team1, team2] }
nb_ot: { type: integer(20) }
identifier_id: { type: integer(20) }
tv_record_file: { type: varchar(255) }
Expand All @@ -69,7 +70,7 @@ MapsScore:
columns:
id: { primary: true, type: integer(20), autoincrement: true }
map_id: { type: integer(20), notnull: true }
type_score: { type: enum, values: [ normal, ot ] }
type_score: { type: enum, values: [normal, ot] }
score1_side1: { type: integer(5) }
score1_side2: { type: integer(5) }
score2_side1: { type: integer(5) }
Expand All @@ -85,11 +86,11 @@ Players:
match_id: { type: integer(20), notnull: true }
map_id: { type: integer(20), notnull: true }
player_key: { type: varchar(255) }
team: { type: enum, values: [ a,b,other], default: other}
team: { type: enum, values: [a, b, other], default: other }
ip: { type: varchar(255) }
steamid: { type: varchar(255) }
first_side: { type: enum, values: [ ct, t, other ] }
current_side: { type: enum, values: [ ct, t, other ] }
first_side: { type: enum, values: [ct, t, other] }
current_side: { type: enum, values: [ct, t, other] }
pseudo: { type: varchar(255) }
nb_kill: { type: integer(5), default: 0 }
assist: { type: integer(5), default: 0 }
Expand Down Expand Up @@ -122,8 +123,8 @@ PlayersSnapshot:
id: { primary: true, type: integer(20), autoincrement: true }
player_id: { type: integer(20), notnull: true }
player_key: { type: varchar(255) }
first_side: { type: enum, values: [ ct, t, other ] }
current_side: { type: enum, values: [ ct, t, other ] }
first_side: { type: enum, values: [ct, t, other] }
current_side: { type: enum, values: [ct, t, other] }
nb_kill: { type: integer(5), default: 0 }
assist: { type: integer(5), default: 0 }
death: { type: integer(5), default: 0 }
Expand Down Expand Up @@ -175,12 +176,14 @@ RoundSummary:
bomb_planted: { type: boolean }
bomb_defused: { type: boolean }
bomb_exploded: { type: boolean }
win_type: { type: enum, values: [ bombdefused, bombeexploded, normal, saved], default: normal }
team_win: { type: enum, values: [ a, b ]}
win_type: { type: enum, values: [bombdefused, bombeexploded, normal, saved], default: normal }
team_win: { type: enum, values: [a, b] }
ct_win: { type: boolean }
t_win: { type: boolean }
score_a: { type: integer(2)}
score_b: { type: integer(2)}
score_a: { type: integer(2) }
score_b: { type: integer(2) }
side_a: { type: enum, values: [ct, t] }
side_b: { type: enum, values: [ct, t] }
best_killer: { type: integer(20) }
best_killer_nb: { type: integer(5) }
best_killer_fk: { type: boolean }
Expand Down Expand Up @@ -291,9 +294,9 @@ TeamsInSeasons:
actAs:
Timestampable: ~
columns:
id: { primary: true, type: integer(20), autoincrement: true }
id: { primary: true, type: integer(20), autoincrement: true }
season_id: { type: integer(20) }
team_id: { type: integer(20) }
relations:
Seasons: { class: Seasons, onDelete: CASCADE, local: season_id, foreign: id }
Teams: { class: Teams, onDelete: CASCADE, local: team_id, foreign: id }
Teams: { class: Teams, onDelete: CASCADE, local: team_id, foreign: id }
Loading