@@ -43,14 +43,19 @@ router.post("/create", authenticate(), async (req, res) => {
4343 }
4444
4545 // 临时代码,处理 THUAI8 由于 hardcode 导致的 Buddhist 必须在 Monster 前面的 BUG
46+ const active_team_id = team_label_binds [ 0 ] . team_id ;
4647 if ( contest_name === "THUAI8" ) {
4748 const buddhistIndex = team_label_binds . findIndex (
4849 ( bind ) => bind . label === "Buddhist" ,
4950 ) ;
5051 const monsterIndex = team_label_binds . findIndex (
5152 ( bind ) => bind . label === "Monster" ,
5253 ) ;
53- if ( buddhistIndex !== - 1 && monsterIndex !== - 1 ) {
54+ if (
55+ buddhistIndex !== - 1 &&
56+ monsterIndex !== - 1 &&
57+ buddhistIndex > monsterIndex
58+ ) {
5459 const temp = team_label_binds [ buddhistIndex ] ;
5560 team_label_binds [ buddhistIndex ] = team_label_binds [ monsterIndex ] ;
5661 team_label_binds [ monsterIndex ] = temp ;
@@ -94,14 +99,14 @@ router.post("/create", authenticate(), async (req, res) => {
9499 console . debug ( "user_team_id: " , user_team_id ) ;
95100 if ( ! user_team_id ) {
96101 return res . status ( 403 ) . send ( "403 Forbidden: User not in team" ) ;
97- } else if ( user_team_id !== team_ids [ 0 ] ) {
102+ } else if ( user_team_id !== active_team_id ) {
98103 return res . status ( 403 ) . send ( "403 Forbidden: User not in team" ) ;
99104 }
100105 }
101106
102107 const active_rooms = await ContHasFunc . count_room_team (
103108 contest_id ,
104- team_ids [ 0 ] ,
109+ active_team_id ,
105110 ) ;
106111 console . debug ( "active_rooms: " , active_rooms ) ;
107112 if ( active_rooms > 6 ) {
0 commit comments