7 # Copyright (C)2000-2002 Sony Online Entertainment Inc.
10 # Title: emailDataLint.pl
11 # Description: emails datalint generated client files to appropriate people
12 # @author $Author: gmcdaniel $
13 # @version $Revision: #4 $
18 #todo Once the command line parameter of where to drop the files is added I can move this script back out of the exe\win32 directory.
19 #todo Change the taskmanager to point to the new script location once above change happens.
20 #todo Email may not work unless client does not crash.
27 # This subroutine returns the current local date
31 ($day, $month, $year) = (localtime) [3,4,5];
34 $date = $month."/".$day."/".$year;
37 } # End of sub get_date
43 # This subroutine checks for warnings and errors in the datalint txt files. If there is an error it returns true otherwise it returns false.
44 # It takes the name of the txt file to check as input.
46 sub Check_Logfile_For_Warnings_and_Errors
49 $second_to_last_line = "current_line_2";
51 open (Logfile
,"C:\\$work_path\\swg\\test\\exe\\win32\\$_[0].txt") || die "Cannot open $_[0] for reading.";
55 $second_to_last_line = $_;
57 close (Logfile
) || die "can't close $_[0]";
61 if ($second_to_last_line eq "current_line_2")
63 print ("No warnings or fatals found in $_[0]\n");
69 print ("Warnings or errors found in $_[0]\n");
74 } # End of sub Check_Logfile_For_Warnings_and_Errors
80 # This subroutine checks for the existance of errors and fatals in the datalint logs. The logs are then sent to the appropriate people.
81 # It takes the name of the logfile to check and a string with the list if email addresses to mail if there are errors.
83 sub check_and_email_datalint_logs
86 $date_stamp = get_date
();
89 $Error = Check_Logfile_For_Warnings_and_Errors
($_[0]);
94 #Check size of file to see if it should be zipped or not
96 $LogFile="C:\\$work_path\\swg\\test\\exe\\win32\\$_[0].txt";
98 $sizeOfFile = $info->size;
100 if ($sizeOfFile < 512)
102 print ("Error or warning found in $_[0]. Emailing appropriate people.\n");
103 system ("c:\\postie\\postie -host:mail-sd.station.sony.com $_[1] -from:$gmcdaniel -s:\"[DataLint] Errors or Warnings in $_[0] $date_stamp\" -msg:\"Attached is $_[0] listing the asset warnings and errors as found by DataLint. Let me know if you have any questions. Thanks,Grant\" -a:c:\\$work_path\\swg\\test\\exe\\win32\\$_[0].txt");
108 print ("Error or warning found in $_[0]. Emailing appropriate people.\n");
109 print ("File to large to send, zipping");
110 system ("c:\\progra~1\\winzip\\wzzip.exe c:\\$work_path\\swg\\test\\exe\\win32\\$_[0].zip $LogFile");
111 system ("c:\\postie\\postie -host:mail-sd.station.sony.com $_[1] -from:$gmcdaniel -s:\"[DataLint] Errors or Warnings in $_[0] $date_stamp\" -msg:\"Attached is $_[0] listing the asset warnings and errors as found by DataLint. Let me know if you have any questions. Thanks,Grant\" -a:c:\\$work_path\\swg\\test\\exe\\win32\\$_[0].zip");
121 print ("No errors or warnings found in $_[0].");
122 system ("c:\\postie\\postie -host:mail-sd.station.sony.com $gmcdaniel -from:$gmcdaniel -s:\"[DataLint] $_[0] $date_stamp\" -nomsg -a:c:\\$work_path\\swg\\test\\exe\\win32\\$_[0].txt");
127 } # End of sub check_and_email_datalint_logs
135 ########## MAIN ##########
139 $work_path = "workpublish";
144 # Runs DataLintRspBuilder and DataLint
147 print ("Beginning DataLintRspBuilder...\n");
148 #system ("copy c:\\work\\swg\\test\\tools\\DataLintRspBuilder.exe c:\\$work_path\\swg\\test\\exe\\win32\\DataLintRspBuilder.exe");
149 #system ("c:\\$work_path\\swg\\test\\exe\\win32\\DataLintRspBuilder.exe c:\\$work_path\\swg\\test\\exe\\win32\\common.cfg");
150 print ("DataLintRspBuilder Complete\n");
155 print ("Beginning DataLint...\n");
156 #system ("c:\\$work_path\\swg\\test\\exe\\win32\\SwgClient_d.exe -- -s DataLint disable=0 -s SharedFoundation demo Mode=1");
157 print ("DataLint Complete\n");
162 ## End of Runs DataLintRspBuilder and DataLint
169 ## Check_For_Warnings_and_Errors
172 print ("Checking for errors and warnings...\n");
177 $gmcdaniel = "gmcdaniel\@soe.sony.com";
178 $jbrack = "jbrack\@soe.sony.com";
179 $jgrills = "jgrills\@soe.sony.com";
180 $asommers = "asommers\@soe.sony.com";
181 $cmayer = "cmayer\@soe.sony.com";
182 $jrodgers = "jrodgers\@soe.sony.com";
183 $jroy = "jroy\@soe.sony.com";
184 $jshoopack = "jshoopack\@soe.sony.com";
185 #$acastoro = "acastoro\@soe.sony.com";
186 $cbarnes = "cbarnes\@soe.sony.com";
187 $rkoster = "rkoster\@soe.sony.com";
188 $jdonham = "jdonham\@soe.sony.com";
189 $rvogel = "rvogel\@soe.sony.com";
190 $mhigby = "mhigby\@soe.sony.com";
191 $ssnopel = "ssnopel\@soe.sony.com";
192 $jwhisenant = "jwhisenant\@soe.sony.com";
196 $swo_leads = "-to:$cmayer -to:$asommers -to:$jgrills -to:$jrodgers -to:$jroy -to:$jshoopack -to:$cbarnes -to:$rkoster -cc:$gmcdaniel -cc:$jbrack -cc:$jdonham -cc:$rvogel -cc:$ssnopel -cc:$jwhisenant";
197 $prog_leads = "-to:$cmayer -to:$asommers -to:$jgrills -cc:$gmcdaniel -cc:$jbrack -cc:$ssnopel -cc:$jwhisenant";
198 $art_leads = "-to:$jrodgers -to:$jroy -to:$jshoopack -cc:$gmcdaniel -cc:$jbrack -cc:$ssnopel -cc:$jwhisenant";
199 $design_leads = "-to:$cbarnes -to:$rkoster -cc:$gmcdaniel -cc:$jbrack -cc:$ssnopel -cc:$jwhisenant";
200 $art_and_design_leads = "-to:$cbarnes -to:$rkoster -to:$jrodgers -to:$jroy -to:$jshoopack -cc:$gmcdaniel -cc:$jbrack -cc:$ssnopel -cc:$jwhisenant";
201 $qa_leads = "-to:$gmcdaniel -to:$ssnopel -to:$jwhisenant";
205 check_and_email_datalint_logs
("DataLint_Errors_All",$swo_leads);
207 check_and_email_datalint_logs
("DataLint_Errors_All_Fatal",$swo_leads);
209 check_and_email_datalint_logs
("DataLint_Errors_Appearance",$art_leads);
211 check_and_email_datalint_logs
("DataLint_Errors_ArrangementDescriptor",$art_and_design_leads);
213 check_and_email_datalint_logs
("DataLint_Errors_LocalizedStringTable",$design_leads);
215 check_and_email_datalint_logs
("DataLint_Errors_ObjectTemplate",$design_leads);
217 check_and_email_datalint_logs
("DataLint_Errors_PortalProperty",$art_leads);
219 check_and_email_datalint_logs
("DataLint_Errors_ShaderTemplate",$art_leads);
221 check_and_email_datalint_logs
("DataLint_Errors_SkyBox",$art_leads);
223 check_and_email_datalint_logs
("DataLint_Errors_SlotDescriptor",$art_and_design_leads);
225 check_and_email_datalint_logs
("DataLint_Errors_SoundTemplate",$prog_leads);
227 check_and_email_datalint_logs
("DataLint_Errors_Texture",$art_leads);
229 check_and_email_datalint_logs
("DataLint_Errors_TextureRenderer",$art_leads);
235 # Checks for content in DataLint_UnsupportedAssets.txt and sends appropriate email
236 #todo this should probably not be daily
238 $Logfile_to_check = "DataLint_UnsupportedAssets";
239 print ("Checking $Logfile_to_check for contents...\n");
240 $Error = Check_Logfile_For_Warnings_and_Errors
($Logfile_to_check);
243 if ($Error eq "true")
246 #Check size of file to see if it should be zipped or not
248 $LogFile="C:\\$work_path\\swg\\test\\exe\\win32\\$Logfile_to_check.txt";
249 $info=stat($LogFile);
250 $sizeOfFile = $info->size;
252 if ($sizeOfFile < 512)
254 print ("Contents found in $Logfile_to_check. Emailing appropriate people.\n");
255 system ("c:\\postie\\postie -host:mail-sd.station.sony.com $prog_leads -from:$gmcdaniel -s:\"Unsupported Assets in $Logfile_to_check $date_stamp\" -nomsg -a:c:\\$work_path\\swg\\test\\exe\\win32\\$Logfile_to_check.txt");
260 print ("Contents found in $Logfile_to_check. Emailing appropriate people.\n");
261 print ("File to large to send, zipping");
262 system ("c:\\progra~1\\winzip\\wzzip.exe c:\\$work_path\\swg\\test\\exe\\win32\\DataLint_UnsupportedAssets.zip $LogFile");
263 system ("c:\\postie\\postie -host:mail-sd.station.sony.com $prog_leads -from:$gmcdaniel -s:\"Unsupported Assets in $Logfile_to_check $date_stamp\" -nomsg -a:c:\\$work_path\\swg\\test\\exe\\win32\\$Logfile_to_check.zip");
272 print ("No contents in $Logfile_to_check.");
274 #todo Should eventually not email anyone with the results.
275 system ("c:\\postie\\postie -host:mail-sd.station.sony.com -to:$gmcdaniel -from:$gmcdaniel -s:\"$Logfile_to_check $date_stamp\" -nomsg -a:c:\\$work_path\\swg\\test\\exe\\win32\\$Logfile_to_check");
280 print ("End of errors and warnings check for DataLint files.\n");
284 ## End of Check_For_Warnings_and_Errors
292 ########## END OF MAIN ##########