You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(128) |
Jun
(97) |
Jul
(13) |
Aug
(40) |
Sep
(50) |
Oct
(27) |
Nov
(7) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(18) |
Feb
(47) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
|
Sep
(14) |
Oct
(22) |
Nov
|
Dec
|
From: <pan...@us...> - 2008-09-20 20:00:53
|
Revision: 361 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=361&view=rev Author: panzaboi Date: 2008-09-20 20:00:31 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Added new controllers. Added Paths: ----------- website/application/default/controllers/ArchieveController.php website/application/default/controllers/ErrorController.php Added: website/application/default/controllers/ArchieveController.php =================================================================== --- website/application/default/controllers/ArchieveController.php (rev 0) +++ website/application/default/controllers/ArchieveController.php 2008-09-20 20:00:31 UTC (rev 361) @@ -0,0 +1,11 @@ +<?php + +class ArchieveController extends Ostacium_Controller_Action +{ + public function indexAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + } +} + +?> \ No newline at end of file Added: website/application/default/controllers/ErrorController.php =================================================================== --- website/application/default/controllers/ErrorController.php (rev 0) +++ website/application/default/controllers/ErrorController.php 2008-09-20 20:00:31 UTC (rev 361) @@ -0,0 +1,36 @@ +<?php + +class ErrorController extends Ostacium_Controller_Action +{ + public function errorAction() + { + $errors = $this->_getParam('error_handler'); + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + + switch ($errors->type) { + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: + // 404 error -- controller or action not found + $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found'); + + $content =<<<EOH +<h1>Error!</h1> +<p>The page you requested was not found.</p> +EOH; + break; + default: + // application error + $content =<<<EOH +<h1>Error!</h1> +<p>An unexpected error occurred with your request. Please try again later.</p> +EOH; + break; + } + + // Clear previous content + $this->getResponse()->clearBody(); + $this->getResponse()->appendBody($content); + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2008-09-20 19:59:32
|
Revision: 360 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=360&view=rev Author: panzaboi Date: 2008-09-20 19:59:23 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Small fixes. Added 2nd language Modified Paths: -------------- website/library/Application.php website/library/Ostacium/Controller/Action.php Added Paths: ----------- website/lang/en.csv website/lang/uk.csv Modified: website/library/Application.php =================================================================== --- website/library/Application.php 2008-09-20 19:57:45 UTC (rev 359) +++ website/library/Application.php 2008-09-20 19:59:23 UTC (rev 360) @@ -38,7 +38,10 @@ $this->setupRoutes($frontController); $frontController->dispatch(); } - catch (Exception $e) {/*var_dump($e);*/} + catch (Exception $e) + { + //var_dump($e); + } } protected function _initialize() @@ -76,9 +79,9 @@ // Setup Error Handler $frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array( - 'module' => 'default', - 'controller' => 'error', - 'action' => 'error' + 'module' => $_config->auth->noacl->module, + 'controller' => $_config->auth->noacl->controller, + 'action' => $_config->auth->noacl->action ))); // Setup Languages @@ -196,11 +199,11 @@ $_config = Zend_Registry::get('config'); $_db = Zend_Registry::get('db'); - //$translate = new Zend_Translate('csv', $_config->lang->path . $_config->lang->default . '.csv', $_config->lang->default); - //$translate->addTranslation('path/to/other.csv', 'fr'); + $translate = new Zend_Translate('csv', $_config->lang->path . $_config->lang->default . '.csv', $_config->lang->default); + $translate->addTranslation($_config->lang->path . 'en.csv', 'en'); - //$translate->setLocale($_config->lang->default); - //Zend_Registry::set('Zend_Translate', $translate); + $translate->setLocale($_config->lang->default); + Zend_Registry::set('Zend_Translate', $translate); /**********************************************/ $user_messages = $_db->select()->from('messages')->query()->fetchAll(); Modified: website/library/Ostacium/Controller/Action.php =================================================================== --- website/library/Ostacium/Controller/Action.php 2008-09-20 19:57:45 UTC (rev 359) +++ website/library/Ostacium/Controller/Action.php 2008-09-20 19:59:23 UTC (rev 360) @@ -40,6 +40,7 @@ foreach ($params as $key => $value) { + if (is_array($value) || is_object($value)) continue; $from[] = ($key == 'controller' || $key == 'action' ? $value : $key . '-' . $value); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2008-09-20 19:57:50
|
Revision: 359 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=359&view=rev Author: panzaboi Date: 2008-09-20 19:57:45 +0000 (Sat, 20 Sep 2008) Log Message: ----------- New Design Incorporated Modified Paths: -------------- website/application/default/controllers/IndexController.php website/application/default/layouts/layout.phtml website/config/config.ini website/httpdocs/scripts/main.js website/httpdocs/styles/style.css Added Paths: ----------- website/httpdocs/images/ website/httpdocs/images/arrow.gif website/httpdocs/images/arrow2.gif website/httpdocs/images/b_find.gif website/httpdocs/images/logo.gif website/httpdocs/images/logod.gif Modified: website/application/default/controllers/IndexController.php =================================================================== --- website/application/default/controllers/IndexController.php 2008-09-20 19:56:01 UTC (rev 358) +++ website/application/default/controllers/IndexController.php 2008-09-20 19:57:45 UTC (rev 359) @@ -29,15 +29,8 @@ echo $form; return; } - - return $this->_redirect('/index/board'); } - public function boardAction() - { - $this->view->field = new Field(1); - } - protected function getLoginForm() { return new LoginForm(array( Modified: website/application/default/layouts/layout.phtml =================================================================== --- website/application/default/layouts/layout.phtml 2008-09-20 19:56:01 UTC (rev 358) +++ website/application/default/layouts/layout.phtml 2008-09-20 19:57:45 UTC (rev 359) @@ -6,14 +6,79 @@ <?= $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8') ?> <?= $this->headLink()->appendStylesheet('styles/style.css') ?> - <?= $this->headLink()->appendStylesheet('styles/ie6.css', 'screen', 'IE 6') ?> - <?= $this->headLink()->appendStylesheet('styles/ie7.css', 'screen', 'IE 7') ?> + <?= /*$this->headLink()->appendStylesheet('styles/ie6.css', 'screen', 'IE 6')*/'' ?> + <?= /*$this->headLink()->appendStylesheet('styles/ie7.css', 'screen', 'IE 7')*/'' ?> <?= $this->headScript()->appendFile('/scripts/main.js') ?> </head> <body> - <div id="wrapper"> - <?= $this->layout()->content ?> - </div> + <table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr bgcolor="#122a5b"> + <td><img height="43" src="images/logo.gif" width="490"></td> + </tr> + <tr bgcolor="#e1e1e1"> + <td><img height=26 src="images/logod.gif" width="490"></td> + </tr> + <tr> + <td bgcolor=#122a5b colspan=2><img height=2 src="images/0.gif" width=1></td> + </tr> + </table> + <table border=0 cellpadding=0 cellspacing=0 width="100%" summary="" height="20%"> + <tr> + <td bgcolor=#e1e1e1 valign=top width="200"> + <table width="100%" border="0" cellpadding="0" cellspacing="5"> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/about">Що це за проект</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/rule">Правила</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="archieve/problemset">Набір завдань</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="archieve/submit">Протестувати Розв'язок</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="archieve/results">Результати Тестувань</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="archieve/ranks">Рейтинг Учасників</a></td></tr> + <tr><td><hr></td></tr> + <!--<tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="contests.php">Змагання</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="problemset.php">Завдання</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="monitor.php">Монітор</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="clar.php">Уточнення умов</a></td></tr>--> + </table> + + <table border=0 cellpadding=4 cellspacing=0 width="100%" summary=""> + <tr><td align=middle bgcolor=#122a5b><font color=#d4d0e2><b><small>вхід</small></b></font></td></tr> + <tr><td> + <form onsubmit="return checkform(this);" method="post" action="login.php?rid=45fed5d9b297f" style="margin:0"> + <input type="hidden" name="path" value="/"> + <table border=0 cellPadding=1 cellSpacing=0 summary="" width=100%> + <tr> + <td class=name nowrap><small><font color=#122a5b> логін:</font></small></td> + <td><input name=lgn style="height: 18px; width: 100px"></td> + <td> </td> + </tr> + <tr> + <td class=name nowrap><small><font color=#122a5b> пароль:</font></small></td> + <td><input name=pswd type=password style="height: 18px; width: 100px"></td> + <td><input name="login" src="images/b_find.gif" type="image"> + </tr> + </table> + </form> + +<CENTER><A href="register.php">Зареєструватись</a><BR><a href=createteam.php>Створити команду</a></CENTER> +</TABLE><TABLE border=0 cellPadding=4 cellSpacing=0 width="100%"> +<TR><TD align=middle bgColor=#122a5b> +<FONT color=#d4d0e2><B><SMALL>F.A.Q.</SMALL></B></FONT> +<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD><P>Мені здається що програма написана правильно, але система видає "Помилка під час виконання"... +<P>Якщо Ви використовуєте С++, і описали функцію void main(){...} - навіть якщо програма видасть +правильний результат, то система видасть "помилка під час виконання". Це пов'язано з тим, що +в такому випадку код завершення програми непердбачуваний, і практично ніколи небуває нульовим. +<BR>Для того, щоб програму Вам зарахувало (якщо все правильно), необхідно описувати основну +функцію як int main(){...} і обов'язково завершувати програму через return 0. +<TR><TD align=right><P><SMALL><A href="allfaq.php">[ Всі питання ]</p></SMALL></TABLE><TR><TD align=middle bgColor=#122a5b> +<FONT color=#d4d0e2> </FONT> +<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD align=center> + +</TABLE></TABLE><TD bgColor=#f4f3f8 vAlign=top height=100%><TABLE border=0 cellPadding=8 cellSpacing=1 width="100%"><TR><TD class=name vAlign=top width="100%"><TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"><TR><TD bgColor=#d0d4de class=name width=4><IMG height=18 src="" width=4><TD nowrap bgColor=#122a5b class=name width=*> <FONT color=#d4d0e2><B><SMALL>Про систему</B></SMALL></FONT><TD nowrap bgColor=#122a5b class=name align=right> <FONT color=#d4d0e2><B><SMALL> 20:26 19 березня 2007 року </B></SMALL></FONT></TABLE><?= $this->layout()->content ?></table></table> +<TABLE> +<TR vAlign=Bottom><TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" summary=""><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1><TR bgColor=#122a5b><TD class=copyright>© 2004-2005, <a class=copyrightlink href="mailto: ac...@ia..."><B><FONT COLOR="#d1d1d1">A-S</FONT>tudio</B></A><TD align=middle><TD align=right class=copyright><A class=copyrightlink href="http://www.acm.lviv.ua">ACM Контестер</A><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1></TABLE> </body> -</html> \ No newline at end of file +</html> + + + + Modified: website/config/config.ini =================================================================== --- website/config/config.ini 2008-09-20 19:56:01 UTC (rev 358) +++ website/config/config.ini 2008-09-20 19:57:45 UTC (rev 359) @@ -15,7 +15,7 @@ #auth.noauth.module = "default" auth.noauth.controller = "index" -auth.noauth.action = "login" +auth.noauth.action = "index" auth.noacl.module = "default" auth.noacl.controller = "error" @@ -30,7 +30,7 @@ lang.path = "lang/"; lang.default = "uk"; -title = "ACM" +title = "ACM Contester" titlesep = " - " [development: general] Property changes on: website/httpdocs/images/arrow.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: website/httpdocs/images/arrow2.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: website/httpdocs/images/b_find.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: website/httpdocs/images/logo.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: website/httpdocs/images/logod.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: website/httpdocs/scripts/main.js =================================================================== --- website/httpdocs/scripts/main.js 2008-09-20 19:56:01 UTC (rev 358) +++ website/httpdocs/scripts/main.js 2008-09-20 19:57:45 UTC (rev 359) @@ -0,0 +1 @@ +function checkForm(form){if(form.lgn.value.length<3){alert('Логін повинен мати як мінімум 3 символи!');return false;}} \ No newline at end of file Modified: website/httpdocs/styles/style.css =================================================================== --- website/httpdocs/styles/style.css 2008-09-20 19:56:01 UTC (rev 358) +++ website/httpdocs/styles/style.css 2008-09-20 19:57:45 UTC (rev 359) @@ -1,15 +1,124 @@ -* -{ - padding: 0; - margin: 0; +BODY { + BACKGROUND-COLOR: #ffffff; MARGIN: 0px } - -div#wrapper -{ - text-align: center; +BODY { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt } - -div#wrapper table#table -{ - margin: 0 auto; +TBODY { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +COL { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +COLGROUP { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +TD { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +P { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +DIV { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +TEXTAREA { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +INPUT { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +SELECT { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +OPTION { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif; FONT-SIZE: 8pt +} +SMALL { + FONT-SIZE: 7pt +} +FORM { + MARGIN: 0px +} +A { + COLOR: #999999; TEXT-DECORATION: none +} +A:link { + COLOR: #999999; TEXT-DECORATION: none +} +A:visited { + COLOR: #999999; TEXT-DECORATION: none +} +A:hover { + COLOR: #122a5b; TEXT-DECORATION: underline +} +A:active { + COLOR: #122a5b; TEXT-DECORATION: none +} +A.staticmenu { + COLOR: #000000; FONT-WEIGHT: bold +} +A.staticmenu:link { + COLOR: #000000; FONT-WEIGHT: bold +} +A.staticmenu:visited { + COLOR: #000000; FONT-WEIGHT: bold +} +A.staticmenu:hover { + COLOR: #000000; FONT-WEIGHT: bold +} +A.staticmenu:active { + COLOR: #000000; FONT-WEIGHT: bold +} +LI { + COLOR: #000000; FONT-FAMILY: verdana,arial,sans-serif +} +.copyright { + COLOR: #ffffff; FONT-SIZE: 7pt; PADDING-LEFT: 10px; PADDING-RIGHT: 10px +} +A.copyrightlink { + COLOR: #edf0fc; FONT-SIZE: 7pt; FONT-WEIGHT: bold +} +A.copyrightlink:link { + COLOR: #edf0fc +} +A.copyrightlink:visited { + COLOR: #edf0fc +} +A.copyrightlink:hover { + COLOR: #edf0fc +} +A.copyrightlink:active { + COLOR: #edf0fc +} +.division { + BACKGROUND: #122a5b +} +.error { + COLOR: #ff0000; FONT-WEIGHT: bold +} +.header { + BACKGROUND: #122a5b; COLOR: #d4d0e2; FONT-SIZE: 7pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: bold; LINE-HEIGHT: normal; PADDING-LEFT: 10px +} +.pager { +} +.tablefix { + WIDTH: 520px +} +.tablevar { + WIDTH: 100% +} +.theme { + BACKGROUND: #edf0fc +} +.themesub { + BACKGROUND: #f4f3f8 +} +.themeother { + BACKGROUND: #f4f3f8 +} +.wtuheaders { + BACKGROUND: none transparent scroll repeat 0% 0% +} +.date { } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2008-09-20 19:56:11
|
Revision: 358 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=358&view=rev Author: panzaboi Date: 2008-09-20 19:56:01 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Fixed routing problem, caused Exception. Modified Paths: -------------- website/library/Ostacium/Controller/Plugin/Router.php Modified: website/library/Ostacium/Controller/Plugin/Router.php =================================================================== --- website/library/Ostacium/Controller/Plugin/Router.php 2008-09-20 15:23:38 UTC (rev 357) +++ website/library/Ostacium/Controller/Plugin/Router.php 2008-09-20 19:56:01 UTC (rev 358) @@ -41,7 +41,7 @@ $request->setParam('message', 'nologin'); } else { - //$module = $this->_noacl['module']; + $module = $this->_noacl['module']; $controller = $this->_noacl['controller']; $action = $this->_noacl['action']; @@ -57,6 +57,12 @@ $response = $this->getResponse(); $response->setException($ee); + + $module = $this->_noacl['module']; + $controller = $this->_noacl['controller']; + $action = $this->_noacl['action']; + + $request->setDispatched(true); } else { throw $e; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-09-20 15:23:46
|
Revision: 357 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=357&view=rev Author: Oracle_ Date: 2008-09-20 15:23:38 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Added SEH, applied some changes to Details, fixed small bug with SecureType::SysCall. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -37,23 +37,31 @@ while (!f.EndOfStream) { string[] param=f.ReadLine().Split(' '); - switch (param[0]) + if (param.Length < 2) continue; + try { - case "CodeLimit:": CodeLimit = Convert.ToInt32(param[1]); break; - case "CompilationTimeLimit:": CompilationTimeLimit = Convert.ToInt32(param[1]); break; - case "MemoryLimit:": MemoryLimit = Convert.ToInt32(param[1]); break; - case "OutputLimit:": OutputLimit = Convert.ToInt32(param[1]); break; - case "RealTimeLimit:": RealTimeLimit = Convert.ToInt32(param[1]); break; - case "TimeLimit:": TimeLimit = Convert.ToInt32(param[1]); break; - case "MaxThreads:": MaxThreads = Convert.ToInt32(param[1]); break; - case "PerTestCount:": PerTestCount = Convert.ToInt32(param[1]); break; - case "InputName:": InputName = param[1]; break; - case "OutputName:": OutputName = param[1]; break; - case "PointFileName:": PointFileName = param[1]; break; - case "TestFolderName:": TestFolderName = param[1]; break; - case "Checker:": Checker = param[1]; break; - case "CheckPlugin:": CheckPlugin = param[1]; break; + switch (param[0]) + { + case "CodeLimit:": CodeLimit = Convert.ToInt32(param[1]); break; + case "CompilationTimeLimit:": CompilationTimeLimit = Convert.ToInt32(param[1]); break; + case "MemoryLimit:": MemoryLimit = Convert.ToInt32(param[1]); break; + case "OutputLimit:": OutputLimit = Convert.ToInt32(param[1]); break; + case "RealTimeLimit:": RealTimeLimit = Convert.ToInt32(param[1]); break; + case "TimeLimit:": TimeLimit = Convert.ToInt32(param[1]); break; + case "MaxThreads:": MaxThreads = Convert.ToInt32(param[1]); break; + case "PerTestCount:": PerTestCount = Convert.ToInt32(param[1]); break; + case "InputName:": InputName = param[1]; break; + case "OutputName:": OutputName = param[1]; break; + case "PointFileName:": PointFileName = param[1]; break; + case "TestFolderName:": TestFolderName = param[1]; break; + case "Checker:": Checker = param[1]; break; + case "CheckPlugin:": CheckPlugin = param[1]; break; + } } + catch (Exception e) + { + return false; + } } return true; } @@ -90,7 +98,16 @@ output = ""; if (File.Exists(pointname)) - points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + { + try + { + points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + } + catch (Exception e) + { + points = 1; + } + } else points = 1; } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -5,6 +5,18 @@ namespace Main { + public class TesterException : ApplicationException + { + public TesterException(string message) : base(message) { } + public TesterException() : base() { } + } + + public class IncorrectFileException : ApplicationException + { + public IncorrectFileException(string message) : base(message) { } + public IncorrectFileException() : base() { } + } + public class TestEnv { public string ProblemPath; @@ -18,23 +30,78 @@ { this.Source = Source; this.TempPath = Path.GetFullPath(TempPath); + if (!Directory.Exists(this.TempPath)) + Directory.CreateDirectory(this.TempPath); this.CompPath = Path.GetFullPath(CompPath); + if (!File.Exists(this.CompPath)) + throw new FileNotFoundException("Compiler file do not exists!"); this.ProblemPath = Path.GetFullPath(ProblemPath); + if (!Directory.Exists(this.ProblemPath)) + throw new DirectoryNotFoundException("Problem path do not exists!"); } public void Compile() { - DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); - dat.Load(); - string[] InData=System.IO.File.ReadAllLines("TesterInData.txt"); - comp=new Compiler(CompPath,Source,TempPath,dat.CompilationTimeLimit,Convert.ToInt32(InData[0])); + if (comp == null) + { + if (!File.Exists(ProblemPath + "ProblemData.txt")) + throw new FileNotFoundException("ProblemData.txt do not exists"); + DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); + if (!dat.Load()) + throw new IncorrectFileException("Can not load data from ProblemData.txt"); + + if (!File.Exists("TesterInData.txt")) + throw new FileNotFoundException("TesterInData.txt do not exists"); + string[] InData = System.IO.File.ReadAllLines("TesterInData.txt"); + if (InData.Length < 1) + throw new IncorrectFileException("Can not load data from ProblemData.txt"); + int buf; + try + { + buf = Convert.ToInt32(InData[0]); + } + catch (Exception e) + { + throw new IncorrectFileException("Can not load sleep time from TesterInData.txt " + e.Message); + } + + comp = new Compiler(CompPath, Source, TempPath, dat.CompilationTimeLimit, buf); + } comp.Compile(); } - public void RunAllTests(SecureType SecType) + public void RunAllTests() { RunAllTests(SecureType.Double,true); } + public void RunAllTests(SecureType SecType) { RunAllTests(SecType,true); } + + public void RunAllTests(SecureType SecType, bool TestAll) { - run = new Runner(SecType,ProblemPath,comp.ExeFile,TempPath,comp.CONST_SLEEP); + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.TestAll = TestAll; run.RunTests(); } + + public void RunOneTest(int index) { RunOneTest(SecureType.Double,index); } + + public void RunOneTest(SecureType SecType, int index) + { + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.ExecuteTest(index); + } + + public void StopTesting() + { + if (run != null) + run.TerminateThreads(); + } } } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -13,7 +13,7 @@ { Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - for (int ind = 1; ind <= 18; ind++) + for (int ind = 1; ind <= 1; ind++) { string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); TestEnv test = new TestEnv(src, data[0], data[1], data[2]); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -1,4 +1,4 @@ -uses windows; +uses windows,math; var s:string; begin readln(s); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -1,4 +1,19 @@ -uses windows; +program Project2; + +{$APPTYPE CONSOLE} +uses Windows; + +type TMYPROC=procedure (x:Cardinal); stdcall; + +var h:HMODULE; +x:Pointer; begin -Sleep(100000); -end. \ No newline at end of file +h:=LoadLibraryExA('kernel32.dll',0,0); +x:=GetProcAddress(h,'Sleep'); +if (x<>nil) then +begin +TMyPROC(x)(10000000); +end else +writeln('ERROR!!!'); +FreeLibrary(h); +end. Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -2,5 +2,5 @@ {$APPTYPE CONSOLE} uses Windows; begin - MessageBox(GetDesktopWindow(),'Hello!','Hello',MB_OK); + MessageBox(0,'Hello!','Hello',MB_OK); end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,7 @@ +var a:array [1..10000000] of Integer; +x,y:integer; +begin +fillchar(a,0,sizeof(a)); +read(x,y); +write(x+y); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,8 @@ +program hello; +var a,b:integer; +ttt:text; +begin +assign(ttt,'ttt.txt'); +read(a,b); +write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,9 @@ +program hello; +var a,b:integer; +ttt:text; +begin + assign(ttt,'ttt.txt'); + rewrite(ttt); + read(a,b); + write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,9 @@ +program hello; +var a,b:integer; +ttt:text; +begin + assign(ttt,'C:\Documents and Settings\Pavlo\Desktop\ttt.txt'); + rewrite(ttt); + read(a,b); + write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,12 @@ +program hello; +uses windows; +var t:SystemTime; +begin +t.wYear:=1700; +t.wMonth:=2; +t.wDay:=3; +t.wHour:=3; +t.wMinute:=3; +t.wSecond:=3; +SetSystemTime(t); +end. \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -24,7 +24,12 @@ if (File::Exists(ExeFile)) //delete previsious source { File::Delete(ExeFile); - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for file to destroy + for (int i=0;i<CONST_SLEEP;i++) //waiting for file to destroy + { + if (!File::Exists(ExeFile)) + break; + System::Threading::Thread::Sleep(1); + } } si->RedirectStandardOutput=true; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -50,8 +50,16 @@ fwscanf(f,L"%d %s %s",&buf,&USER_NAME,&USER_PASSW); fclose(f); - SetUserObjectFullAccess( GetThreadDesktop(GetCurrentThreadId())); //needed for accessing from CreateProcessAsUser - SetUserObjectFullAccess( GetProcessWindowStation()); //needed for accessing from CreateProcessAsUser + if (!SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId()))) + { + Details="Cannot SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId())). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } + if (!SetUserObjectFullAccess( GetProcessWindowStation())) + { + Details="Cannot SetUserObjectFullAccess( GetProcessWindowStation()). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } USER_INFO_1 ui; NET_API_STATUS st; @@ -69,16 +77,16 @@ if (st==NERR_UserExists) userex=true; else { - Details="Cannot create user."; + Details="Cannot create user. Error#"+ToStr(GetLastError()); return false; } } if (!userex) { array<DriveInfo^>^ drv=DriveInfo::GetDrives(); - for (int i=0;i<drv->Length;i++) //for all drives set limitation - if (drv[i]->DriveType==DriveType::Fixed) - DenyAccessFolder(drv[i]->Name); + for (int i=0;i<drv->Length;i++) //for all fixed drives set limitation + if (drv[i]->DriveType==DriveType::Fixed) + DenyAccessFolder(drv[i]->Name); wchar_t buf[MAX_PATH+1]; GetEnvironmentVariableW(L"ProgramFiles",buf,MAX_PATH); DenyAccessFolder(gcnew String(buf)); @@ -91,9 +99,9 @@ DWORD size=MAX_PATH; GetProfilesDirectory(buf,&size); DenyAccessFolder(gcnew String(buf)); - Details="User created."; + Details="User created. "; } else - Details="User exists."; + Details="User exists. "; return true; } @@ -208,12 +216,11 @@ } vector<TFunc> allowed; char mod_name[256],func_name[256]; -while (fscanf(f,"%s %s",mod_name,func_name)>0) +while (fscanf(f,"%s %s",mod_name,func_name)==2) { TFunc func; func.Name=func_name; func.Module=mod_name; - //func.handle=GetProcAddress(GetModuleHandleA(mod_name), func_name); allowed.push_back(func); } fclose(f); @@ -234,11 +241,12 @@ PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((PBYTE) hmodCaller + pImportDesc->FirstThunk); for (; pThunk->u1.Function; pThunk++) { - //PROC* ppfn = (PROC*) &pThunk->u1.Function; + if ((pThunk->u1.Function&(1<<31))!=0) + continue; PSTR NAME=(PSTR)((PIMAGE_IMPORT_BY_NAME)((PBYTE)hmodCaller+pThunk->u1.AddressOfData))->Name; bool allow=false; - for (int i=0;i<allowed.size();i++) + for (unsigned i=0;i<allowed.size();i++) if ((allowed[i].Name==string(NAME))&&(allowed[i].Module==string(pszModName))) { allow=true; @@ -247,7 +255,7 @@ if (!allow) { HasDF=true; - Details="Destricted Function. "; + Details="Import DF. \""+string(NAME)+"\" from module \""+string(pszModName)+"\" "; FreeLibrary(hmodCaller); return true; } @@ -309,7 +317,7 @@ return true; } err=GetLastError(); -Details="Cannot create process. Error#"+ToStr(err=GetLastError()); +Details="Cannot create process. Error#"+ToStr(err); return false; } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-20 15:23:38 UTC (rev 357) @@ -45,7 +45,6 @@ { string Name; string Module; - //PROC handle; }; public class SysCallSecure:public BasicSecure Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -14,6 +14,7 @@ data->Load(); testfield=gcnew TestLoader(data->InputName,data->OutputName,data->PointFileName,data->TestFolderName,ProblemPath); testfield->Load(); + results=gcnew array<TestRes^>(testfield->tests->Length); plug=gcnew PluginLoader(System::IO::Path::GetFullPath(data->CheckPlugin)); plug->Load(); exe=ExeFile; @@ -85,7 +86,7 @@ if (sec->CheckSecure()) { result->res=TestResult::DestrictedFunction; - result->Details=gcnew String(sec->Details.c_str())+" Destricted function."; + result->Details=gcnew String(sec->Details.c_str())+"Destricted function."; Marshal::FreeHGlobal(IntPtr(bufW)); return false; } @@ -327,8 +328,7 @@ { StopTest=false; CurrentTest=0; - threads=gcnew array<Threading::Thread^>(min(data->MaxThreads,test->tests->Length)); - results=gcnew array<TestRes^>(test->tests->Length); + threads=gcnew array<Threading::Thread^>(min(data->MaxThreads,testfield->tests->Length)); for (int i=0;i<threads->Length;i++) { Threading::Thread^ t=gcnew Threading::Thread(gcnew Threading::ThreadStart(this,&Runner::ThreadProc)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-09-20 10:03:33
|
Revision: 356 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=356&view=rev Author: Oracle_ Date: 2008-09-20 10:03:22 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Deleted precompiled headers (for compiling on Vista). Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,5 +1,3 @@ -#include "stdafx.h" - using namespace System; using namespace System::Reflection; using namespace System::Runtime::CompilerServices; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,3 @@ -#include "stdafx.h" #include "CompileClass.h" using namespace Test; using namespace System::IO; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,4 @@ -#include "stdafx.h" + #include "SecureClass.h" #include <Lm.h> #include <Userenv.h> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,3 @@ -#include "stdafx.h" //#define _WIN32_WINNT 0x0500 //need for easy compiling on different machine #include "Test.h" #include <windows.h> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-09-20 10:03:22 UTC (rev 356) @@ -44,7 +44,7 @@ Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG" RuntimeLibrary="3" - UsePrecompiledHeader="2" + UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" /> @@ -202,26 +202,6 @@ > </File> <File - RelativePath=".\Stdafx.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - </File> - <File RelativePath=".\Test.cpp" > </File> @@ -240,10 +220,6 @@ > </File> <File - RelativePath=".\Stdafx.h" - > - </File> - <File RelativePath=".\Test.h" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2008-09-18 14:16:16
|
Revision: 353 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=353&view=rev Author: panzaboi Date: 2008-09-18 21:16:26 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Remove unneeded files Removed Paths: ------------- website/application/default/models/Card.php website/application/default/models/CardEffect.php website/application/default/models/EventHandler.php website/application/default/models/Field.php website/application/default/models/MonsterCard.php website/application/default/models/Player.php website/application/default/models/Que.php website/application/default/models/SpellCard.php Property Changed: ---------------- website/library/Zend/ Deleted: website/application/default/models/Card.php =================================================================== --- website/application/default/models/Card.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/Card.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,58 +0,0 @@ -<?php - -class Card -{ - const CARDTYPE_MONSTER = "monster"; - const CARDTYPE_SPELL = "spell"; - const CARDTYPE_TRAP = "trap"; - - protected $name; - protected $description; - protected $reference; - protected $cardtype; - - protected $down = true; - - public function __construct($name, $description, $reference, $cardtype) - { - $this->name = $name; - $this->description = $description; - $this->reference = $reference; - $this->cardtype = strtolower($cardtype); - } - - public function getName() { return $this->name; } - public function getDescription() { return $this->description; } - public function getReference() { return $this->reference; } - public function getCardType() { return $this->cardtype; } - public function getFaceDown() { return $this->down; } - - public function setFaceDown($down) { $this->facedown = $down; } - -// public function onSet(){} -// public function onPlay(){} -// public function onFlip(){} -// -// public function onAlliedAttack(){} -// public function onAlliedDefend(){} -// -// public function onDestroy(){} -// public function onDestroyed(){} -// -// public function onAlliedDestroy(){} -// public function onAlliedDestroyed(){} -// -// public function onDraw(){} -// public function onStandby(){} -// public function onMain1(){} -// public function onBattle(){} -// public function onMain2(){} -// public function onEnd(){} - - public function __call($function, $args) - { - return false; - } -} - -?> \ No newline at end of file Deleted: website/application/default/models/CardEffect.php =================================================================== --- website/application/default/models/CardEffect.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/CardEffect.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,47 +0,0 @@ -<?php - -class CardEffect extends Card -{ - protected $card; - - public function __construct(Card $card) - { - $this->card = $card; - } - - public function __call($function, $args) - { - return call_user_func_array(array($this->card, $function), $args); - } - - public function __get($name) - { - return $this->card->{$name}; - } - - public function __set($name, $value) - { - $this->card->{$name} = $value; - } - - /*********************************/ - - public function getName() { return $this->card->getName(); } - public function getDescription() { return $this->card->getDescription(); } - public function getNumber() { return $this->card->getNumber(); } - public function getCardType() { return $this->card->getCardType(); } - public function getFaceDown() { return $this->card->getFaceDown(); } - public function setFaceDown($down) { $this->card->setFaceDown($down); } - -// public function onSet() -// { -// return $this->card->onSet(); -// } -// -// public function onPlay() -// { -// return $this->card->onSet(); -// } -} - -?> \ No newline at end of file Deleted: website/application/default/models/EventHandler.php =================================================================== --- website/application/default/models/EventHandler.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/EventHandler.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,26 +0,0 @@ -<?php - -class EventHandler -{ - const EVENT_PLAY = 1; - const EVENT_SET = 2; - - protected $registeredEvents = array(); - - public function registerEvent($event) - { - if ( !isset($this->registeredEvents[$event->type]) ) - { - $this->registeredEvents[$event->type][$event->id] = array($event); - } - } - - public function fireEvent($event) - { - if ( isset($this->registeredEvents[$event->type]) && isset($this->registeredEvents[$event->type][$event->id]) ) - { - $this->registeredEvents[$event->type][$event->id]->fire(); - } - } - -} \ No newline at end of file Deleted: website/application/default/models/Field.php =================================================================== --- website/application/default/models/Field.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/Field.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,164 +0,0 @@ -<?php - -class Field extends Ostacium_Model -{ - const ERR_OK = 1; - const ERR_NOSPACE = 2; - const ERR_SPTAKEN = 3; - - const STATE_DRAW = 1; - const STATE_STANDBY = 2; - const STATE_MAIN1 = 3; - const STATE_BATTLE = 4; - const STATE_MAIN2 = 5; - const STATE_END = 6; - - protected $fieldcard = null; - - protected $currentPlayer = null; - protected $currentState = null; - - protected $numToState = array(1 => 'onDraw', 2 => 'onStandby', 3 => 'onMain1', 4 => 'onBattle', 5 => 'onMain2', 6 => 'onEnd'); - protected $numToStateName = array(1 => 'Draw', 2 => 'Stand-By', 3 => 'Main 1', 4 => 'Battle', 5 => 'Main 2', 6 => 'End'); - - protected $player1; - protected $player2; - - public function __construct($id = null) - { - parent::__construct(); - - $this->player1 = new Player(); - $this->player2 = new Player(); - - if ($id) - $this->_load($id); - } - - protected function _load($id) - { - $game = $this->_db->select()->from('games')->where('id = ?', $id)->query()->fetch(); - - foreach (array('player1', 'player2') as $player) - { - $this->{$player}->load($game[$player.'username'], $game[$player.'lifepoints'], $game[$player.'hand'], $game[$player.'cards'], $game[$player.'monsters'], $game[$player.'spells'], $game[$player.'fusion'], $game[$player.'grave']); - } - - $this->fieldcard = $game['fieldcard']; - } - - public function playCard($player, $card, $where) - { - if (($error = $this->{$player}->canSet($where, $card)) == ERR_OK) - { - $c =& $this->{$player}->playFromHand($where, $card); - // $this->addEvent($c, 'play'); - } - else return $error; - } - - public function setCard($player, $card, $where) - { - if (($error = $this->{$player}->canSet($where, $card)) == ERR_OK) - { - $c =& $this->{$player}->setFromHand($where, $card); - // $this->addEvent($c, 'play'); - } - else return $error; - } - - /******************************************************************************************************************/ - - protected function _getCurrentState($name = false) - { - if ($name) - return $this->numToStateName[$this->currentState]; - else - return $this->currentState; - } - - protected function _getNextState($name = false) - { - $st = ($this->currentState == STATE_END ? STATE_DRAW : $this->currentState + 1); - - if ($name) - return $this->numToStateName[$st]; - else - return $st; - } - - protected function _moveToNextState() - { - $this->currentState = ($this->currentState == STATE_END ? STATE_DRAW : $this->currentState + 1); - $this->{$this->numToState[$this->currentState]}(); - } - - protected function _getCurrentPlayer($obj = false) - { - if ($obj) - return $this->{$this->currentPlayer}; - else - return $this->currentPlayer; - } - - protected function _getNextPlayer($obj = false) - { - $pl = ($this->currentPlayer == 'player1' ? 'player2' : 'player1'); - - if ($obj) - return $this->{$pl}; - else - return $pl; - } - - protected function _getAllCards() - { - $c = $this->_getCurrentPlayer(); - $n = $this->_getNextPlayer(); - - return ($this->monsterzone[$c] + $this->spellzone[$c] + $this->monsterzone[$n] + $this->spellzone[$n]); - } - - /******************************************************************************************************************/ - - public function getEnemyPlayer() - { - $auth = Zend_Auth::getInstance(); - $me = $auth->getStorage()->read()->username; - - return ($me == $this->player1->getUsername() ? $this->player2 : $this->player1); - } - - public function getThisPlayer() - { - $auth = Zend_Auth::getInstance(); - $me = $auth->getStorage()->read()->username; - - return ($me == $this->player1->getUsername() ? $this->player1 : $this->player2); - } - - public function __call($function, $args) - { - if (substr($function, 0, 2) == 'on') - { - $cards = $this->_getAllCards(); - foreach ($cards as $key => $card) - { - try - { - $method = new ReflectionMethod(get_class($card), $function); - if ($method->getDeclaringClass() != 'Card' && $method->getStartLine() != $method->getEndLine()) - { - $method->invoke($card, $args); - } - } - catch(Exception $e) - { - return false; - } - } - } - } -} - -?> \ No newline at end of file Deleted: website/application/default/models/MonsterCard.php =================================================================== --- website/application/default/models/MonsterCard.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/MonsterCard.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,105 +0,0 @@ -<?php - -class MonsterCard extends Card -{ -// const TYPE_Dragon = "Dragon"; -// const TYPE_Spellcaster = "Spellcaster"; -// const TYPE_Zombie = "Zombie"; -// const TYPE_Warrior = "Warrior"; -// const TYPE_BeastWarrior = "Beast-Warrior"; -// const TYPE_Beast = "Beast"; -// const TYPE_WingedBeast = "Winged Beast"; -// const TYPE_Fiend = "Fiend"; -// const TYPE_Fairy = "Fairy"; -// const TYPE_Insect = "Insect"; -// const TYPE_Dinosaur = "Dinosaur"; -// const TYPE_Reptile = "Reptile"; -// const TYPE_Fish = "Fish"; -// const TYPE_SeaSerpent = "Sea Serpent"; -// const TYPE_Machine = "Machine"; -// const TYPE_Thunder = "Thunder"; -// const TYPE_Aqua = "Aqua"; -// const TYPE_Pyro = "Pyro"; -// const TYPE_Rock = "Rock"; -// const TYPE_Plant = "Plant"; -// -// const SUB_Spirit = "Spirit"; -// const SUB_Gemini = "Gemini"; -// const SUB_Toon = "Toon"; -// const SUB_Union = "Union"; -// -// const ATTR_Dark = "Dark"; -// const ATTR_Earth = "Earth"; -// const ATTR_Fire = "Fire"; -// const ATTR_Light = "Light"; -// const ATTR_Water = "Water"; -// const ATTR_Wind = "Wind"; -// -// const MON_Normal = "Normal"; -// const MON_Effect = "Effect"; -// const MON_Fussion = "Fusion"; -// const MON_Ritual = "Ritual"; -// -// const EFF_NoEffect = "No Effect"; -// const EFF_Flip = "Flip Effect"; -// const EFF_Continious = "Continuous Effect"; -// const EFF_Ignition = "Ignition Effect"; -// const EFF_Trigger = "Trigger Effect"; -// const EFF_MultiTrig = "Multi-Trigger Effect"; - - const MODE_ATTACK = "Attack"; - const MODE_DEFENCE = "Defence"; - - protected $level; - protected $attribute; - protected $type; - protected $subtype; - protected $card; - protected $atk; - protected $def; - - protected $mode; - -/**************************************************/ - public function onAttack(){} - public function onDefend(){} - - public function onAlliedAttack(){} - public function onAlliedDefend(){} - - public function onDestroy(){} - public function onDestroyed(){} - - public function onAlliedDestroy(){} - public function onAlliedDestroyed(){} - - public function onTribute(){} -/**************************************************/ - public function getAttack() { return $this->atk; } - public function getDefence() { return $this->def; } - public function getLevel() { return $this->level; } - public function getAttribute() { return $this->attribute; } - public function getType() { return $this->type; } - public function getSubType() { return $this->subtype; } - - public function getMode() { return $this->mode; } - public function setMode($mode) { $this->mode = $mode; } -/**************************************************/ - public function __construct($options) - { - foreach ($options as $key => $value) - { - if ($key == 'name' || $key == 'description' || $key == 'reference' || $key == 'level' || $key == 'attribute' || $key == 'type' || $key == 'subtype' || $key == 'atk' || $key == 'def' || $key == 'cardtype') - { - $this->{$key} = $value; - } - } - } -/**************************************************/ - public function attach(SpellCard $card, $arguments) - { - return new $card($this, $arguments); - } -} - -?> \ No newline at end of file Deleted: website/application/default/models/Player.php =================================================================== --- website/application/default/models/Player.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/Player.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,150 +0,0 @@ -<?php - -class Player extends Ostacium_Model -{ - protected $username; - protected $lifepoints; - - protected $hand = array(); - protected $monsterzone = array(); - protected $spellzone = array(); - protected $deckzone = array(); - protected $graveyard = array(); - protected $fusionzone = array(); - - public function __construct() - { - parent::__construct(); - -// if (true) -// $this->load(); - } - - public function load($username, $lifepoints, $handcards, $deck, $monsters, $spells, $fusion, $grave) - { - $this->username = $username; - $this->lifepoints = (int)$lifepoints; - - $hand = explode(";", $handcards); - $monsterzone = explode(";", $monsters); - $spellzone = explode(";", $spells); - $deckzone = explode(";", $deck); - $graveyard = explode(";", $grave); - $fusionzone = explode(";", $fusion); - - $toload = implode(', ', array_merge($hand, $monsterzone, $spellzone, $deckzone, $graveyard, $fusionzone)); - $temp = $this->_db->select()->from('cards')->joinLeft('cardtypes', 'cardtypes.id=cards.cardtype_id', 'cardtypes.name as cardtype')->where('cards.id IN ('.$toload.')')->query()->fetchAll(); - - $cards = array(); - - foreach ($temp as $card) - { - $cards[$card['id']] = $card; - } - - foreach (array('hand', 'monsterzone', 'spellzone', 'deckzone', 'graveyard', 'fusionzone') as $type) - { - foreach (${$type} as $card) - { - if ($card) - { - if (strtolower($cards[$card]['cardtype']) == Card::CARDTYPE_MONSTER) - { - $this->{$type}[] = new MonsterCard($cards[$card]); - } - else - { - $this->{$type}[] = new SpellCard($cards[$card]); - } - } - } - } - } - - public function canSet($where, $card) - { - $what = $this->peekHandCard($card)->getCardType(); - - if ($this->{'get'.ucfirst($what).'Count'}() == 5) return Field::ERR_NOSPACE; - elseif (isset($this->{$what.'zone'}[$where]) && $this->{$what.'zone'}[$where] instanceof Card) return Field::ERR_SPACETAKEN; - else return Field::ERR_OK; - } - - public function &setFromHand($where, $c) - { - $card = $this->getHandCard($c); - $this->{$card->getCardType().'zone'}[$where] = $card; - $card->setFaceDown(true); - - if ($card->getCardType() == Card::CARDTYPE_MONSTER) - $card->setMode(MonsterCard::MODE_DEFENCE); - - return $card; - } - - public function &playFromHand($where, $card) - { - $card = $this->getHandCard($c); - $this->{$card->getCardType().'zone'}[$where] = $card; - $card->setFaceDown(false); - - if ($card->getCardType() == Card::CARDTYPE_MONSTER) - $card->setMode(MonsterCard::MODE_ATTACK); - - return $card; - } - - public function peekHandCard($card) - { - if (isset($this->hand[$card]) && $this->hand[$card] instanceof Card) return $this->hand[$card]; - else return false; - } - - /****************************************************/ - - public function getMonsterCards() - { - return $this->monsterzone; - } - - public function getSpellCards() - { - return $this->spellzone; - } - - public function getUsername() - { - return $this->username; - } - - public function getMonsterCount() - { - return count($monsterzone); - } - - public function getSpellCount() - { - return count($monsterzone); - } - - public function getNextDeckCard() - { - return array_pop($this->deckzone); - } - - public function getHandCard($card) - { - if (isset($this->hand[$card]) && $this->hand[$card] instanceof Card) - { - $what = $this->hand[$card]; - unset($this->hand[$card]); - - return $what; - } - else return false; - } - - /****************************************************/ -} - -?> \ No newline at end of file Deleted: website/application/default/models/Que.php =================================================================== --- website/application/default/models/Que.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/Que.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,19 +0,0 @@ -<?php - -class Que -{ - protected $que = array(); - - - public function add($item) - { - array_push($this->que, $item); - } - - public function process() - { - $que[0]->execute; - array_shift($que); - } - -} \ No newline at end of file Deleted: website/application/default/models/SpellCard.php =================================================================== --- website/application/default/models/SpellCard.php 2008-09-18 21:05:20 UTC (rev 352) +++ website/application/default/models/SpellCard.php 2008-09-18 21:16:26 UTC (rev 353) @@ -1,39 +0,0 @@ -<?php - -class SpellCard -{ -// const TYPE_Spell = "Spell"; -// const TYPE_Trap = "Trap"; -// -// const ATTR_NORMAL = "Normal"; -// const ATTR_EQUIP = "Equip"; -// const ATTR_FIELD = "Field"; -// const ATTR_QUICK = "Quick-Play"; -// const ATTR_RITUAL = "Ritual"; -// const ATTR_CONT = "Continuous"; -// const ATTR_COUNT = "Counter"; - /**************************************************/ - public function onBlock(){} - /**************************************************/ - - protected $type; - protected $attribute; - /**************************************************/ - public function getType() { return $this->type; } - public function getAttribute() { return $this->attribute; } - /**************************************************/ - public function __construct($options) - { - foreach ($options as $key => $value) - { - if ($key == 'name' || $key == 'description' || $key == 'number' || $key == 'level' || $key == 'attribute' || $key == 'type' || $key == 'atk' || $key == 'def' || $key == 'effect') - { - $this->{$key} = $value; - } - } - } - - /**************************************************/ -} - -?> \ No newline at end of file Property changes on: website/library/Zend ___________________________________________________________________ Added: svn:ignore + Auth Cache Config Console Controller Currency Date Db Feed Filter Form Gdata Http InfoCard Json Layout Ldap Loader Locale Log Mail Measure Memory Mime OpenId Pdf Request Rest Search Server Service Session TimeSync Translate Uri Validate View XmlRpc Acl.php Auth.php Cache.php Config.php Currency.php Date.php Db.php Debug.php Exception.php Feed.php Filter.php Form.php Gdata.php InfoCard.php Json.php Layout.php Ldap.php Loader.php Locale.php Log.php Mail.php Memory.php Mime.php OpenId.php Pdf.php Registry.php Session.php TimeSync.php Translate.php Uri.php Validate.php Version.php View.php Acl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-16 13:18:21
|
Revision: 350 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=350&view=rev Author: brus07 Date: 2008-09-16 13:18:31 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Added queue in SocketClientGate, and treeing send to free Tester. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-09-14 15:01:05 UTC (rev 349) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-09-16 13:18:31 UTC (rev 350) @@ -40,14 +40,16 @@ byte[] bytes = SystemMessage.Serialize(mes); server.SendData(bytes, TargetClientIndex); } - public void Send(SystemMessage message) + public bool Send(SystemMessage message) { List<int> freeTesters = GetFreeTesters(); if (freeTesters.Count != 0) { Random random = new Random(); DataSender(message, freeTesters[random.Next() % freeTesters.Count]); + return true; } + return false; } protected virtual void DataSender(SystemMessage message, int clientIndex) { Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-09-14 15:01:05 UTC (rev 349) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-09-16 13:18:31 UTC (rev 350) @@ -2,6 +2,8 @@ using AcmContester.Library.Connector; using AcmContester.Library.LibraryExtention.Data; using AcmContester.Library.LibraryExtention; +using System.Collections.Generic; +using System.Threading; namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin { @@ -36,16 +38,63 @@ base.DataSender(message, clientIndex); } } + + Dictionary<SystemMessage, object> poolWork = new Dictionary<SystemMessage, object>(); + bool poolWorking = false; private void Send2(Submit submit) { if (dataContainer.Contains(submit) == false) { - SystemMessage sysMes = new SystemMessage(submit.ToString()); - base.Send(sysMes); + SystemMessage sysMes = new SystemMessage(submit.ToString(), "TestingSubmit"); + lock (poolWork) + { + poolWork.Add(sysMes, null); + } + startPool(); } } - public new void Send(SystemMessage message) + private void runPool() { + if (poolWorking == true) + return; + poolWorking = true; + while (true) + { + Thread.Sleep(100); + lock (poolWork) + { + if (poolWork.Count == 0) + break; + foreach (SystemMessage sysMes in poolWork.Keys) + { + if (base.Send(sysMes) == true) + { + poolWork.Remove(sysMes); + break; + } + } + } + } + poolWorking = false; + } + private static void RunningPool(Object ob) + { + SocketServerGate ssg = (SocketServerGate)ob; + ssg.runPool(); + } + private void startPool() + { + if (poolWorking == false) + { + ThreadPool.QueueUserWorkItem(RunningPool, this); + } + } + + public new bool Send(SystemMessage message) + { + if (message.IsType("TestingSubmitList") == false) + return false; + SubmitList submitList = SubmitList.CreateFromXml(message.Message); OnLogMessage("Get submits"); @@ -59,8 +108,8 @@ for (int index = 0; index < submitList.Items.Length; index++) { Send2(submitList.Items[index]); - //base.Send(submitList.Items[index].ToString()); } + return true; } protected override void DataArriver(SystemMessage message) Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-09-14 15:01:05 UTC (rev 349) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-09-16 13:18:31 UTC (rev 350) @@ -49,16 +49,17 @@ public SystemMessage GetInfoFromSite() { checkAddress(); - object ob = GetInfoFromSiteX(); + object ob = MediatorGetInfoFromSiteX(); if (ob == null) return new SystemMessage("", "Empty"); - SystemMessage sysMes = new SystemMessage(ob.ToString()); + SystemMessage sysMes = new SystemMessage(ob.ToString(), "TestingSubmitList"); return sysMes; } public void Send(SystemMessage message) { - SendX(message.Message); + if (message.IsType("TestingResult") == true) + MediatorSendX(message.Message); } public string PathToSource @@ -75,7 +76,12 @@ #endregion - + void MediatorSendX(string message) + { + Result result = Result.CreateFromXml(message); + SendX(message); + container.Return(result); + } void SendX(string message) { string res = ""; @@ -105,6 +111,30 @@ WebResponse myResponse = myRequest.GetResponse(); myResponse.Close(); } + + string MediatorGetInfoFromSiteX() + { + string getAll = GetInfoFromSiteX(); + if (String.IsNullOrEmpty(getAll) == true) + return null; + SubmitList list = SubmitList.CreateFromXml(getAll); + List<Submit> result = new List<Submit>(); + for (int i = 0; i < list.Items.Length; i++) + { + if (container.Contains(list.Items[i]) == false) + { + result.Add(list.Items[i]); + + //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE4\xEE\xE1\xE0\xE2\xEB\xFF\xF2\xE8 \xF2\xB3\xEB\xFC\xEA\xE8 \xF2\xEE\xE4\xB3 \xEA\xEE\xEB\xE8 \xF6\xE5\xE9 \xF1\xE0\xE1\xEC\xB3\xF2 \xE2\xB3\xE4\xEF\xF0\xE0\xE2\xEB\xE5\xED\xE8\xE9 \xED\xE0 \xF2\xE5\xF1\xF2\xF3\xE2\xE0\xED\xED\xFF + container.Add(list.Items[i]); + } + } + if (result.Count == 0) + return null; + SubmitList resultList = new SubmitList(); + resultList.Items = result.ToArray(); + return resultList.ToString(); + } string GetInfoFromSiteX() { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/get.php"); Modified: ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-09-14 15:01:05 UTC (rev 349) +++ ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-09-16 13:18:31 UTC (rev 350) @@ -148,7 +148,7 @@ { Result res = Result.CreateFromXml(result); OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res); - this.Send(new SystemMessage(result)); + this.Send(new SystemMessage(result, "TestingResult")); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-09-14 15:01:06
|
Revision: 349 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=349&view=rev Author: Oracle_ Date: 2008-09-14 15:01:05 +0000 (Sun, 14 Sep 2008) Log Message: ----------- Fixed bug with Too large array in Double security and updated waiting for files. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt Removed Paths: ------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.exe ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-14 15:01:05 UTC (rev 349) @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using System.IO; using Main; @@ -12,22 +11,32 @@ { static void Main(string[] args) { + Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - TestEnv test = new TestEnv(File.ReadAllText("source.txt"),data[0],data[1],data[2]); - test.Compile(); - Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}",test.comp.Result.ToString(),test.comp.Details,test.comp.UsedTime); - Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); - if (test.comp.Result == Test.CompRes.OK) + for (int ind = 1; ind <= 18; ind++) { - test.RunAllTests(SecureType.Double); + string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); + TestEnv test = new TestEnv(src, data[0], data[1], data[2]); + test.Compile(); + Console.WriteLine("------------------BEGIN SOURCE #"+ind.ToString()+"--------------------------"); + Console.WriteLine(src); + Console.WriteLine("-------------------END SOURCE #" + ind.ToString() + "---------------------------"); + Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result.ToString(), test.comp.Details, test.comp.UsedTime); + Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); + if (test.comp.Result == Test.CompRes.OK) + { + test.RunAllTests(SecureType.Double); - for (int i = 0; i < test.run.results.Length; i++) - { - Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, - test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + for (int i = 0; i < test.run.results.Length; i++) + { + Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, + test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + } } +// Console.ReadKey(); } - Console.ReadKey(); + Console.Out.Flush(); + Console.Out.Close(); } } } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -4,6 +4,6 @@ OutputLimit: 1024 RealTimeLimit: 20000 TimeLimit: 1000 -MaxThreads: 1 +MaxThreads: 4 Checker: scriptExample.txt CheckPlugin: Plugin.dll \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1,28 +0,0 @@ -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -uses math; -begin - -end. - -uses windows; -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -var a:array [1..2147000000] of char; -begin - fillchar(a,0,sizeof(a)); -end. - -begin -assignfile(output,'out.txt'); -rewrite(output); -closefile(output); -end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +uses windows; +var s:string; +begin +readln(s); +writeln(length(s)); +end. Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +uses windows; +begin +Sleep(100000); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,2 @@ +begin +end; \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,3 @@ +begin +while true do; +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,3 @@ +begin +while true do write(' '); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:Char; +begin + while true do read(a); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +uses Windows; +var k:HKEY; +begin + RegOpenKeyEx(HKEY_CURRENT_USER,'Software\',0,KEY_ALL_ACCESS,k); + RegSetValueEx(k,'GAME2',0,REG_SZ,pchar('hello'),5); + if RegQueryValueEx(k,'GAME2',nil,nil,nil,nil)<>0 then + while true do; +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +var a:array [1..10] of Integer; +x,y:integer; +begin + x:=10000; + a[x]:=138; + readln(x,y); + writeln(x+y); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +program Project2; +{$APPTYPE CONSOLE} +uses Windows; +begin + MessageBox(GetDesktopWindow(),'Hello!','Hello',MB_OK); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,9 @@ +var a,b:Extended; +i:Integer; +x:array of Integer; +begin + read(a,b); + for i:=1 to 5700000 do + a:=sqrt(a)*sqrt(a)+((sqrt(a)*sqrt(a))/sqrt(a))/sqrt(a)-1; + write(a+b:0:0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,5 @@ +begin +assignfile(output,'out.txt'); +rewrite(output); +closefile(output); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +uses math; +begin + +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +uses windows; +var a,b:integer; +begin +read(a,b); +write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:array [1..2147000000] of char; +begin + fillchar(a,0,sizeof(a)); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +type MyStruct=record +a:array [1..1000000] of Integer; +end; + +var a:^MyStruct; +begin +new(a); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:array [1..1000000] of Integer; +begin +fillchar(a,sizeof(a),0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +var a,b:Extended; +i:integer; +begin +read(a,b); +for i:=1 to 10000000 do + a:=sqrt(a)*sqrt(a); +write(a+b:0:0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,9 @@ +var x:array [1..1000000] of ^Integer; +i:integer; +begin +fillchar(x,sizeof(x),0); +for i:=1 to 1000000 do + new(x[i]); +for i:=1 to 1000000 do + dispose(x[i]); +end. \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -2 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1,28 +0,0 @@ -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -uses math; -begin - -end. - -uses windows; -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -var a:array [1..2147000000] of char; -begin - fillchar(a,0,sizeof(a)); -end. - -begin -assignfile(output,'out.txt'); -rewrite(output); -closefile(output); -end. \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-14 15:01:05 UTC (rev 349) @@ -35,7 +35,7 @@ src->Write(source); src->Close(); - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for file to flush on hard + WaitForFile(srcpath); si->FileName=comppath; si->Arguments="\""+srcpath+"\" \""+temp; @@ -53,7 +53,7 @@ } UsedTime=comp->TotalProcessorTime; - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for creating the file + WaitForFile(ExeFile); if (!File::Exists(ExeFile)) //compilation error { @@ -70,4 +70,24 @@ { comp->Close(); } +} + +void Compiler::WaitForFile(String^ FileName) +{ + for (int i=0;i<CONST_SLEEP;++i) + if (!File::Exists(FileName)) + System::Threading::Thread::Sleep(1); + for (int i=0;i<CONST_SLEEP;++i) + { + try + { + FileStream^ f=File::OpenRead(FileName); + f->Close(); + break; + } catch(...) + { + System::Threading::Thread::Sleep(1); + continue; + } + } } \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-14 15:01:05 UTC (rev 349) @@ -22,6 +22,7 @@ String^ comppath; String^ source; String^ temp; + void WaitForFile(String^ FileName); public: String^ Details; CompRes Result; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-14 15:01:05 UTC (rev 349) @@ -22,7 +22,7 @@ virtual bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) {return true;}; virtual bool CheckSecure() {return true;}; virtual void Finalize() {}; - int LastError() {return err;}; + virtual int LastError() {return err;}; }; public class UserSecure: public BasicSecure @@ -70,6 +70,7 @@ bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo); bool CheckSecure(); void Finalize(); + int LastError() {return syssec->LastError(); } }; public class NoneSecure:public BasicSecure Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-14 15:01:05 UTC (rev 349) @@ -70,8 +70,16 @@ unlock(); if (!sec->Init(bufW)) { - result->res=TestResult::InternalError; - result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + int err=sec->LastError(); + if ((err==193)||(err==1455)) + { + result->res=TestResult::RuntimeError; + result->Details=gcnew String(sec->Details.c_str())+" Too large array"; + } else + { + result->res=TestResult::InternalError; + result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + } Marshal::FreeHGlobal(IntPtr(bufW)); return false; } @@ -238,7 +246,7 @@ CloseHandle(si.hStdOutput);si.hStdOutput=NULL; CloseHandle(si.hStdInput);si.hStdInput=NULL; - Sleep(CONST_SLEEP); //waiting for file + WaitForFile(oupath); if (!File::Exists(oupath)) { @@ -247,7 +255,7 @@ return false; } - Sleep(CONST_SLEEP); //waiting for closing all handles to this file + WaitForFile(oupath); Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,File::ReadAllText(oupath),test->tests[index-1]->output); @@ -367,3 +375,23 @@ { LeaveCriticalSection(cs); } + +void Runner::WaitForFile(String^ FileName) +{ + for (int i=0;i<CONST_SLEEP;++i) + if (!File::Exists(FileName)) + Sleep(1); + for (int i=0;i<CONST_SLEEP;++i) + { + try + { + FileStream^ f=File::OpenRead(FileName); + f->Close(); + break; + } catch(...) + { + Sleep(1); + continue; + } + } +} \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-14 15:01:05 UTC (rev 349) @@ -79,6 +79,7 @@ void destroylock(); void lock(); //locks access to other theads void unlock(); //unlocks access to other threads + void WaitForFile(String^ FileName); //waits for file handle TestLoader^ testfield; DataLoader^ datafield; PluginLoader^ plugfield; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-01 16:43:11
|
Revision: 348 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=348&view=rev Author: brus07 Date: 2008-09-01 16:43:21 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Fixed bug Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-09-01 16:36:03 UTC (rev 347) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-09-01 16:43:21 UTC (rev 348) @@ -22,6 +22,10 @@ public override void Send(SystemMessage message) { + if (message.IsType("ApplicationSystem") && message.Message == "stop") + { + return; + } string text = " Send: " + message.Message.Length + " bytes" + Environment.NewLine; ((WebGatePluginUserControl)base.Control).AddText(text); @@ -33,7 +37,8 @@ string text = "Arrived: " + message.Message.Length + " bytes"; ((WebGatePluginUserControl)base.Control).AddText(text); - base.DataArrived(message); + if (message.IsType("Empty") == false) + base.DataArrived(message); } private void OnChecked(object o,EventArgs a) Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-09-01 16:36:03 UTC (rev 347) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-09-01 16:43:21 UTC (rev 348) @@ -5,6 +5,7 @@ using System.Text; using AcmContester.Library.LibraryExtention.Data; using System.Net; +using System.Collections.Generic; namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { @@ -13,6 +14,13 @@ //"http://127.0.0.1/d"; string fullPathToWebPages = ""; + DataMediator container = new DataMediator(); + + public WebGetter() + { + container.SecondToLive = 60 * 5; + } + public string FullPathToWebPages { get @@ -42,6 +50,8 @@ { checkAddress(); object ob = GetInfoFromSiteX(); + if (ob == null) + return new SystemMessage("", "Empty"); SystemMessage sysMes = new SystemMessage(ob.ToString()); return sysMes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-01 16:35:52
|
Revision: 347 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=347&view=rev Author: brus07 Date: 2008-09-01 16:36:03 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Refactoring Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs Modified: ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs 2008-09-01 16:29:35 UTC (rev 346) +++ ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs 2008-09-01 16:36:03 UTC (rev 347) @@ -6,10 +6,20 @@ { public class DataMediator { - const int secondToLive = 60; + private int secondToLive = 60; - Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); + private Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); + public int SecondToLive + { + set + { + if (value < 0) + throw new ArgumentException("Can't be lower than zero (0).", "SecondToLive"); + secondToLive = value; + } + } + /// <summary> /// \xDF\xEA\xF9\xEE \xF1\xE0\xE1\xEC\xB3\xF2 \xF3 \xF7\xE5\xF0\xE7\xB3 \xE7\xED\xE0\xF5\xEE\xE4\xE8\xF2\xFC\xF1\xFF \xE1\xB3\xEB\xFC\xF8\xE5 \xED\xB3\xE6 secondToLive \xF1\xE5\xEA\xF3\xED\xE4, \xF2\xEE \xE2\xB3\xED \xEF\xF0\xEE\xF1\xF2\xEE \xE2\xE8\xE4\xE0\xEB\xFF\xBA\xF2\xFC\xF1\xFF \xE7 \xED\xE5\xBF /// </summary> Modified: ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2008-09-01 16:29:35 UTC (rev 346) +++ ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2008-09-01 16:36:03 UTC (rev 347) @@ -10,7 +10,7 @@ { ArrayList listSubmits; - private SubmitList() + public SubmitList() { listSubmits = new ArrayList(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-01 16:29:24
|
Revision: 346 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=346&view=rev Author: brus07 Date: 2008-09-01 16:29:35 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Change assembly version for automatic generate the Revision and Build Numbers. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties/AssemblyInfo.cs Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs 2008-09-01 16:27:25 UTC (rev 345) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs 2008-09-01 16:29:35 UTC (rev 346) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")] Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties/AssemblyInfo.cs 2008-09-01 16:27:25 UTC (rev 345) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties/AssemblyInfo.cs 2008-09-01 16:29:35 UTC (rev 346) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-01 16:27:15
|
Revision: 345 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=345&view=rev Author: brus07 Date: 2008-09-01 16:27:25 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Fixed bug. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs 2008-09-01 16:21:45 UTC (rev 344) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs 2008-09-01 16:27:25 UTC (rev 345) @@ -46,17 +46,17 @@ public static T GetObject<T>(string fullXml, string xmlPath, string pathToSchemaFile) where T: class { if (fullXml == null) - throw new ArgumentNullException("fullXml", "Can't be null"); + throw new ArgumentNullException("Can't be null", "fullXml"); if (fullXml == null) - throw new ArgumentException("fullXml", "Can't be empty"); + throw new ArgumentException("Can't be empty", "fullXml"); if (xmlPath == null) - throw new ArgumentNullException("xmlPath", "Can't be null"); + throw new ArgumentNullException("Can't be null", "xmlPath"); if (xmlPath == null) - throw new ArgumentException("xmlPath", "Can't be empty"); + throw new ArgumentException("Can't be empty", "xmlPath"); if (pathToSchemaFile == null) - throw new ArgumentNullException("pathToSchemaFile", "Can't be null. You can use other method without this parameter"); + throw new ArgumentNullException("Can't be null. You can use other method without this parameter", "pathToSchemaFile"); if (pathToSchemaFile == null) - throw new ArgumentException("pathToSchemaFile", "Can't be null. You can use other method without this parameter"); + throw new ArgumentException("Can't be null. You can use other method without this parameter", "pathToSchemaFile"); fullXml = XmlHelper.GetOuterXmlOfSingleNodeFromXpath(fullXml, xmlPath); if (fullXml == null || fullXml == "") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-01 16:21:35
|
Revision: 344 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=344&view=rev Author: brus07 Date: 2008-09-01 16:21:45 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Change assembly version for automatic generate the Revision and Build Numbers. Modified Paths: -------------- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs Modified: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs 2008-08-31 22:35:59 UTC (rev 343) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs 2008-09-01 16:21:45 UTC (rev 344) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-31 22:35:53
|
Revision: 343 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=343&view=rev Author: brus07 Date: 2008-08-31 22:35:59 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Added *.user to ignore list. Property Changed: ---------------- ACMServer/trunk/ACMServer/Library/Connector/ Property changes on: ACMServer/trunk/ACMServer/Library/Connector ___________________________________________________________________ Modified: svn:ignore - bin obj + bin obj *.user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-31 10:42:26
|
Revision: 342 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=342&view=rev Author: brus07 Date: 2008-08-31 10:42:35 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Now Getter for web can be realize in Plugin. Realized WebGetter in Plugin. Old WebGate generate exception when using. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs Removed Paths: ------------- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj 2008-08-31 10:42:35 UTC (rev 342) @@ -39,7 +39,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Getter\IGetter.cs" /> - <Compile Include="Getter\WebGetter.cs" /> + <Compile Include="Getter\WebGetterOld.cs" /> <Compile Include="SocketClient.cs" /> <Compile Include="SocketServer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -6,5 +6,10 @@ { SystemMessage GetInfoFromSite(); void Send(SystemMessage message); + string PathToSource + { + get; + set; + } } } Deleted: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -1,96 +0,0 @@ -using System; -using System.Threading; -using System.Windows.Forms; -using System.Net; -using System.IO; -using System.Text; -using AcmContester.Library.LibraryExtention.Data; -using AcmContester.Library.LibraryExtention; - -namespace AcmContester.Library.Connector.Getter -{ - class WebGetter: IWebGetter - { - //"http://127.0.0.1/d"; - string fullPathToWebPages = ""; - - public string FullPathToWebPages - { - get - { - checkAddress(); - return fullPathToWebPages; - } - set - { - fullPathToWebPages = value; - } - } - - private void checkAddress() - { - if (fullPathToWebPages == "") - { - StreamReader s = new StreamReader("InDataW.txt", Encoding.Default); - fullPathToWebPages = s.ReadLine(); - s.Close(); - } - } - - public void Send(SystemMessage message) - { - SendX(message.Message); - } - - public SystemMessage GetInfoFromSite() - { - checkAddress(); - object ob = GetInfoFromSiteX(); - SystemMessage sysMes = new SystemMessage(ob.ToString()); - return sysMes; - } - - void SendX(string message) - { - string res = ""; - string id = ""; - string usedMemory = ""; - string usedTime = ""; - try - { - //TODO: - Result result = Result.CreateFromXml(message); - res = result.res; - id = result.Submit.id.ToString(); - usedMemory = result.usedMemory.ToString(); - usedTime = result.usedTime.ToString(); - } - catch (Exception) - { - return; - } - string fullURL = fullPathToWebPages + "/set.php?"; - fullURL += "res=" + res; - fullURL += "&id=" + id; - fullURL += "&usedMemory=" + usedMemory; - fullURL += "&usedTime=" + usedTime; - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullURL); - myRequest.Method = "GET"; - WebResponse myResponse = myRequest.GetResponse(); - myResponse.Close(); - } - string GetInfoFromSiteX() - { - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/get.php"); - myRequest.Method = "GET"; - WebResponse myResponse = myRequest.GetResponse(); - StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); - string result = sr.ReadToEnd(); - sr.Close(); - myResponse.Close(); - if (result.Length == 0) - return null; - return result; - } - } -} Copied: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs (from rev 339, ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs) =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -0,0 +1,44 @@ +using System; +using System.Threading; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using AcmContester.Library.LibraryExtention.Data; +using AcmContester.Library.LibraryExtention; + +namespace AcmContester.Library.Connector.Getter +{ + class WebGetterOld: IWebGetter + { + //"http://127.0.0.1/d"; + string fullPathToWebPages = ""; + + public void Send(SystemMessage message) + { + throw new Exception("The method or operation is not implemented."); + } + + public SystemMessage GetInfoFromSite() + { + throw new Exception("The method or operation is not implemented."); + } + + #region IWebGetter Members + + + public string PathToSource + { + get + { + return fullPathToWebPages; + } + set + { + fullPathToWebPages = value; + } + } + + #endregion + } +} Property changes on: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs ___________________________________________________________________ Added: svn:mergeinfo + Modified: ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -15,7 +15,7 @@ public event EventHandler onChecking; public event EventHandler onChecked; - private IWebGetter getter = new WebGetter(); + private IWebGetter getter = new WebGetterOld(); private WebConnector() { @@ -23,7 +23,7 @@ } public WebConnector(IWebGetter getter): this() { - //this.getter = getter; + this.getter = getter; } private void Init() { @@ -42,11 +42,12 @@ //TODO: get { - return ((WebGetter)getter).FullPathToWebPages; + + return getter.PathToSource; } set { - ((WebGetter)getter).FullPathToWebPages = value; + getter.PathToSource = value; } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -10,7 +10,8 @@ { private static WebGate instance = new WebGate(); - private WebGate(): base(new WebGetter()) + private WebGate() + : base(new WebGetter()) { } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-08-31 10:42:35 UTC (rev 342) @@ -51,6 +51,10 @@ <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> <Name>Connector</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Library\Data\Data.csproj"> + <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project> + <Name>Data</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj"> <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> <Name>LibraryExtention</Name> Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-08-31 09:56:44 UTC (rev 341) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-08-31 10:42:35 UTC (rev 342) @@ -1,23 +1,112 @@ using System; using AcmContester.Library.Connector.Getter; using AcmContester.Library.LibraryExtention; +using System.IO; +using System.Text; +using AcmContester.Library.LibraryExtention.Data; +using System.Net; namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { class WebGetter: IWebGetter { + //"http://127.0.0.1/d"; + string fullPathToWebPages = ""; + + public string FullPathToWebPages + { + get + { + checkAddress(); + return fullPathToWebPages; + } + set + { + fullPathToWebPages = value; + } + } + + private void checkAddress() + { + if (fullPathToWebPages == "") + { + StreamReader s = new StreamReader("InDataW.txt", Encoding.Default); + fullPathToWebPages = s.ReadLine(); + s.Close(); + } + } + #region IWebGetter Members public SystemMessage GetInfoFromSite() { - throw new Exception("The method or operation is not implemented."); + checkAddress(); + object ob = GetInfoFromSiteX(); + SystemMessage sysMes = new SystemMessage(ob.ToString()); + return sysMes; } public void Send(SystemMessage message) { - throw new Exception("The method or operation is not implemented."); + SendX(message.Message); } + public string PathToSource + { + get + { + return fullPathToWebPages; + } + set + { + fullPathToWebPages = value; + } + } + #endregion + + + void SendX(string message) + { + string res = ""; + string id = ""; + string usedMemory = ""; + string usedTime = ""; + try + { + //TODO: + Result result = Result.CreateFromXml(message); + res = result.res; + id = result.Submit.id.ToString(); + usedMemory = result.usedMemory.ToString(); + usedTime = result.usedTime.ToString(); + } + catch (Exception) + { + return; + } + string fullURL = fullPathToWebPages + "/set.php?"; + fullURL += "res=" + res; + fullURL += "&id=" + id; + fullURL += "&usedMemory=" + usedMemory; + fullURL += "&usedTime=" + usedTime; + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullURL); + myRequest.Method = "GET"; + WebResponse myResponse = myRequest.GetResponse(); + myResponse.Close(); + } + string GetInfoFromSiteX() + { + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/get.php"); + myRequest.Method = "GET"; + WebResponse myResponse = myRequest.GetResponse(); + StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); + string result = sr.ReadToEnd(); + sr.Close(); + myResponse.Close(); + if (result.Length == 0) + return null; + return result; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-31 09:56:34
|
Revision: 341 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=341&view=rev Author: brus07 Date: 2008-08-31 09:56:44 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Form send Stop message to SocketServerGatePlugin with specified type of SystemMessage. Modified Paths: -------------- ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-31 09:55:07 UTC (rev 340) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-31 09:56:44 UTC (rev 341) @@ -80,7 +80,7 @@ private void Disconnnect() { if (kernel != null) - kernel.SendToAll(new SystemMessage("stop")); + kernel.SendToAll(new SystemMessage("stop", "ApplicationSystem")); } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-08-31 09:55:07 UTC (rev 340) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-08-31 09:56:44 UTC (rev 341) @@ -21,7 +21,7 @@ public override void Send(SystemMessage message) { - if (message.Message == "stop") + if (message.IsType("ApplicationSystem") && message.Message == "stop") { socketServerGate.Stop(); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-31 09:54:58
|
Revision: 340 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=340&view=rev Author: brus07 Date: 2008-08-31 09:55:07 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Added method for check type of SystemMessage. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2008-08-31 09:16:40 UTC (rev 339) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2008-08-31 09:55:07 UTC (rev 340) @@ -70,5 +70,10 @@ stream.Close(); return ob; } + + public bool IsType(string checkType) + { + return type.ToLower() == checkType.ToLower(); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-31 09:16:31
|
Revision: 339 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=339&view=rev Author: brus07 Date: 2008-08-31 09:16:40 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Added new constructors to SystemMessage. Replace all call of SystemMessage constructor to small version. (new SystemMessage(string message)) Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -46,7 +46,7 @@ { checkAddress(); object ob = GetInfoFromSiteX(); - SystemMessage sysMes = new SystemMessage(ob.ToString(), ""); + SystemMessage sysMes = new SystemMessage(ob.ToString()); return sysMes; } Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -99,7 +99,7 @@ string message = "test"; message += " " + server.ClientsList[i].GetHashCode().ToString(); message += " " + curHashCode; - SystemMessage mes = new SystemMessage(message, "system"); + SystemMessage mes = new SystemMessage(message); ServerSend(mes, i); } Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -8,7 +8,7 @@ [Serializable] public class SystemMessage { - string type; + string type = ""; public string Type { @@ -18,7 +18,7 @@ } } - string message; + string message = ""; public string Message { @@ -28,12 +28,31 @@ } } - public SystemMessage(string message, string type) + string description = ""; + public string Description { + get + { + return description; + } + } + + public SystemMessage(string message) + { this.message = message; + } + + public SystemMessage(string message, string type): this(message) + { this.type = type; } + public SystemMessage(string message, string type, string description) + : this(message, type) + { + this.description = description; + } + public static byte[] Serialize(SystemMessage ob) { IFormatter formatter = new BinaryFormatter(); Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -80,7 +80,7 @@ private void Disconnnect() { if (kernel != null) - kernel.SendToAll(new SystemMessage("stop", "action")); + kernel.SendToAll(new SystemMessage("stop")); } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -40,7 +40,7 @@ { if (dataContainer.Contains(submit) == false) { - SystemMessage sysMes = new SystemMessage(submit.ToString(), "submit"); + SystemMessage sysMes = new SystemMessage(submit.ToString()); base.Send(sysMes); } } Modified: ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-25 14:13:29 UTC (rev 338) +++ ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-31 09:16:40 UTC (rev 339) @@ -66,7 +66,7 @@ result += " " + mes[i]; } OnAddLogText("SystemSend", result); - base.Send(new SystemMessage(result, "")); + base.Send(new SystemMessage(result)); return true; } return false; @@ -148,7 +148,7 @@ { Result res = Result.CreateFromXml(result); OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res); - this.Send(new SystemMessage(result, "")); + this.Send(new SystemMessage(result)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-25 14:13:34
|
Revision: 338 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=338&view=rev Author: brus07 Date: 2008-08-25 14:13:29 +0000 (Mon, 25 Aug 2008) Log Message: ----------- Added SystemMessage into whole project. This was sending through all modules. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Class1.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Plugin1.csproj ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsFramework.csproj ACMServer/trunk/ACMServer/Tester/Form1.cs ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs Removed Paths: ------------- ACMServer/trunk/ACMServer/Library/Connector/Getter/FileGetter.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/Connector.csproj 2008-08-25 14:13:29 UTC (rev 338) @@ -38,7 +38,6 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Getter\FileGetter.cs" /> <Compile Include="Getter\IGetter.cs" /> <Compile Include="Getter\WebGetter.cs" /> <Compile Include="SocketClient.cs" /> @@ -56,6 +55,10 @@ <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project> <Name>Data</Name> </ProjectReference> + <ProjectReference Include="..\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Deleted: ACMServer/trunk/ACMServer/Library/Connector/Getter/FileGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/FileGetter.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/FileGetter.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,41 +0,0 @@ -using System; - -namespace AcmContester.Library.Connector.Getter -{ - class FileGetter: IGetter - { - public object GetInfoFromSite() - { - try - { - string res = ""; - using (System.IO.StreamReader sr = new System.IO.StreamReader("a.txt")) - { - res = sr.ReadToEnd(); - } - if (res.Length == 0) - return null; - return res; - } - catch (Exception) - { - } - return null; - } - - public void Send(string message) - { - try - { - using (System.IO.StreamWriter sr = new System.IO.StreamWriter("b.txt", true)) - { - sr.WriteLine(DateTime.Now.ToLongTimeString() + ": " + message); - } - } - catch (Exception) - { - } - //TODO: - } - } -} Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/IGetter.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,9 +1,10 @@ +using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector.Getter { - interface IGetter + public interface IWebGetter { - object GetInfoFromSite(); - void Send(string message); + SystemMessage GetInfoFromSite(); + void Send(SystemMessage message); } } Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -5,10 +5,11 @@ using System.IO; using System.Text; using AcmContester.Library.LibraryExtention.Data; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector.Getter { - class WebGetter: IGetter + class WebGetter: IWebGetter { //"http://127.0.0.1/d"; string fullPathToWebPages = ""; @@ -36,15 +37,17 @@ } } - public void Send(string message) + public void Send(SystemMessage message) { - SendX(message); + SendX(message.Message); } - public object GetInfoFromSite() + public SystemMessage GetInfoFromSite() { checkAddress(); - return GetInfoFromSiteX(); + object ob = GetInfoFromSiteX(); + SystemMessage sysMes = new SystemMessage(ob.ToString(), ""); + return sysMes; } void SendX(string message) Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,5 +1,6 @@ using System; using JadBenAutho.EasySocket; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector { @@ -7,7 +8,7 @@ { EasyClient client; - public delegate void DataArrivedDelegate(string s); + public delegate void DataArrivedDelegate(SystemMessage s); public event DataArrivedDelegate onDataArrived; string ip = "127.0.0.1"; @@ -39,14 +40,16 @@ client.Dispose(); client = null; } - public void Send(string message) + public void Send(SystemMessage message) { - client.SendData(message); + byte[] bytes = SystemMessage.Serialize(message); + client.SendData(bytes); } private void DataArrived(object Data) { - OnDataArrived(Data.ToString()); + SystemMessage mes = SystemMessage.Deserialize((byte[])Data); + OnDataArrived(mes); } public bool IsConnected() { @@ -55,7 +58,7 @@ return client.IsConnected; } - private void OnDataArrived(string message) + private void OnDataArrived(SystemMessage message) { if (onDataArrived != null) { Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,6 +1,7 @@ using System; using JadBenAutho.EasySocket; using System.Collections.Generic; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector { @@ -9,7 +10,7 @@ int port = 4120; EasyServer server; - public delegate void DataArrivedDelegate(string s); + public delegate void DataArrivedDelegate(SystemMessage s); public event DataArrivedDelegate onDataArrived; public SocketServer() @@ -34,8 +35,13 @@ } } - public void Send(string message) + private void ServerSend(SystemMessage mes, int TargetClientIndex) { + byte[] bytes = SystemMessage.Serialize(mes); + server.SendData(bytes, TargetClientIndex); + } + public void Send(SystemMessage message) + { List<int> freeTesters = GetFreeTesters(); if (freeTesters.Count != 0) { @@ -43,22 +49,23 @@ DataSender(message, freeTesters[random.Next() % freeTesters.Count]); } } - protected virtual void DataSender(string message, int clientIndex) + protected virtual void DataSender(SystemMessage message, int clientIndex) { - server.SendData(message, clientIndex); + ServerSend(message, clientIndex); } private void DataArrived(object Data, SocketStream DataSender) { - if (SystemMessage(Data.ToString()) == true) + SystemMessage sysMes = SystemMessage.Deserialize((byte[])Data); + if (SystemMessageX(sysMes) == true) return; - DataArriver(Data.ToString()); + DataArriver(sysMes); } - protected virtual void DataArriver(string message) + protected virtual void DataArriver(SystemMessage message) { OnDataArrived(message); } - private void OnDataArrived(string message) + private void OnDataArrived(SystemMessage message) { if (onDataArrived != null) { @@ -92,7 +99,8 @@ string message = "test"; message += " " + server.ClientsList[i].GetHashCode().ToString(); message += " " + curHashCode; - server.SendData(message, i); + SystemMessage mes = new SystemMessage(message, "system"); + ServerSend(mes, i); } @@ -137,15 +145,15 @@ /// </summary> /// <param name="message">\xCF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF</param> /// <returns>\xDF\xEA\xF9\xEE \xF6\xE5 \xF1\xEB\xF3\xE6\xE1\xEE\xE2\xE5 \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF, \xF2\xEE\xE4\xB3 \xEF\xEE\xE2\xE5\xF0\xF2\xE0\xBA\xF2\xFC\xF1\xFF true \xEF\xEE \xB3\xED\xE0\xEA\xF8\xEE\xEC\xF3 false</returns> - private bool SystemMessage(string message) + private bool SystemMessageX(SystemMessage message) { char[] chars = new char[1]; chars[0] = ' '; - string[] mes = message.Split(chars); + string[] mes = message.Message.Split(chars); if (mes[0] == "busy" || mes[0] == "free") { lock(q) - q.Enqueue(message); + q.Enqueue(message.Message); return true; } return false; Modified: ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,6 +1,7 @@ using System; using System.Timers; using AcmContester.Library.Connector.Getter; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector { @@ -8,21 +9,34 @@ { Timer timer = new Timer(); - public delegate void DataArrivedDelegate(string s); + public delegate void DataArrivedDelegate(SystemMessage s); public event DataArrivedDelegate onDataArrived; public event EventHandler onChecking; public event EventHandler onChecked; - private IGetter getter = new WebGetter(); + private IWebGetter getter = new WebGetter(); - public WebConnector() + private WebConnector() { + Init(); + } + public WebConnector(IWebGetter getter): this() + { + //this.getter = getter; + } + private void Init() + { + InitTimer(); + } + private void InitTimer() + { timer.Interval = 10 * 1000; timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); timer.Enabled = true; } + public string Address { //TODO: @@ -35,6 +49,7 @@ ((WebGetter)getter).FullPathToWebPages = value; } } + // Specify what you want to happen when the Elapsed event is // raised. @@ -42,12 +57,9 @@ { timer.Enabled = false; OnChecking(); - object ob = getter.GetInfoFromSite(); + SystemMessage message = getter.GetInfoFromSite(); OnChecked(); - if (ob != null) - { - DataArrived(ob); - } + DataArrived(message); timer.Enabled = true; } @@ -61,16 +73,16 @@ if (onChecked != null) onChecked(this, null); } - - private void DataArrived(object Data) + + private void DataArrived(SystemMessage Data) { if (onDataArrived != null) { - onDataArrived(Data.ToString()); + onDataArrived(Data); } } - public void Send(string message) + public void Send(SystemMessage message) { getter.Send(message); } Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj 2008-08-25 14:13:29 UTC (rev 338) @@ -36,6 +36,7 @@ <Compile Include="Log.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Reader.cs" /> + <Compile Include="SystemMessage.cs" /> <Compile Include="XML\XmlHelper.cs" /> <Compile Include="XML\XmlSerializer.cs" /> <Compile Include="XML\XmlValidator.cs" /> Added: ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -0,0 +1,55 @@ +using System; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using System.IO; + +namespace AcmContester.Library.LibraryExtention +{ + [Serializable] + public class SystemMessage + { + string type; + + public string Type + { + get + { + return type; + } + } + + string message; + + public string Message + { + get + { + return message; + } + } + + public SystemMessage(string message, string type) + { + this.message = message; + this.type = type; + } + + public static byte[] Serialize(SystemMessage ob) + { + IFormatter formatter = new BinaryFormatter(); + MemoryStream mem = new MemoryStream(); + Stream stream = mem; + formatter.Serialize(stream, ob); + stream.Close(); + return mem.GetBuffer(); + } + public static SystemMessage Deserialize(byte[] buffer) + { + IFormatter formatter = new BinaryFormatter(); + Stream stream = new MemoryStream(buffer); + SystemMessage ob = (SystemMessage)formatter.Deserialize(stream); + stream.Close(); + return ob; + } + } +} Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -8,6 +8,7 @@ using AcmContester.Library.Connector; using System.Net.Sockets; using System.IO; +using AcmContester.Library.LibraryExtention; namespace Mediator { @@ -79,7 +80,7 @@ private void Disconnnect() { if (kernel != null) - kernel.SendToAll("stop"); + kernel.SendToAll(new SystemMessage("stop", "action")); } Modified: ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -3,6 +3,7 @@ using AcmContester.Plugins.PluginsFramework; using System.Collections.Generic; using System.Windows.Forms; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Mediator.Library { @@ -68,7 +69,7 @@ temp(this, e); } - private void DataArrivedFromClientList(string message) + private void DataArrivedFromClientList(SystemMessage message) { if (testerSideList != null) { @@ -78,7 +79,7 @@ } } } - private void DataArrivedFromTesterList(string message) + private void DataArrivedFromTesterList(SystemMessage message) { if (clientSideList != null) { @@ -89,7 +90,7 @@ } } - public void SendToAll(string message) + public void SendToAll(SystemMessage message) { DataArrivedFromClientList(message); DataArrivedFromTesterList(message); Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Class1.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Class1.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,13 +1,14 @@ using System; using AcmContester.Plugins.PluginsFramework; +using AcmContester.Library.LibraryExtention; namespace Plugin1 { public class Class1: BaseMediatorPlugin { - public override void Send(string message) + public override void Send(SystemMessage message) { - Console.WriteLine("Plugin1::Class1::Send(" + message + ");"); + Console.WriteLine("Plugin1::Class1::Send(" + message.Message + ");"); Console.WriteLine("The method or operation is not implemented."); //throw new Exception("The method or operation is not implemented."); } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Plugin1.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Plugin1.csproj 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Plugin1.csproj 2008-08-25 14:13:29 UTC (rev 338) @@ -36,6 +36,10 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> <Name>PluginsFramework</Name> Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,6 +1,7 @@ using System; using AcmContester.Library.Connector; using AcmContester.Library.LibraryExtention.Data; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin { @@ -11,7 +12,7 @@ { private static SocketServerGate instance = new SocketServerGate(); - public new delegate void DataArrivedDelegate(string s); + public new delegate void DataArrivedDelegate(SystemMessage s); public new event DataArrivedDelegate onDataArrived; DataMediator dataContainer = new DataMediator(); @@ -26,9 +27,9 @@ return instance; } - protected override void DataSender(string message, int clientIndex) + protected override void DataSender(SystemMessage message, int clientIndex) { - Submit submit = Submit.CreateFromXml(message); + Submit submit = Submit.CreateFromXml(message.Message); if (dataContainer.Add(submit) == true) { OnLogMessage("send " + submit.id + " to " + clientIndex); @@ -39,12 +40,13 @@ { if (dataContainer.Contains(submit) == false) { - base.Send(submit.ToString()); + SystemMessage sysMes = new SystemMessage(submit.ToString(), "submit"); + base.Send(sysMes); } } - public new void Send(string message) + public new void Send(SystemMessage message) { - SubmitList submitList = SubmitList.CreateFromXml(message); + SubmitList submitList = SubmitList.CreateFromXml(message.Message); OnLogMessage("Get submits"); string ids = ""; @@ -61,9 +63,9 @@ } } - protected override void DataArriver(string message) + protected override void DataArriver(SystemMessage message) { - Result result = Result.CreateFromXml(message); + Result result = Result.CreateFromXml(message.Message); OnLogMessage("result " + result.Submit.id); OnLogMessage("\t " + result.res); @@ -71,7 +73,7 @@ base.DataArriver(message); dataContainer.Return(result); } - private void DataArrived(string message) + private void DataArrived(SystemMessage message) { if (onDataArrived != null) onDataArrived(message); Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,6 +1,7 @@ using System; using AcmContester.Plugins.PluginsFramework; using SocketServerGatePlugin; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin { @@ -18,9 +19,9 @@ socketServerGate.LogMessage += new EventHandler<SocketServerGate.LogMessageEventArgs>(socketServerGate_LogMessage); } - public override void Send(string message) + public override void Send(SystemMessage message) { - if (message == "stop") + if (message.Message == "stop") { socketServerGate.Stop(); return; Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -10,7 +10,7 @@ { private static WebGate instance = new WebGate(); - private WebGate() + private WebGate(): base(new WebGetter()) { } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,6 +1,7 @@ using System; using AcmContester.Plugins.PluginsFramework; using WebGatePlugin; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { @@ -19,17 +20,17 @@ webGate.onChecking += OnChecking; } - public override void Send(string message) + public override void Send(SystemMessage message) { - string text = " Send: " + message.Length + " bytes" + Environment.NewLine; + string text = " Send: " + message.Message.Length + " bytes" + Environment.NewLine; ((WebGatePluginUserControl)base.Control).AddText(text); webGate.Send(message); } - protected override void DataArrived(string message) + protected override void DataArrived(SystemMessage message) { - string text = "Arrived: " + message.Length + " bytes"; + string text = "Arrived: " + message.Message.Length + " bytes"; ((WebGatePluginUserControl)base.Control).AddText(text); base.DataArrived(message); Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-08-25 14:13:29 UTC (rev 338) @@ -44,12 +44,17 @@ <Compile Include="WebGatePluginUserControl.Designer.cs"> <DependentUpon>WebGatePluginUserControl.cs</DependentUpon> </Compile> + <Compile Include="WebGetter.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\Library\Connector\Connector.csproj"> <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> <Name>Connector</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> <Name>PluginsFramework</Name> Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -0,0 +1,23 @@ +using System; +using AcmContester.Library.Connector.Getter; +using AcmContester.Library.LibraryExtention; + +namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin +{ + class WebGetter: IWebGetter + { + #region IWebGetter Members + + public SystemMessage GetInfoFromSite() + { + throw new Exception("The method or operation is not implemented."); + } + + public void Send(SystemMessage message) + { + throw new Exception("The method or operation is not implemented."); + } + + #endregion + } +} Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -1,5 +1,6 @@ using System; using System.Windows.Forms; +using AcmContester.Library.LibraryExtention; namespace AcmContester.Plugins.PluginsFramework { @@ -8,10 +9,10 @@ /// </summary> public abstract class BaseMediatorPlugin { - public delegate void DataArrived_EventHandler(string message); + public delegate void DataArrived_EventHandler(SystemMessage message); public event DataArrived_EventHandler onDataArrived; - public abstract void Send(string message); + public abstract void Send(SystemMessage message); private UserControl control = null; @@ -27,7 +28,7 @@ } } - protected virtual void DataArrived(string message) + protected virtual void DataArrived(SystemMessage message) { if (onDataArrived != null) onDataArrived(message); Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsFramework.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsFramework.csproj 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsFramework.csproj 2008-08-25 14:13:29 UTC (rev 338) @@ -36,6 +36,12 @@ <Compile Include="PluginsLoader.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: ACMServer/trunk/ACMServer/Tester/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -6,10 +6,8 @@ using System.Text; using System.Windows.Forms; using System.IO; -using AcmContester.Library.LibraryExtention; -using System.Threading; using AcmContester.Tester.Library; -using LogDataGridView; +using AcmContester.Library.LibraryExtention; namespace Tester { @@ -95,7 +93,7 @@ { AddText(type + ": " + text); AddTextToGridLog(new LogMessage(text, type)); - view.AddRow(new SystemMessage(text, type)); + view.AddRow(new LogDataGridView.SystemMessage(text, type)); } public class LogMessage Modified: ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-19 09:42:45 UTC (rev 337) +++ ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-25 14:13:29 UTC (rev 338) @@ -8,7 +8,7 @@ { class SocketClientGate: SocketClient { - public delegate void DataArrivedDelegate(string s); + public delegate void DataArrivedDelegate(SystemMessage s); public event DataArrivedDelegate onDataArrived; public SocketClientGate(string IP) @@ -17,13 +17,13 @@ base.onDataArrived +=new SocketClient.DataArrivedDelegate(SocketClientGate_onDataArrived); } - void SocketClientGate_onDataArrived(string message) + void SocketClientGate_onDataArrived(SystemMessage message) { - if (SystemMessage(message) == true) + if (SystemMessageX(message) == true) return; - OnAddLogText("Receive", message); + OnAddLogText("Receive", message.Message); //OnDataArrived(message); - AddWork(message); + AddWork(message.Message); } public new void Disconnect() @@ -34,7 +34,7 @@ } - private void OnDataArrived(string message) + private void OnDataArrived(SystemMessage message) { if (onDataArrived != null) { @@ -43,8 +43,9 @@ } - private bool SystemMessage(string message) + private bool SystemMessageX(SystemMessage _message) { + string message = _message.Message; char[] chars = new char[1]; chars[0] = ' '; string[] mes = message.Split(chars); @@ -65,7 +66,7 @@ result += " " + mes[i]; } OnAddLogText("SystemSend", result); - base.Send(result); + base.Send(new SystemMessage(result, "")); return true; } return false; @@ -147,7 +148,7 @@ { Result res = Result.CreateFromXml(result); OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res); - this.Send(result); + this.Send(new SystemMessage(result, "")); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-19 09:42:36
|
Revision: 337 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=337&view=rev Author: brus07 Date: 2008-08-19 09:42:45 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Fixed bug: can send to testing submit, who was tested. This can be because, different thread send and receive. Now submit removed from DataContainer only after submit was send to web. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-19 08:46:04 UTC (rev 336) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-08-19 09:42:45 UTC (rev 337) @@ -64,12 +64,12 @@ protected override void DataArriver(string message) { Result result = Result.CreateFromXml(message); - dataContainer.Return(result); OnLogMessage("result " + result.Submit.id); OnLogMessage("\t " + result.res); base.DataArriver(message); + dataContainer.Return(result); } private void DataArrived(string message) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-19 08:45:55
|
Revision: 336 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=336&view=rev Author: brus07 Date: 2008-08-19 08:46:04 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Added LogDataGridView into Tester form. Modified Paths: -------------- ACMServer/trunk/ACMServer/Tester/Form1.Designer.cs ACMServer/trunk/ACMServer/Tester/Form1.cs ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs ACMServer/trunk/ACMServer/Tester/Tester.csproj Added Paths: ----------- ACMServer/trunk/ACMServer/Tester/LogDataGridView.dll Property Changed: ---------------- ACMServer/trunk/ACMServer/Tester/ Property changes on: ACMServer/trunk/ACMServer/Tester ___________________________________________________________________ Modified: svn:ignore - bin obj + bin obj *.user Modified: ACMServer/trunk/ACMServer/Tester/Form1.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Form1.Designer.cs 2008-08-18 21:48:42 UTC (rev 335) +++ ACMServer/trunk/ACMServer/Tester/Form1.Designer.cs 2008-08-19 08:46:04 UTC (rev 336) @@ -29,7 +29,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); @@ -38,14 +38,15 @@ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.dataGridViewLog = new System.Windows.Forms.DataGridView(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage3 = new System.Windows.Forms.TabPage(); this.statusStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewLog)).BeginInit(); + this.tabPage1.SuspendLayout(); this.SuspendLayout(); // // textBox1 @@ -112,6 +113,7 @@ this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Location = new System.Drawing.Point(12, 70); @@ -120,17 +122,6 @@ this.tabControl1.Size = new System.Drawing.Size(268, 178); this.tabControl1.TabIndex = 7; // - // tabPage1 - // - this.tabPage1.Controls.Add(this.textBox1); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(260, 152); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "TextLog"; - this.tabPage1.UseVisualStyleBackColor = true; - // // tabPage2 // this.tabPage2.Controls.Add(this.dataGridViewLog); @@ -148,14 +139,14 @@ this.dataGridViewLog.AllowUserToDeleteRows = false; this.dataGridViewLog.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.dataGridViewLog.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridViewLog.DefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewLog.DefaultCellStyle = dataGridViewCellStyle2; this.dataGridViewLog.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridViewLog.Location = new System.Drawing.Point(3, 3); this.dataGridViewLog.Name = "dataGridViewLog"; @@ -163,6 +154,27 @@ this.dataGridViewLog.Size = new System.Drawing.Size(254, 146); this.dataGridViewLog.TabIndex = 0; // + // tabPage1 + // + this.tabPage1.Controls.Add(this.textBox1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(260, 152); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "TextLog"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage3 + // + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(260, 152); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "GridLogSe"; + this.tabPage3.UseVisualStyleBackColor = true; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -180,10 +192,10 @@ this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.tabControl1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewLog)).EndInit(); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); - this.tabPage2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewLog)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -202,6 +214,7 @@ private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.DataGridView dataGridViewLog; + private System.Windows.Forms.TabPage tabPage3; } } Modified: ACMServer/trunk/ACMServer/Tester/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-08-18 21:48:42 UTC (rev 335) +++ ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-08-19 08:46:04 UTC (rev 336) @@ -9,6 +9,7 @@ using AcmContester.Library.LibraryExtention; using System.Threading; using AcmContester.Tester.Library; +using LogDataGridView; namespace Tester { @@ -24,7 +25,15 @@ textBox3.Text = ip; initGrid(); + + initGridSe(); } + LogDataGridView.LogDataGridView view = new LogDataGridView.LogDataGridView(); + private void initGridSe() + { + view.Dock = DockStyle.Fill; + tabPage3.Controls.Add(view); + } DataTable tableLog = new DataTable(); private void initGrid() @@ -86,6 +95,7 @@ { AddText(type + ": " + text); AddTextToGridLog(new LogMessage(text, type)); + view.AddRow(new SystemMessage(text, type)); } public class LogMessage @@ -117,9 +127,9 @@ { get { - if (type == "SystemR") + if (type == "SystemReceive") return Color.LightBlue; - if (type == "SystemS") + if (type == "SystemSend") return Color.LightSkyBlue; if (type == "Receive") return Color.LightGreen; Modified: ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-18 21:48:42 UTC (rev 335) +++ ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2008-08-19 08:46:04 UTC (rev 336) @@ -50,7 +50,7 @@ string[] mes = message.Split(chars); if (mes[0] == "test") { - OnAddLogText("SystemR", message); + OnAddLogText("SystemReceive", message); string result = ""; if (IsBusy() == true) { @@ -64,7 +64,7 @@ { result += " " + mes[i]; } - OnAddLogText("SystemS", result); + OnAddLogText("SystemSend", result); base.Send(result); return true; } Property changes on: ACMServer/trunk/ACMServer/Tester/LogDataGridView.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: ACMServer/trunk/ACMServer/Tester/Tester.csproj =================================================================== --- ACMServer/trunk/ACMServer/Tester/Tester.csproj 2008-08-18 21:48:42 UTC (rev 335) +++ ACMServer/trunk/ACMServer/Tester/Tester.csproj 2008-08-19 08:46:04 UTC (rev 336) @@ -28,6 +28,7 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="LogDataGridView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> @@ -86,6 +87,11 @@ <Name>LibraryExtention</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="LogDataGridView.dll"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-18 21:48:39
|
Revision: 335 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=335&view=rev Author: brus07 Date: 2008-08-18 21:48:42 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Added LogDataGridView project. Added Paths: ----------- ACMServer/trunk/tasks/LogDataGridView/ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.Designer.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.csproj ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.resx ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Message.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessage.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessageMode.cs ACMServer/trunk/tasks/LogDataGridView/LogDataGridView.sln Property changes on: ACMServer/trunk/tasks/LogDataGridView ___________________________________________________________________ Added: svn:ignore + *.suo *.NoLoad Added: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView ___________________________________________________________________ Added: svn:ignore + bin obj *.user Added: tsvn:logminsize + 5 Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.Designer.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.Designer.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.Designer.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,93 @@ +namespace LogDataGridView +{ + partial class LogDataGridView + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView + // + this.dataGridView.AllowUserToAddRows = false; + this.dataGridView.AllowUserToDeleteRows = false; + this.dataGridView.AllowUserToOrderColumns = true; + this.dataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; + this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridView.DefaultCellStyle = dataGridViewCellStyle2; + this.dataGridView.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView.Location = new System.Drawing.Point(0, 0); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.ReadOnly = true; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + this.dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; + this.dataGridView.RowHeadersVisible = false; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView.RowsDefaultCellStyle = dataGridViewCellStyle4; + this.dataGridView.Size = new System.Drawing.Size(150, 150); + this.dataGridView.TabIndex = 0; + // + // LogDataGridView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.dataGridView); + this.Name = "LogDataGridView"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView; + } +} Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,59 @@ +using System; +using System.Data; +using System.Windows.Forms; +using System.Collections.Generic; + +namespace LogDataGridView +{ + + public partial class LogDataGridView : UserControl + { + Type systemMessageType = null; + + public LogDataGridView() + { + InitializeComponent(); + } + + private void Init(IList<DataGridViewColumn> columns) + { + foreach(DataGridViewColumn column in columns) + { + dataGridView.Columns.Add(column); + } + } + + private void AddRowInner(Message message) + { + if (systemMessageType == null) + { + systemMessageType = message.GetType(); + Init(message.GetDataGridViewColumns()); + } + if (message.GetType() != systemMessageType) + //TODO: + throw new ArgumentException(); + + + //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE4\xEE\xE1\xE0\xE2\xEB\xFF\xF2\xE8 \xF3 \xEA\xB3\xED\xE5\xF6\xFC + // \xEF\xF0\xEE\xE1\xEB\xE5\xEC\xE0 \xF3 \xF2\xEE\xEC\xF3, \xF9\xEE \xFF \xED\xE5 \xE7\xED\xE0\xFE \xFF\xEA \xE7\xF0\xEE\xE1\xE8\xF2\xE8 \xE0\xE2\xF2\xEE\xEF\xF0\xEE\xEA\xF0\xF3\xF2\xEA\xF3 + dataGridView.Rows.Insert(0, message.GetValues()); + + dataGridView.Rows[0].DefaultCellStyle.BackColor = message.Color; + } + + delegate void AddRowCallback(Message message); + public void AddRow(Message message) + { + if (this.dataGridView.InvokeRequired) + { + AddRowCallback d = new AddRowCallback(AddRow); + this.Invoke(d, new object[] { message }); + } + else + { + AddRowInner(message); + } + } + } +} Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.csproj =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.csproj (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.csproj 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,62 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{263DC481-D532-43CE-AB44-BC99918E5A44}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>LogDataGridView</RootNamespace> + <AssemblyName>LogDataGridView</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="LogDataGridView.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="LogDataGridView.Designer.cs"> + <DependentUpon>LogDataGridView.cs</DependentUpon> + </Compile> + <Compile Include="Message.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SystemMessage.cs" /> + <Compile Include="SystemMessageMode.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="LogDataGridView.resx"> + <DependentUpon>LogDataGridView.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.resx =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.resx (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/LogDataGridView.resx 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Message.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Message.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Message.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,21 @@ +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; + +namespace LogDataGridView +{ + public abstract class Message + { + public abstract IList<DataGridViewColumn> GetDataGridViewColumns(); + public abstract object[] GetValues(); + public virtual Color Color + { + get + { + return Color.Empty; + } + } + } + +} + Property changes on: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/Properties/AssemblyInfo.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("LogDataGridView")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("LogDataGridView")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b6419cf4-71e2-4811-aef9-7f0b9a4ad510")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessage.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessage.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessage.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,192 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; + +namespace LogDataGridView +{ + public class SystemMessage : Message + { + string text; + SystemMessageMode mode; + + + private ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); + private ToolStripMenuItem toolStripMenuItemTime = new ToolStripMenuItem(); + private ToolStripMenuItem toolStripMenuItemText = new ToolStripMenuItem(); + private ToolStripMenuItem toolStripMenuItemMode = new ToolStripMenuItem(); + private void InitContexMenu() + { + contextMenuStrip.Items.AddRange(new ToolStripItem[]{ + toolStripMenuItemTime, + toolStripMenuItemText, + toolStripMenuItemMode}); + contextMenuStrip.Name = "ContexMenoStrip"; + contextMenuStrip.ShowCheckMargin = true; + contextMenuStrip.ShowImageMargin = false; + contextMenuStrip.Size = new Size(180, 92); + + toolStripMenuItemTime.Size = new Size(179, 22); + toolStripMenuItemTime.Text = "Visible Time Column"; + toolStripMenuItemTime.Checked = true; + toolStripMenuItemTime.Click += new EventHandler(toolStripMenuItem_Click); + + toolStripMenuItemText.Size = new Size(179, 22); + toolStripMenuItemText.Text = "Visible Text Column"; + toolStripMenuItemText.Checked = true; + toolStripMenuItemText.Click += new EventHandler(toolStripMenuItem_Click); + + toolStripMenuItemMode.Size = new Size(179, 22); + toolStripMenuItemMode.Text = "Visible Mode Columna"; + toolStripMenuItemMode.Checked = true; + toolStripMenuItemMode.Click += new EventHandler(toolStripMenuItem_Click); + } + + void toolStripMenuItem_Click(object sender, EventArgs e) + { + ToolStripMenuItem toolStrip = (ToolStripMenuItem)sender; + if (toolStrip == toolStripMenuItemTime) + { + if (toolStripMenuItemTime.Checked) + { + columns[0].Visible = false; + toolStripMenuItemTime.Checked = false; + } + else + { + columns[0].Visible = true; + toolStripMenuItemTime.Checked = true; + } + } + if (toolStrip == toolStripMenuItemText) + { + if (toolStripMenuItemText.Checked) + { + columns[1].Visible = false; + toolStripMenuItemText.Checked = false; + } + else + { + columns[1].Visible = true; + toolStripMenuItemText.Checked = true; + } + } + if (toolStrip == toolStripMenuItemMode) + { + if (toolStripMenuItemMode.Checked) + { + columns[2].Visible = false; + toolStripMenuItemMode.Checked = false; + } + else + { + columns[2].Visible = true; + toolStripMenuItemMode.Checked = true; + } + } + } + + IList<DataGridViewColumn> columns; + + public override IList<DataGridViewColumn> GetDataGridViewColumns() + { + InitContexMenu(); + IList<DataGridViewColumn> result = new List<DataGridViewColumn>(); + + DataGridViewColumn column = new DataGridViewTextBoxColumn(); + column.Name = "Time"; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + column = new DataGridViewTextBoxColumn(); + column.Name = "Log text"; + column.MinimumWidth = 150; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + column = new DataGridViewTextBoxColumn(); + column.Name = "Mode"; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + columns = result; + return result; + } + + public SystemMessage(string text, string type) + { + this.text = text; + try + { + this.mode = (SystemMessageMode)Enum.Parse(typeof(SystemMessageMode), type, true); + } + catch (ArgumentException) + { + this.mode = SystemMessageMode.Other; + } + } + public SystemMessage(string text, SystemMessageMode type) + { + this.text = text; + this.mode = type; + } + + + public override object[] GetValues() + { + object[] result = new object[3]; + result[0] = this.Time; + result[1] = this.Text; + result[2] = this.Mode; + return result; + } + + private string Time + { + get + { + DateTime dt = DateTime.Now; + string result = ""; + result += dt.ToShortDateString(); + result += Environment.NewLine; + result += dt.ToLongTimeString(); + result += "."; + result += dt.Millisecond.ToString(); + return result; + } + } + private string Text + { + get + { + return text; + } + } + private string Mode + { + get + { + return mode.ToString(); + } + } + public override Color Color + { + get + { + if (mode == SystemMessageMode.Send) + return Color.LimeGreen; + if (mode == SystemMessageMode.Receive) + return Color.LightGreen; + if (mode == SystemMessageMode.SystemSend) + return Color.LightSkyBlue; + if (mode == SystemMessageMode.SystemReceive) + return Color.LightBlue; + return Color.Empty; + } + } + } + +} Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessageMode.cs =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessageMode.cs (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView/SystemMessageMode.cs 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,11 @@ +namespace LogDataGridView +{ + public enum SystemMessageMode + { + Send, + Receive, + SystemSend, + SystemReceive, + Other + } +} Added: ACMServer/trunk/tasks/LogDataGridView/LogDataGridView.sln =================================================================== --- ACMServer/trunk/tasks/LogDataGridView/LogDataGridView.sln (rev 0) +++ ACMServer/trunk/tasks/LogDataGridView/LogDataGridView.sln 2008-08-18 21:48:42 UTC (rev 335) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogDataGridView", "LogDataGridView\LogDataGridView.csproj", "{263DC481-D532-43CE-AB44-BC99918E5A44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {263DC481-D532-43CE-AB44-BC99918E5A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-08-18 12:27:07
|
Revision: 334 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=334&view=rev Author: Oracle_ Date: 2008-08-18 12:27:16 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Fixed bugs. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-08-18 12:27:16 UTC (rev 334) @@ -249,7 +249,7 @@ HasDF=true; Details="Destricted Function. "; FreeLibrary(hmodCaller); - return false; + return true; } } } @@ -334,12 +334,15 @@ bool DoubleSecure::Init(LPWSTR lpApplicationName) { - return (syssec->Init(lpApplicationName)&&usersec->Init(lpApplicationName)); + bool res=(syssec->Init(lpApplicationName)&&usersec->Init(lpApplicationName)); + this->Details=syssec->Details+usersec->Details; + return res; } bool DoubleSecure::CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) { bool res=usersec->CreateProc(lpApplicationName,bInheritHandles,dwCreationFlags,lpStartupInfo); + this->Details=usersec->Details; if (res) { this->process=usersec->process; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-18 12:27:16 UTC (rev 334) @@ -9,6 +9,7 @@ Runner::Runner(SecureType secure, String^ ProblemPath, String^ ExeFile, String^ TempPath, int WaitForFile) { + SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); //for better testing initlock(); data = gcnew DataLoader(ProblemPath + "ProblemData.txt"); data->Load(); @@ -50,8 +51,10 @@ sec=new SysCallSecure(); else if (SecType==SecureType::Double) sec=new DoubleSecure(); + lock(); String^ oupath=temp+"out"+index.ToString()+".txt"; String^ erpath=temp+"err"+index.ToString()+".txt"; + unlock(); String^ inpath=test->tests[index-1]->InPath; si.cb=sizeof(si); @@ -62,13 +65,23 @@ si.hStdError=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(erpath).ToPointer(),GENERIC_WRITE,FILE_SHARE_WRITE,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); - if (!sec->Init(bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer())) + lock(); + bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer(); + unlock(); + if (!sec->Init(bufW)) { result->res=TestResult::InternalError; result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; Marshal::FreeHGlobal(IntPtr(bufW)); return false; } + if (sec->CheckSecure()) + { + result->res=TestResult::DestrictedFunction; + result->Details=gcnew String(sec->Details.c_str())+" Destricted function."; + Marshal::FreeHGlobal(IntPtr(bufW)); + return false; + } if (!sec->CreateProc(bufW,TRUE,CREATE_SUSPENDED|CREATE_NO_WINDOW|ABOVE_NORMAL_PRIORITY_CLASS,&si)) { Marshal::FreeHGlobal(IntPtr(bufW)); @@ -263,7 +276,9 @@ return true; }finally { + lock(); results[index-1]=result; + unlock(); sec->Finalize(); if (sec!=NULL) delete sec; @@ -328,6 +343,7 @@ Runner::~Runner() { destroylock(); + SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS); } void Runner::initlock() Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-08-18 12:27:16 UTC (rev 334) @@ -80,10 +80,11 @@ void lock(); //locks access to other theads void unlock(); //unlocks access to other threads TestLoader^ testfield; + DataLoader^ datafield; + PluginLoader^ plugfield; public: array<TestRes^>^ results; - DataLoader^ data; - PluginLoader^ plug; + bool TestAll; //set false if break testing after ExecuteTest return false (not AC) SecureType SecType; int CONST_SLEEP; @@ -115,6 +116,50 @@ unlock(); } } + + property DataLoader^ data + { + DataLoader^ get() + { + try + { + lock(); + return datafield; + } finally + { + unlock(); + } + } + + void set(DataLoader^ value) + { + lock(); + datafield=value; + unlock(); + } + } + + property PluginLoader^ plug + { + PluginLoader^ get() + { + try + { + lock(); + return plugfield; + } finally + { + unlock(); + } + } + + void set(PluginLoader^ value) + { + lock(); + plugfield=value; + unlock(); + } + } }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-08-17 23:12:42
|
Revision: 333 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=333&view=rev Author: brus07 Date: 2008-08-17 23:12:52 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Added commented line for easy compiling on different machine. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-17 22:38:37 UTC (rev 332) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-17 23:12:52 UTC (rev 333) @@ -1,4 +1,5 @@ #include "stdafx.h" +//#define _WIN32_WINNT 0x0500 //need for easy compiling on different machine #include "Test.h" #include <windows.h> #include "SecureClass.h" @@ -349,4 +350,4 @@ void Runner::unlock() { LeaveCriticalSection(cs); -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |