From: <br...@us...> - 2008-05-05 08:26:49
|
Revision: 85 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=85&view=rev Author: brus07 Date: 2008-05-05 01:26:54 -0700 (Mon, 05 May 2008) Log Message: ----------- ?\208?\148?\208?\190?\208?\180?\208?\176?\208?\189?\208?\184?\208?\185 ?\208?\186?\208?\187?\208?\176?\209?\129 WebConnector, ?\209?\143?\208?\186?\208?\184?\208?\185 ?\208?\188?\208?\176?\209?\148 ?\208?\189?\208?\176?\208?\191?\209?\128?\209?\143?\208?\188?\209?\131 ?\208?\191?\209?\128?\208?\176?\209?\134?\209?\142?\208?\178?\208?\176?\209?\130?\208?\184 ?\209?\150?\208?\183 Web'?\208?\190?\208?\188. ?\208?\134 ?\208?\178?\209?\150?\208?\180?\208?\191?\208?\190?\208?\178?\209?\150?\208?\180?\208?\189?\208?\190 ?\208?\180?\208?\190?\209?\128?\208?\190?\208?\177?\208?\184?\208?\178 ?\208?\186?\208?\187?\208?\176?\209?\129?\208?\184, ?\209?\137?\208?\190 ?\208?\188?\208?\176?\209?\142?\209?\130?\209?\140 ?\208?\183?\208?\178?\209?\143?\208?\183?\209?\131?\208?\178?\208?\176?\209?\130?\208?\184 ?\209?\150?\208?\183 ?\209?\134?\208?\184?\208?\188 (WebGate, WebConnectorSignleton). \Library\Connector\Connector.csproj \Library\Connector\WebConnector.cs \Mediator\Mediator.csproj \Mediator\Library\Connector\WebConnectorSignleton.cs \Mediator\Library\WebGate.cs Modified Paths: -------------- ACMServer/trunk/Library/Connector/Connector.csproj ACMServer/trunk/Mediator/Library/WebGate.cs ACMServer/trunk/Mediator/Mediator.csproj Added Paths: ----------- ACMServer/trunk/Library/Connector/WebConnector.cs ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs Modified: ACMServer/trunk/Library/Connector/Connector.csproj =================================================================== --- ACMServer/trunk/Library/Connector/Connector.csproj 2008-05-04 20:22:37 UTC (rev 84) +++ ACMServer/trunk/Library/Connector/Connector.csproj 2008-05-05 08:26:54 UTC (rev 85) @@ -40,6 +40,7 @@ <Compile Include="SocketClient.cs" /> <Compile Include="SocketServer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WebConnector.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Added: ACMServer/trunk/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/Library/Connector/WebConnector.cs (rev 0) +++ ACMServer/trunk/Library/Connector/WebConnector.cs 2008-05-05 08:26:54 UTC (rev 85) @@ -0,0 +1,24 @@ +using System; + +namespace AcmContester.Library.Connector +{ + public class WebConnector + { + + public delegate void DataArrivedDelegate(string s); + public event DataArrivedDelegate onDataArrived; + + private void DataArrived(object Data) + { + if (onDataArrived != null) + { + onDataArrived(Data.ToString()); + } + } + + public void Send(string message) + { + //TODO: + } + } +} Added: ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs =================================================================== --- ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs (rev 0) +++ ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs 2008-05-05 08:26:54 UTC (rev 85) @@ -0,0 +1,41 @@ +using System; +using AcmContester.Library.Connector; + +namespace Gate.Library.Connector +{ + class WebConnectorSignleton + { + private static WebConnector instance = new WebConnector(); + + private WebConnector connector = new WebConnector(); + + + public delegate void DataArrivedDelegate(string s); + public event DataArrivedDelegate onDataArrived; + + private WebConnectorSignleton() + { + connector.onDataArrived += DataArrived; + } + + public static WebConnector GetWebConnector() + { + return instance; + } + + + public void Send(string message) + { + connector.Send(message); + } + + + private void DataArrived(string message) + { + if (onDataArrived != null) + { + onDataArrived(message); + } + } + } +} Modified: ACMServer/trunk/Mediator/Library/WebGate.cs =================================================================== --- ACMServer/trunk/Mediator/Library/WebGate.cs 2008-05-04 20:22:37 UTC (rev 84) +++ ACMServer/trunk/Mediator/Library/WebGate.cs 2008-05-05 08:26:54 UTC (rev 85) @@ -1,16 +1,23 @@ using System; using AcmContester.Gate.Library.Data; +using Gate.Library.Connector; namespace AcmContester.Gate.Library { class WebGate { + WebConnectorSignleton webConnector = WebConnectorSignleton.GetWebConnector(); + DataMediator mediator = DataMediator.GetMediator(); + public WebGate() + { + webConnector.onDataArrived += DataArrived; + } + public void SendToWeb(Result data) { - //TODO - data.ToString(); + webConnector.Send(data.ToString()); } private void DataArrived(string message) Modified: ACMServer/trunk/Mediator/Mediator.csproj =================================================================== --- ACMServer/trunk/Mediator/Mediator.csproj 2008-05-04 20:22:37 UTC (rev 84) +++ ACMServer/trunk/Mediator/Mediator.csproj 2008-05-05 08:26:54 UTC (rev 85) @@ -43,6 +43,7 @@ <DependentUpon>Form1.cs</DependentUpon> </Compile> <Compile Include="Library\Connector\SocketServerSingleton.cs" /> + <Compile Include="Library\Connector\WebConnectorSignleton.cs" /> <Compile Include="Library\Data\DataMediator.cs" /> <Compile Include="Library\Data\Result.cs" /> <Compile Include="Library\Data\Submit.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-05-05 11:38:49
|
Revision: 86 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=86&view=rev Author: brus07 Date: 2008-05-05 04:38:55 -0700 (Mon, 05 May 2008) Log Message: ----------- ?\208?\148?\208?\190?\209?\128?\208?\190?\208?\177?\208?\187?\208?\181?\208?\189?\208?\184?\208?\185 WebConnector, ?\208?\176?\208?\187?\208?\181 ?\209?\130?\208?\184?\208?\188?\209?\135?\208?\176?\209?\129?\208?\190?\208?\178?\208?\190 ?\208?\183?\209?\128?\208?\190?\208?\177?\208?\187?\208?\181?\208?\189?\208?\190, ?\209?\137?\208?\190 ?\208?\178?\209?\150?\208?\189 ?\208?\177?\208?\181?\209?\128?\208?\181 ?\209?\150?\208?\189?\209?\132?\208?\190?\209?\128?\208?\188?\208?\176?\209?\134?\209?\150?\209?\142 ?\208?\191?\208?\190 ?\209?\130?\208?\176?\208?\185?\208?\188?\208?\181?\209?\128?\209?\131 ?\209?\150?\208?\183 ?\209?\132?\208?\176?\208?\185?\208?\187?\208?\176 a.txt ?\209?\150 ?\208?\191?\208?\184?\209?\136?\208?\181 ?\208?\190?\209?\130?\209?\128?\208?\184?\208?\188?\208?\176?\208?\189?\209?\131 ?\209?\150?\208?\189?\209?\132?\208?\190?\209?\128?\208?\188?\208?\176?\209?\134?\209?\150?\209?\142 ?\209?\131 ?\209?\132?\208?\176?\208?\185?\208?\187?\209?\131 b.txt \AcmContester.sln \Library\Connector\SocketClient.cs \Library\Connector\WebConnector.cs \Mediator\Library\Connector\SocketServerSingleton.cs \Mediator\Library\Connector\WebConnectorSignleton.cs \Mediator\Library\Data\Submit.cs \Mediator\Library\SocketGate.cs \Mediator\Library\WebGate.cs \Mediator\Form1.cs \Tester\Form1.cs Modified Paths: -------------- ACMServer/trunk/AcmContester.sln ACMServer/trunk/AcmContester.suo ACMServer/trunk/Library/Connector/SocketClient.cs ACMServer/trunk/Library/Connector/WebConnector.cs ACMServer/trunk/Mediator/Form1.cs ACMServer/trunk/Mediator/Library/Connector/SocketServerSingleton.cs ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs ACMServer/trunk/Mediator/Library/Data/Submit.cs ACMServer/trunk/Mediator/Library/SocketGate.cs ACMServer/trunk/Mediator/Library/WebGate.cs ACMServer/trunk/Tester/Form1.cs Modified: ACMServer/trunk/AcmContester.sln =================================================================== --- ACMServer/trunk/AcmContester.sln 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/AcmContester.sln 2008-05-05 11:38:55 UTC (rev 86) @@ -1,29 +1,32 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{5AC26E6C-CFBB-4262-B07E-71C9B5288630}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resource", "Resource", "{E6E2D45E-F398-47F2-8A53-85C18D3BD82F}" - ProjectSection(SolutionItems) = preProject - Resource\EasySocket.dll = Resource\EasySocket.dll - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{5AC26E6C-CFBB-4262-B07E-71C9B5288630}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -32,18 +35,10 @@ {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.Build.0 = Debug|Any CPU {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.ActiveCfg = Release|Any CPU {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.Build.0 = Release|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: ACMServer/trunk/AcmContester.suo =================================================================== (Binary files differ) Modified: ACMServer/trunk/Library/Connector/SocketClient.cs =================================================================== --- ACMServer/trunk/Library/Connector/SocketClient.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Library/Connector/SocketClient.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -21,11 +21,13 @@ public void Connect() { - client.ConnectToServerAsync(); + if (client.IsConnected == false) + client.ConnectToServerAsync(); } public void Disconnect() { - client.DisconnectFromServer(); + if (client.IsConnected == true) + client.DisconnectFromServer(); } public void Send(string message) { Modified: ACMServer/trunk/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/Library/Connector/WebConnector.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Library/Connector/WebConnector.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -1,13 +1,35 @@ using System; +using System.Timers; namespace AcmContester.Library.Connector { public class WebConnector { + Timer timer = new Timer(); public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; + public WebConnector() + { + timer.Interval = 10 * 1000; + timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); + timer.Enabled = true; + } + + // Specify what you want to happen when the Elapsed event is + // raised. + private void OnTimedEvent(object source, ElapsedEventArgs e) + { + timer.Enabled = false; + object ob = GetInfoFromSite(); + if (ob != null) + { + DataArrived(ob); + } + timer.Enabled = true; + } + private void DataArrived(object Data) { if (onDataArrived != null) @@ -16,8 +38,37 @@ } } + private 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(message); + } + } + catch (Exception) + { + } //TODO: } } Modified: ACMServer/trunk/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/Mediator/Form1.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Form1.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -32,7 +32,9 @@ private void button2_Click(object sender, EventArgs e) { - socket.Start(); + AcmContester.Gate.Library.SocketGate sg = new AcmContester.Gate.Library.SocketGate(); + AcmContester.Gate.Library.WebGate wg = new AcmContester.Gate.Library.WebGate(); + //socket.Start(); } private void button3_Click(object sender, EventArgs e) Modified: ACMServer/trunk/Mediator/Library/Connector/SocketServerSingleton.cs =================================================================== --- ACMServer/trunk/Mediator/Library/Connector/SocketServerSingleton.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Library/Connector/SocketServerSingleton.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -1,7 +1,7 @@ using System; using AcmContester.Library.Connector; -namespace Gate.Library.Connector +namespace AcmContester.Gate.Library.Connector { //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE7\xF0\xEE\xE1\xE8\xF2\xE8 \xE2\xB3\xE4\xEF\xEE\xE2\xB3\xE4\xED\xE8\xE9 \xB3\xED\xF2\xE5\xF0\xF4\xE5\xE9\xF1, \xF6\xE5\xE9 \xEA\xEB\xE0\xF1 \xB3 SocketServer \xEC\xE0\xFE\xF2\xFC \xE9\xEE\xE3\xEE \xED\xE0\xF1\xEB\xF3\xE4\xB3\xE2\xE0\xF2\xE8 /// <summary> Modified: ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs =================================================================== --- ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Library/Connector/WebConnectorSignleton.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -1,11 +1,11 @@ using System; using AcmContester.Library.Connector; -namespace Gate.Library.Connector +namespace AcmContester.Gate.Library.Connector { - class WebConnectorSignleton + class WebConnectorSingleton { - private static WebConnector instance = new WebConnector(); + private static WebConnectorSingleton instance = new WebConnectorSingleton(); private WebConnector connector = new WebConnector(); @@ -13,12 +13,12 @@ public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; - private WebConnectorSignleton() + private WebConnectorSingleton() { connector.onDataArrived += DataArrived; } - public static WebConnector GetWebConnector() + public static WebConnectorSingleton GetWebConnector() { return instance; } Modified: ACMServer/trunk/Mediator/Library/Data/Submit.cs =================================================================== --- ACMServer/trunk/Mediator/Library/Data/Submit.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Library/Data/Submit.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -20,5 +20,17 @@ { return temp; } + + public override int GetHashCode() + { + //HACK: + int result = 0; + for (int i = 0; i < temp.Length; i++) + { + result *= 991; + result += (int)temp[i]; + } + return result; + } } } Modified: ACMServer/trunk/Mediator/Library/SocketGate.cs =================================================================== --- ACMServer/trunk/Mediator/Library/SocketGate.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Library/SocketGate.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -1,8 +1,8 @@ using System; using AcmContester.Library.Connector; -using Gate.Library.Connector; using AcmContester.AcmLibraryExtention; using AcmContester.Gate.Library.Data; +using AcmContester.Gate.Library.Connector; namespace AcmContester.Gate.Library { Modified: ACMServer/trunk/Mediator/Library/WebGate.cs =================================================================== --- ACMServer/trunk/Mediator/Library/WebGate.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Mediator/Library/WebGate.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -1,12 +1,12 @@ using System; using AcmContester.Gate.Library.Data; -using Gate.Library.Connector; +using AcmContester.Gate.Library.Connector; namespace AcmContester.Gate.Library { class WebGate { - WebConnectorSignleton webConnector = WebConnectorSignleton.GetWebConnector(); + WebConnectorSingleton webConnector = WebConnectorSingleton.GetWebConnector(); DataMediator mediator = DataMediator.GetMediator(); Modified: ACMServer/trunk/Tester/Form1.cs =================================================================== --- ACMServer/trunk/Tester/Form1.cs 2008-05-05 08:26:54 UTC (rev 85) +++ ACMServer/trunk/Tester/Form1.cs 2008-05-05 11:38:55 UTC (rev 86) @@ -19,8 +19,11 @@ private void button1_Click(object sender, EventArgs e) { - socket = new SocketClient(textBox3.Text); - socket.onDataArrived += DataArrived; + if (socket == null) + { + socket = new SocketClient(textBox3.Text); + socket.onDataArrived += DataArrived; + } socket.Connect(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-05-31 10:47:28
|
Revision: 187 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=187&view=rev Author: brus07 Date: 2008-05-31 03:47:36 -0700 (Sat, 31 May 2008) Log Message: ----------- Deleted extra files Modified Paths: -------------- ACMServer/trunk/MediatorSolution/AcmContester.sln ACMServer/trunk/MediatorSolution/AcmContester.suo ACMServer/trunk/TesterSolution/AcmContester.sln ACMServer/trunk/TesterSolution/AcmContester.suo Removed Paths: ------------- ACMServer/trunk/AcmContester.sln ACMServer/trunk/AcmContester.suo ACMServer/trunk/Checker/ ACMServer/trunk/Library/ ACMServer/trunk/Mediator/ ACMServer/trunk/MediatorSolution/Checker/ ACMServer/trunk/MediatorSolution/Tester/ ACMServer/trunk/Resource/ ACMServer/trunk/Tester/ ACMServer/trunk/TesterSolution/Mediator/ ACMServer/trunk/TesterSolution/MediatorSolution/ Deleted: ACMServer/trunk/AcmContester.sln =================================================================== --- ACMServer/trunk/AcmContester.sln 2008-05-31 10:37:41 UTC (rev 186) +++ ACMServer/trunk/AcmContester.sln 2008-05-31 10:47:36 UTC (rev 187) @@ -1,50 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{5AC26E6C-CFBB-4262-B07E-71C9B5288630}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.Build.0 = Release|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.Build.0 = Debug|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.ActiveCfg = Release|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.Build.0 = Release|Any CPU - {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {5AC26E6C-CFBB-4262-B07E-71C9B5288630} - {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {5AC26E6C-CFBB-4262-B07E-71C9B5288630} - EndGlobalSection -EndGlobal Deleted: ACMServer/trunk/AcmContester.suo =================================================================== (Binary files differ) Modified: ACMServer/trunk/MediatorSolution/AcmContester.sln =================================================================== --- ACMServer/trunk/MediatorSolution/AcmContester.sln 2008-05-31 10:37:41 UTC (rev 186) +++ ACMServer/trunk/MediatorSolution/AcmContester.sln 2008-05-31 10:47:36 UTC (rev 187) @@ -7,10 +7,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" EndProject Global @@ -27,14 +23,6 @@ {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.Build.0 = Release|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.Build.0 = Debug|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.ActiveCfg = Release|Any CPU - {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.Build.0 = Release|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU Modified: ACMServer/trunk/MediatorSolution/AcmContester.suo =================================================================== (Binary files differ) Modified: ACMServer/trunk/TesterSolution/AcmContester.sln =================================================================== --- ACMServer/trunk/TesterSolution/AcmContester.sln 2008-05-31 10:37:41 UTC (rev 186) +++ ACMServer/trunk/TesterSolution/AcmContester.sln 2008-05-31 10:47:36 UTC (rev 187) @@ -5,8 +5,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" @@ -23,10 +21,6 @@ {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU Modified: ACMServer/trunk/TesterSolution/AcmContester.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-05-31 10:51:10
|
Revision: 188 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=188&view=rev Author: brus07 Date: 2008-05-31 03:51:16 -0700 (Sat, 31 May 2008) Log Message: ----------- Deleted *.sou files Removed Paths: ------------- ACMServer/trunk/MediatorSolution/AcmContester.suo ACMServer/trunk/TesterSolution/AcmContester.suo Deleted: ACMServer/trunk/MediatorSolution/AcmContester.suo =================================================================== (Binary files differ) Deleted: ACMServer/trunk/TesterSolution/AcmContester.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-05-31 10:56:14
|
Revision: 189 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=189&view=rev Author: brus07 Date: 2008-05-31 03:56:13 -0700 (Sat, 31 May 2008) Log Message: ----------- *.sou files added to ignore list Property Changed: ---------------- ACMServer/trunk/MediatorSolution/ ACMServer/trunk/TesterSolution/ Property changes on: ACMServer/trunk/MediatorSolution ___________________________________________________________________ Name: svn:ignore - *.Load + *.Load *.suo Property changes on: ACMServer/trunk/TesterSolution ___________________________________________________________________ Name: svn:ignore - *.Load + *.Load *.suo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-02 12:05:05
|
Revision: 198 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=198&view=rev Author: brus07 Date: 2008-06-02 05:05:01 -0700 (Mon, 02 Jun 2008) Log Message: ----------- Update protocol version Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs ACMServer/trunk/TesterSolution/Checker/Class1.cs ACMServer/trunk/TesterSolution/Tester/Form1.cs Modified: ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-02 10:56:22 UTC (rev 197) +++ ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-02 12:05:01 UTC (rev 198) @@ -45,7 +45,9 @@ void Send2(string message) { - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://127.0.0.1/d/set.php?res=" + message); + string res = (message.Split(' '))[0]; + string id = (message.Split(' '))[1]; + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://127.0.0.1/d/set.php?res=" + res + "&id=" + id); myRequest.Method = "GET"; myRequest.GetResponse(); /* Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs 2008-06-02 10:56:22 UTC (rev 197) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs 2008-06-02 12:05:01 UTC (rev 198) @@ -6,12 +6,19 @@ class Result { Xml data; + Submit submit; + string temp; + public Result(string message) { //TODO - submit = new Submit(message); + string[] messages = message.Split(' '); + if (messages.Length != 3) + throw new Exception("Result.Result: \xED\xE5\xEF\xF0\xE0\xE2\xE8\xEB\xFC\xED\xE8\xE9 \xF4\xEE\xF0\xEC\xE0\xF2 \xE2\xF5\xB3\xE4\xED\xEE\xBF \xF1\xF2\xF0\xB3\xF7\xEA\xE8"); + temp = messages[0]; + submit = new Submit(messages[1] + " " + messages[2]); } public Submit Submit @@ -25,7 +32,7 @@ public override string ToString() { //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML - return submit.ToString(); + return temp; } } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs 2008-06-02 10:56:22 UTC (rev 197) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs 2008-06-02 12:05:01 UTC (rev 198) @@ -7,12 +7,17 @@ { Xml data; + int id; string temp; public Submit(string message) { //TODO - temp = message; + string[] messages = message.Split(' '); + if (messages.Length != 2) + throw new Exception("Submit.Submit: \xED\xE5\xEF\xF0\xE0\xE2\xE8\xEB\xFC\xED\xE8\xE9 \xF4\xEE\xF0\xEC\xE0\xF2 \xE2\xF5\xB3\xE4\xED\xEE\xBF \xF1\xF2\xF0\xB3\xF7\xEA\xE8"); + id = Convert.ToInt32(messages[0]); + temp = messages[1]; } //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML @@ -24,13 +29,14 @@ public override int GetHashCode() { //HACK: + /* int result = 0; for (int i = 0; i < temp.Length; i++) { result *= 991; result += (int)temp[i]; - } - return result; + }*/ + return id; } } } Modified: ACMServer/trunk/TesterSolution/Checker/Class1.cs =================================================================== --- ACMServer/trunk/TesterSolution/Checker/Class1.cs 2008-06-02 10:56:22 UTC (rev 197) +++ ACMServer/trunk/TesterSolution/Checker/Class1.cs 2008-06-02 12:05:01 UTC (rev 198) @@ -8,6 +8,7 @@ { public static int GetResult(string code) { + code = (code.Split(' '))[1]; int res = 0; for (int i = 0; i < code.Length; i++) { Modified: ACMServer/trunk/TesterSolution/Tester/Form1.cs =================================================================== --- ACMServer/trunk/TesterSolution/Tester/Form1.cs 2008-06-02 10:56:22 UTC (rev 197) +++ ACMServer/trunk/TesterSolution/Tester/Form1.cs 2008-06-02 12:05:01 UTC (rev 198) @@ -42,7 +42,7 @@ { textBox1.Text += "\r\n" + message; int result = Checker.Checker.GetResult(message); - socket.Send(result.ToString()); + socket.Send(result.ToString() + " " + message); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-02 13:33:17
|
Revision: 199 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=199&view=rev Author: brus07 Date: 2008-06-02 06:33:19 -0700 (Mon, 02 Jun 2008) Log Message: ----------- Fixed bug with close form Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/Connector/SocketClient.cs ACMServer/trunk/MediatorSolution/Library/Connector/SocketServer.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs ACMServer/trunk/TesterSolution/Library/Connector/SocketClient.cs ACMServer/trunk/TesterSolution/Library/Connector/SocketServer.cs ACMServer/trunk/TesterSolution/Tester/Form1.cs Modified: ACMServer/trunk/MediatorSolution/Library/Connector/SocketClient.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/SocketClient.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/MediatorSolution/Library/Connector/SocketClient.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -10,17 +10,25 @@ public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; + string ip = "127.0.0.1"; + int port = 4120; + public SocketClient() { } public SocketClient(string IP) { - client = new EasyClient(new ServerInfo(IP, 4120, true)); + this.ip = IP; + client = new EasyClient(new ServerInfo(this.ip, this.port, true)); client.DataArrived += DataArrived; } public void Connect() { + if (client == null) + { + client = new EasyClient(new ServerInfo(this.ip, this.port, true)); + } if (client.IsConnected == false) client.ConnectToServerAsync(); } @@ -28,6 +36,8 @@ { if (client.IsConnected == true) client.DisconnectFromServer(); + client.Dispose(); + client = null; } public void Send(string message) { @@ -42,6 +52,8 @@ } public bool IsConnected() { + if (client == null) + return false; return client.IsConnected; } } Modified: ACMServer/trunk/MediatorSolution/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/SocketServer.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/MediatorSolution/Library/Connector/SocketServer.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -5,8 +5,10 @@ { public class SocketServer { - EasyServer server = new EasyServer(4120,true); + int port = 4120; + EasyServer server; + public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; @@ -14,16 +16,24 @@ public SocketServer() { + server = new EasyServer(port, true); server.DataArrived += new DataArrived2Server_EventHandler(DataArrived); } public void Start() { + if (server == null) + server = new EasyServer(port, true); server.StartListen(); } public void Stop() { - server.StopListen(); + if (server != null) + { + server.StopListen(); + server.Dispose(); + server = null; + } } private void DataArrived(object Data, SocketStream DataSender) Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -43,7 +43,7 @@ private void button3_Click(object sender, EventArgs e) { - // socket.Stop(); + Disconnnect(); } private void DataArrived(string message) @@ -52,9 +52,16 @@ //TODO: doOther } + private void Disconnnect() + { + AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); + SocketServerPlugin b2 = (SocketServerPlugin)socketCreater.GetInstance(); + b2.Stop(); + } + private void Form1_FormClosing(object sender, FormClosingEventArgs e) { - // socket.Stop(); + Disconnnect(); } private void button4_Click(object sender, EventArgs e) Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -40,7 +40,16 @@ internal int CountClients() { + if (server == null) + return 0; return server.CountClients(); } + + internal void Stop() + { + if (server != null) + server.Stop(); + server = null; + } } } Modified: ACMServer/trunk/TesterSolution/Library/Connector/SocketClient.cs =================================================================== --- ACMServer/trunk/TesterSolution/Library/Connector/SocketClient.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/TesterSolution/Library/Connector/SocketClient.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -10,17 +10,25 @@ public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; + string ip = "127.0.0.1"; + int port = 4120; + public SocketClient() { } public SocketClient(string IP) { - client = new EasyClient(new ServerInfo(IP, 4120, true)); + this.ip = IP; + client = new EasyClient(new ServerInfo(this.ip, this.port, true)); client.DataArrived += DataArrived; } public void Connect() { + if (client == null) + { + client = new EasyClient(new ServerInfo(this.ip, this.port, true)); + } if (client.IsConnected == false) client.ConnectToServerAsync(); } @@ -28,6 +36,8 @@ { if (client.IsConnected == true) client.DisconnectFromServer(); + client.Dispose(); + client = null; } public void Send(string message) { @@ -42,6 +52,8 @@ } public bool IsConnected() { + if (client == null) + return false; return client.IsConnected; } } Modified: ACMServer/trunk/TesterSolution/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/TesterSolution/Library/Connector/SocketServer.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/TesterSolution/Library/Connector/SocketServer.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -5,8 +5,10 @@ { public class SocketServer { - EasyServer server = new EasyServer(4120,true); + int port = 4120; + EasyServer server; + public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; @@ -14,16 +16,24 @@ public SocketServer() { + server = new EasyServer(port, true); server.DataArrived += new DataArrived2Server_EventHandler(DataArrived); } public void Start() { + if (server == null) + server = new EasyServer(port, true); server.StartListen(); } public void Stop() { - server.StopListen(); + if (server != null) + { + server.StopListen(); + server.Dispose(); + server = null; + } } private void DataArrived(object Data, SocketStream DataSender) Modified: ACMServer/trunk/TesterSolution/Tester/Form1.cs =================================================================== --- ACMServer/trunk/TesterSolution/Tester/Form1.cs 2008-06-02 12:05:01 UTC (rev 198) +++ ACMServer/trunk/TesterSolution/Tester/Form1.cs 2008-06-02 13:33:19 UTC (rev 199) @@ -29,9 +29,19 @@ private void button2_Click(object sender, EventArgs e) { - socket.Disconnect(); + Disconnect(); } + private void Disconnect() + { + if (socket != null) + { + if (socket.IsConnected() == true) + socket.Disconnect(); + socket = null; + } + } + private void button3_Click(object sender, EventArgs e) { if (socket.IsConnected() == false) @@ -47,9 +57,7 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e) { - if (socket != null) - if (socket.IsConnected() == true) - socket.Disconnect(); + Disconnect(); } private void timer1_Tick(object sender, EventArgs e) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 23:01:20
|
Revision: 237 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=237&view=rev Author: brus07 Date: 2008-06-09 16:01:26 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Edit solutions. Move projects. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt Added Paths: ----------- ACMServer/trunk/ACMServer/ ACMServer/trunk/ACMServer/ACMMediator.sln ACMServer/trunk/ACMServer/ACMTester.sln ACMServer/trunk/ACMServer/Checker/ ACMServer/trunk/ACMServer/Library/ ACMServer/trunk/ACMServer/Mediator/ ACMServer/trunk/ACMServer/Resource/ ACMServer/trunk/ACMServer/SAMPLE/ ACMServer/trunk/ACMServer/Tester/ Removed Paths: ------------- ACMServer/trunk/MediatorSolution/ ACMServer/trunk/TesterSolution/ Property changes on: ACMServer/trunk/ACMServer ___________________________________________________________________ Name: svn:ignore + *.suo *.Load Added: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln (rev 0) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-09 23:01:26 UTC (rev 237) @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{9AC82C0B-F256-41DD-9B4A-A59EC7EB4890}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + EndGlobalSection +EndGlobal Added: ACMServer/trunk/ACMServer/ACMTester.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMTester.sln (rev 0) +++ ACMServer/trunk/ACMServer/ACMTester.sln 2008-06-09 23:01:26 UTC (rev 237) @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{72651BCE-2999-49F0-8B33-4F6E4EE824D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.Build.0 = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.Build.0 = Debug|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.ActiveCfg = Release|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {72651BCE-2999-49F0-8B33-4F6E4EE824D0} + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {72651BCE-2999-49F0-8B33-4F6E4EE824D0} + EndGlobalSection +EndGlobal Copied: ACMServer/trunk/ACMServer/Checker (from rev 236, ACMServer/trunk/TesterSolution/Checker) Copied: ACMServer/trunk/ACMServer/Library (from rev 236, ACMServer/trunk/MediatorSolution/Library) Modified: ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt 2008-06-09 22:33:14 UTC (rev 236) +++ ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt 2008-06-09 23:01:26 UTC (rev 237) @@ -1,2 +1,2 @@ -http://acm.lviv.ua/version3 -http://127.0.0.1/d \ No newline at end of file +http://127.0.0.1/d +http://acm.lviv.ua/version3 \ No newline at end of file Copied: ACMServer/trunk/ACMServer/Mediator (from rev 236, ACMServer/trunk/MediatorSolution/Mediator) Copied: ACMServer/trunk/ACMServer/Resource (from rev 236, ACMServer/trunk/MediatorSolution/Resource) Copied: ACMServer/trunk/ACMServer/SAMPLE (from rev 236, ACMServer/trunk/TesterSolution/SAMPLE) Copied: ACMServer/trunk/ACMServer/Tester (from rev 236, ACMServer/trunk/TesterSolution/Tester) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-21 16:44:32
|
Revision: 272 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=272&view=rev Author: brus07 Date: 2008-06-21 05:59:37 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Start WebProject for web surface. Added Paths: ----------- ACMServer/trunk/web/ ACMServer/trunk/web/connect.php ACMServer/trunk/web/get.php ACMServer/trunk/web/insert.php ACMServer/trunk/web/set.php ACMServer/trunk/web/submit.php ACMServer/trunk/web/table.php Added: ACMServer/trunk/web/connect.php =================================================================== --- ACMServer/trunk/web/connect.php (rev 0) +++ ACMServer/trunk/web/connect.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,4 @@ +<? + @mysql_connect("127.0.0.1", "root", "root"); + + mysql_select_db("test"); Added: ACMServer/trunk/web/get.php =================================================================== --- ACMServer/trunk/web/get.php (rev 0) +++ ACMServer/trunk/web/get.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,11 @@ +<?php + + require_once("connect.php"); + + $Query = "SELECT `id`, `value` FROM `v3_submits` WHERE `result` IS NULL LIMIT 0 , 1;"; + + $result = MySql_Query ($Query); + + while($arr = mysql_fetch_array($result)) { + echo $arr[0]."$".$arr[1]; + } \ No newline at end of file Added: ACMServer/trunk/web/insert.php =================================================================== --- ACMServer/trunk/web/insert.php (rev 0) +++ ACMServer/trunk/web/insert.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,13 @@ +<?php + + require_once("connect.php"); + + if (isset($text)) + { + echo $text; + echo "<p>"; + echo mysql_real_escape_string($text); + $Query = "INSERT INTO `v3_submits` ( `id` , `value` , `result` ) VALUES ('', '".mysql_real_escape_string($text)."', NULL);"; + + $result = MySql_Query ($Query); + } Added: ACMServer/trunk/web/set.php =================================================================== --- ACMServer/trunk/web/set.php (rev 0) +++ ACMServer/trunk/web/set.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,16 @@ +<?php + + require_once("connect.php"); + + if (isset($res) && isset($id)) + { + echo $res; + echo "<p>"; + echo $id; + $res = mysql_real_escape_string($res); + $Query = "UPDATE `v3_submits` SET `result` = \"$res\" WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; + + echo "<p>"; + echo $Query; + $result = MySql_Query ($Query); + } \ No newline at end of file Added: ACMServer/trunk/web/submit.php =================================================================== --- ACMServer/trunk/web/submit.php (rev 0) +++ ACMServer/trunk/web/submit.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,4 @@ +<FORM action = "insert.php" method=post> + Text: <INPUT name=text> + <INPUT type=submit value=\xC2i\xE4i\xF1\xEB\xE0\xF2\xE8> +</FROM> \ No newline at end of file Added: ACMServer/trunk/web/table.php =================================================================== --- ACMServer/trunk/web/table.php (rev 0) +++ ACMServer/trunk/web/table.php 2008-06-21 12:59:37 UTC (rev 272) @@ -0,0 +1,33 @@ +<a href=submit.php>Submit</a><br> +<a href=get.php>Get</a><br> + +<?php + + require_once("connect.php"); + + $Query = "SELECT * FROM `v3_submits` ORDER BY `id` DESC LIMIT 0 , 20;"; + + $result = MySql_Query ($Query); + echo "<table border=1>\n"; + echo "\t<tr>\n"; + echo "\t\t<td>"; + echo "<b>id</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>value</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>result</b>"; + echo "</td>\n"; + echo "\t</tr>\n"; + while($arr = mysql_fetch_array($result)) { + echo "\t<tr>\n"; + for ($i=0; $i<3; $i++) + { + echo "\t\t<td>"; + echo $arr[$i]; + echo "</td>\n"; + } + echo "\t</tr>\n"; + } + echo "</table>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-22 08:35:12
|
Revision: 275 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=275&view=rev Author: brus07 Date: 2008-06-22 01:35:12 -0700 (Sun, 22 Jun 2008) Log Message: ----------- Web surface sending data in XML format. Mediator can read data in XML format and work with submitList. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/web/connect.php ACMServer/trunk/web/get.php Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-06-21 22:33:51 UTC (rev 274) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-06-22 08:35:12 UTC (rev 275) @@ -31,10 +31,13 @@ { if (base.CountClients() > 0) { - Submit submit = new Submit(message); - if (dataContainer.Add(submit) == true) + SubmitList submitList = SubmitList.CreateFromXml(message); + for (int index = 0; index < submitList.Items.Length; index++) { - base.Send(submit.ToString()); + if (dataContainer.Add(submitList.Items[index]) == true) + { + base.Send(submitList.Items[index].ToString()); + } } } } Modified: ACMServer/trunk/web/connect.php =================================================================== --- ACMServer/trunk/web/connect.php 2008-06-21 22:33:51 UTC (rev 274) +++ ACMServer/trunk/web/connect.php 2008-06-22 08:35:12 UTC (rev 275) @@ -1,4 +1,5 @@ <? - @mysql_connect("127.0.0.1", "root", "root"); + @mysql_connect("localhost", "acm", "masterro"); + //@mysql_connect("127.0.0.1", "root", "root"); - mysql_select_db("test"); + mysql_select_db("acm"); Modified: ACMServer/trunk/web/get.php =================================================================== --- ACMServer/trunk/web/get.php 2008-06-21 22:33:51 UTC (rev 274) +++ ACMServer/trunk/web/get.php 2008-06-22 08:35:12 UTC (rev 275) @@ -2,10 +2,22 @@ require_once("connect.php"); - $Query = "SELECT `id`, `value` FROM `v3_submits` WHERE `result` IS NULL LIMIT 0 , 1;"; + $Query = "SELECT `id`, `value` FROM `v3_submits` WHERE `result` IS NULL;"; $result = MySql_Query ($Query); - while($arr = mysql_fetch_array($result)) { - echo $arr[0]."$".$arr[1]; + $arr = mysql_fetch_array($result); + if ($arr != false) + { + header('Content-type: text/xml'); + echo "<?xml version=\"1.0\" encoding=\"utf-16\"?>"; + echo "<submitList xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"; + do{ + echo "<submit>"; + echo "<id>".$arr[0]."</id>"; + echo "<sourceCode>".$arr[1]."</sourceCode>"; + echo "<language>2</language>"; + echo "</submit>"; + }while($arr = mysql_fetch_array($result)); + echo "</submitList>"; } \ 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: <br...@us...> - 2008-06-22 23:19:53
|
Revision: 277 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=277&view=rev Author: brus07 Date: 2008-06-22 16:19:59 -0700 (Sun, 22 Jun 2008) Log Message: ----------- Set minimum length of log message to 5 character. Property Changed: ---------------- ACMServer/trunk/ ACMServer/trunk/ACMServer/ ACMServer/trunk/ACMServer/Checker/ ACMServer/trunk/ACMServer/Checker/Properties/ ACMServer/trunk/ACMServer/Library/ ACMServer/trunk/ACMServer/Library/Connector/ ACMServer/trunk/ACMServer/Library/Connector/Getter/ ACMServer/trunk/ACMServer/Library/Connector/Properties/ ACMServer/trunk/ACMServer/Library/Data/ ACMServer/trunk/ACMServer/Library/Data/Properties/ ACMServer/trunk/ACMServer/Library/LibraryExtention/ ACMServer/trunk/ACMServer/Library/LibraryExtention/Properties/ ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/ ACMServer/trunk/ACMServer/Library/testData/ ACMServer/trunk/ACMServer/Library/testData/Properties/ ACMServer/trunk/ACMServer/Mediator/ ACMServer/trunk/ACMServer/Mediator/Library/ ACMServer/trunk/ACMServer/Mediator/Properties/ ACMServer/trunk/ACMServer/Plugins/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Properties/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties/ ACMServer/trunk/ACMServer/Resource/ ACMServer/trunk/ACMServer/SAMPLE/ ACMServer/trunk/ACMServer/SAMPLE/Temp/ ACMServer/trunk/ACMServer/SAMPLE/Test/ ACMServer/trunk/ACMServer/SAMPLE/Test/test1/ ACMServer/trunk/ACMServer/SAMPLE/Test/test2/ ACMServer/trunk/ACMServer/SAMPLE/includeD7/ ACMServer/trunk/ACMServer/Tester/ ACMServer/trunk/ACMServer/Tester/Properties/ ACMServer/trunk/sharp tester/ ACMServer/trunk/sharp tester/SourceTest/ ACMServer/trunk/sharp tester/TestLibrary/ ACMServer/trunk/sharp tester/tester/ ACMServer/trunk/sharp tester/tester/Properties/ ACMServer/trunk/sharp tester/tester/SAMPLE/ ACMServer/trunk/sharp tester/tester/SAMPLE/Temp/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test1/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test10/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test11/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test12/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test13/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test14/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test15/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test2/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test3/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test4/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test5/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test6/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test7/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test8/ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test9/ ACMServer/trunk/sharp tester/tester/SAMPLE/includeD7/ ACMServer/trunk/tasks/ ACMServer/trunk/web/ Property changes on: ACMServer/trunk ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Checker ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Checker/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/Connector ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/Connector/Getter ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/Connector/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/Data ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/Data/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/LibraryExtention ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/LibraryExtention/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/LibraryExtention/XML ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/testData ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/testData/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Mediator ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Mediator/Library ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Mediator/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/Plugin1/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/PluginsFramework ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Resource ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE/Temp ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE/Test ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE/Test/test1 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE/Test/test2 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/SAMPLE/includeD7 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Tester ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Tester/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/SourceTest ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/TestLibrary ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/Properties ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Temp ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test1 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test10 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test11 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test12 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test13 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test14 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test15 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test2 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test3 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test4 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test5 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test6 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test7 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test8 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/test9 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/sharp tester/tester/SAMPLE/includeD7 ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/tasks ___________________________________________________________________ Name: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/web ___________________________________________________________________ Name: tsvn:logminsize + 5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-23 21:03:59
|
Revision: 279 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=279&view=rev Author: brus07 Date: 2008-06-23 14:02:46 -0700 (Mon, 23 Jun 2008) Log Message: ----------- Transfer to web usedMemory and usedTime in testing result Modified Paths: -------------- ACMServer/trunk/ACMServer/Checker/Class1.cs ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/web/set.php ACMServer/trunk/web/table.php Added Paths: ----------- ACMServer/trunk/web/update.php ACMServer/trunk/web/update3.0.0.1.sql Modified: ACMServer/trunk/ACMServer/Checker/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Checker/Class1.cs 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/ACMServer/Checker/Class1.cs 2008-06-23 21:02:46 UTC (rev 279) @@ -78,6 +78,8 @@ //TODO: Result result = new Result(submit); result.res = TSource.TestResultToString(c.Summary.res.res); + result.usedMemory = c.Summary.res.UsedMemory; + result.usedTime = c.Summary.res.UsedTime; return result.ToStringX(); } public static int GetResult1(string code) Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-23 21:02:46 UTC (rev 279) @@ -39,18 +39,27 @@ { 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; } - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/set.php?res=" + res + "&id=" + id); + 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(); Modified: ACMServer/trunk/web/set.php =================================================================== --- ACMServer/trunk/web/set.php 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/web/set.php 2008-06-23 21:02:46 UTC (rev 279) @@ -8,7 +8,7 @@ echo "<p>"; echo $id; $res = mysql_real_escape_string($res); - $Query = "UPDATE `v3_submits` SET `result` = \"$res\" WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; + $Query = "UPDATE `v3_submits` SET `result` = \"$res\", `usedMemory`=$usedMemory, `usedTime`=$usedTime WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; echo "<p>"; echo $Query; Modified: ACMServer/trunk/web/table.php =================================================================== --- ACMServer/trunk/web/table.php 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/web/table.php 2008-06-23 21:02:46 UTC (rev 279) @@ -51,6 +51,12 @@ echo "\t\t<td>"; echo "<b>result</b>"; echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedMemory</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedTime</b>"; + echo "</td>\n"; echo "\t</tr>\n"; while($arr = mysql_fetch_array($result)) { echo "\t<tr>\n"; @@ -60,6 +66,12 @@ echo $arr[$i]; echo "</td>\n"; } + for ($i=3; $i<5; $i++) + { + echo "\t\t<td>"; + echo $arr[$i]/1000.0; + echo "</td>\n"; + } echo "\t</tr>\n"; } echo "</table>\n"; Added: ACMServer/trunk/web/update.php =================================================================== --- ACMServer/trunk/web/update.php (rev 0) +++ ACMServer/trunk/web/update.php 2008-06-23 21:02:46 UTC (rev 279) @@ -0,0 +1,7 @@ +<?php + + require_once("connect.php"); + + $sql = 'ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL, ADD `usedTime` VARCHAR( 20 ) NOT NULL '; + + $result = MySql_Query ($sql); \ No newline at end of file Added: ACMServer/trunk/web/update3.0.0.1.sql =================================================================== --- ACMServer/trunk/web/update3.0.0.1.sql (rev 0) +++ ACMServer/trunk/web/update3.0.0.1.sql 2008-06-23 21:02:46 UTC (rev 279) @@ -0,0 +1,5 @@ +-- +-- Insert new column to table +-- +ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL , +ADD `usedTime` VARCHAR( 20 ) NOT NULL ; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |