You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/app/GameMatchApiHandler.php
+238-3Lines changed: 238 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
namespaceApp;
4
4
5
-
useException;
6
-
useIlluminate\Http\Request;
7
-
useApp\MatchMaking;
8
5
useApp\EventTournament;
6
+
useApp\MatchMaking;
9
7
useApp\MatchReplay;
8
+
useException;
9
+
useIlluminate\Http\Request;
10
10
useIlluminate\Support\Facades\Storage;
11
11
useAuth;
12
12
@@ -18,6 +18,7 @@ public static function getGameMatchApiHandlerSelectArray()
18
18
"0" => "None",
19
19
"1" => "Get5",
20
20
"2" => "PugSharp",
21
+
"3" => "PugSharp 2v2",
21
22
);
22
23
return$return;
23
24
}
@@ -29,6 +30,8 @@ public function getGameMatchApiHandler($matchApiHandlerId): IGameMatchApiHandler
29
30
returnnewGet5MatchApiHandler();
30
31
case"2":
31
32
returnnewPugSharpMatchApiHandler();
33
+
case"3":
34
+
returnnewPugSharpMatchApiHandler2v2();
32
35
default:
33
36
thrownewException("MatchApiHandler \"" . GameMatchApiHandler::getGameMatchApiHandlerSelectArray()[$matchApiHandlerId] . "\" is not able to execute commands.");
34
37
}
@@ -534,3 +537,235 @@ public function uploaddemo(Request $request, MatchMaking $match = null, EventTou
534
537
returnfalse;
535
538
}
536
539
}
540
+
541
+
542
+
class PugSharpMatchApiHandler2v2 implements IGameMatchApiHandler
543
+
{
544
+
private$result;
545
+
546
+
publicfunction__construct()
547
+
{
548
+
$this->result = new \stdClass();
549
+
$this->result->maplist = array(
550
+
"de_rooftop",
551
+
"de_overpass",
552
+
"de_vertigo",
553
+
"de_nuke",
554
+
"de_inferno"
555
+
);
556
+
$this->result->max_rounds = 16;
557
+
$this->result->max_overtime_rounds = 6;
558
+
}
559
+
560
+
publicfunctiongetuserthirdpartyrequirements()
561
+
{
562
+
$return = array(
563
+
"thirdpartyid" => "steamid",
564
+
"thirdpartyname" => "steamname",
565
+
);
566
+
return$return;
567
+
}
568
+
569
+
publicfunctionaddteam($name)
570
+
{
571
+
if (!isset($this->result->team1)) {
572
+
$this->result->team1 = new \stdClass();
573
+
$this->result->team1->name = $name;
574
+
$this->result->team1->tag = $name;
575
+
} elseif (!isset($this->result->team2)) {
576
+
$this->result->team2 = new \stdClass();
577
+
$this->result->team2->name = $name;
578
+
$this->result->team2->tag = $name;
579
+
} else {
580
+
thrownewException("MatchApiHandler for PugSharp does not support more than 2 Teams!");
0 commit comments