1
1
<?php
2
2
include ("getid3/getid3.php " );
3
- // $fileName = '1196084 Usada Pekora - Discommunication Alien .osz';
3
+ // $fileName = '404318 Waterflame - Electroman Adventures .osz';
4
4
$ fileName = $ _GET ["fileName " ];
5
- // $chart = 'Usada Pekora - Discommunication Alien (LLENN- ) [Easy ]';
5
+ // $chart = 'Waterflame - Electroman Adventures (rinaldi28 ) [EZ ]';
6
6
$ chart = $ _GET ["chart " ];
7
7
echo $ fileName ;
8
8
echo $ chart ;
9
9
$ file = "./tmp/ " . $ fileName ;
10
10
$ zip = new ZipArchive ;
11
11
$ res = $ zip ->open ($ file );
12
- $ AudioLeadIn = 0 ;
12
+ $ audioLeadIn = 0 ;
13
13
if ($ res === TRUE ) {
14
14
$ result = file ('zip:// ' . realpath ($ file ) . '# ' . $ chart . '.osu ' );
15
15
$ result_GC = file_get_contents ('zip:// ' . realpath ($ file ) . '# ' . $ chart . '.osu ' );
34
34
}
35
35
if (trim ($ tempExplodeVar [0 ]) == 'AudioLeadIn ' )
36
36
{
37
- $ AudioLeadIn = trim (end ($ tempExplodeVar ));
37
+ $ audioLeadIn = trim (end ($ tempExplodeVar ));
38
38
}
39
39
}
40
40
}
48
48
49
49
$ numLists = interpret_numbers_list ($ noteData );
50
50
// print_r($numLists[0][0]);
51
- handle_number_lists ($ numLists );
51
+ handle_number_lists ($ numLists, $ audioLeadIn );
52
52
// print_r($GLOBALS[0]);
53
53
$ outputdata = format_output_lines ();
54
54
// file_put_contents('output.txt', print_r($outputdata, true));
@@ -92,8 +92,8 @@ function handle_first_number($num) {
92
92
break ;
93
93
}
94
94
}
95
- function handle_third_number ($ num ) {
96
- write_to_line (1 , strval ($ num + intval ($ AudioLeadIn )));
95
+ function handle_third_number ($ num, $ audioLeadIn ) {
96
+ write_to_line (1 , strval ($ num + intval ($ audioLeadIn )));
97
97
}
98
98
function handle_fourth_and_fifth_number ($ third_num ,$ fourth_num ,$ sixth_num ) {
99
99
if (($ fourth_num == 128 )) {
@@ -104,10 +104,10 @@ function handle_fourth_and_fifth_number($third_num,$fourth_num,$sixth_num) {
104
104
}
105
105
}
106
106
107
- function handle_number_lists ($ numLists ) {
107
+ function handle_number_lists ($ numLists, $ audioLeadIn ) {
108
108
foreach ($ numLists as $ numList ) {
109
109
handle_first_number ($ numList [0 ]);
110
- handle_third_number ($ numList [2 ]);
110
+ handle_third_number ($ numList [2 ], $ audioLeadIn );
111
111
handle_fourth_and_fifth_number ($ numList [2 ], $ numList [3 ], $ numList [5 ]);
112
112
}
113
113
}
0 commit comments