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. |