From: <an...@us...> - 2007-08-16 05:22:47
|
Revision: 841 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=841&view=rev Author: and-81 Date: 2007-08-15 22:22:46 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -28,7 +28,6 @@ static string _localPipeName; static string _blastPort = "None"; - static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -66,10 +65,6 @@ _blastPort = args[++index]; continue; - case "-speed": - _blastSpeed = args[++index]; - continue; - case "-channel": _treatAsChannelNumber = true; continue; @@ -126,14 +121,14 @@ foreach (char digit in channelNumber.ToString()) { - if (digit == '~') + if (digit.Equals('~')) { Thread.Sleep(500); } else { fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } } @@ -144,7 +139,7 @@ else { fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } @@ -512,18 +507,16 @@ } } - static void BlastIR(string fileName, string port, string speed) + static void BlastIR(string fileName, string port) { FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - byte[] outData = new byte[8 + port.Length + speed.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(speed.Length).CopyTo(outData, 4 + port.Length); - Encoding.ASCII.GetBytes(speed).CopyTo(outData, 8 + port.Length); - file.Read(outData, 8 + port.Length + speed.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -29,7 +29,6 @@ static string _localPipeName; static string _blastPort = "None"; - static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -65,10 +64,6 @@ _blastPort = args[++index]; continue; - case "-speed": - _blastSpeed = args[++index]; - continue; - case "-channel": _treatAsChannelNumber = true; continue; @@ -125,14 +120,14 @@ foreach (char digit in channelNumber.ToString()) { - if (digit == '~') + if (digit.Equals('~')) { Thread.Sleep(500); } else { fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } } @@ -143,7 +138,7 @@ else { fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } @@ -474,18 +469,16 @@ } } - static void BlastIR(string fileName, string port, string speed) + static void BlastIR(string fileName, string port) { FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - byte[] outData = new byte[8 + port.Length + speed.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(speed.Length).CopyTo(outData, 4 + port.Length); - Encoding.ASCII.GetBytes(speed).CopyTo(outData, 8 + port.Length); - file.Read(outData, 8 + port.Length + speed.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -1005,7 +1005,8 @@ break; } - SendToRepeaters(received); + if (_registeredRepeaters.Count > 0) + SendToRepeaters(received); PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); Modified: trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -33,13 +33,16 @@ ForwardMouseEvent, } - public enum MessageType + [Flags] + public enum MessageTypes { - Request, - Response, - Success, - Failure, - Other, + None = 0, + Request = 1, + Response = 2, + Success = 4, + Failure = 8, + DoResponse = 16, + DontRespond = 32, } */ #endregion Enumerations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |