コード例 #1
0
    private void SendDataUnreliableTry(SentCommand command)
    {
        int commandId = command.CommandId + command.MessageId * MaxCommandId;

        command.LastSendTime = Time.time;
        SendPacket(commandId, command.Data, false);
        //Debug.LogFormat ("unreliable try sending command {0} with messageid {1}", command.CommandId, command.MessageId);
    }
コード例 #2
0
        public void SendAuthPacket()
        {
            // TODO:QN=20090516010101001;ST=38;CN=6011;PW=123456;
            // MN=0101A010000000;Flag=1;CP=&&&&
            var p = this.builder.GetAuthPacket();

            this.agent.SendPacket(p);
            this.CurrentSentCommand = SentCommand.Auth;
        }
コード例 #3
0
    private void SendData(int command, RTData data, int messageId)
    {
        //Debug.LogFormat ("sending command {0} with messageid {1}", commandId, messageId);
        CheckCommandId(command);
        SentCommand sentCommand = new SentCommand(command, data, messageId);

        _sentCommands.Add(messageId, sentCommand);
        SendDataUnreliableTry(sentCommand);
        SendDataUnreliableTry(sentCommand);          // Send command twice, redudancy for increasing reliability with no impact on latency.
    }
コード例 #4
0
 public MessageViewModel(MessageView messageView)
 {
     MessageView  = messageView;
     MessageList  = new ObservableCollection <ClientEntity>();
     PaperclipCmd = new PaperclipCommand(messageView, this);
     SmileCmd     = new SmileCommand(this, messageView);
     VoiceCmd     = new VoiceCommand();
     Smile1Cmd    = new Smile1Command(this);
     Smile2Cmd    = new Smile2Command();
     Smile3Cmd    = new Smile3Command();
     Smile4Cmd    = new Smile4Command();
     Smile5Cmd    = new Smile5Command();
     SentCmd      = new SentCommand(this, messageView);
 }
コード例 #5
0
        private void OnServerReply(string msg)
        {
            // TODO:
            string ret = Value.Parse(msg, "ExeRtn");

            if (this.CurrentSentCommand == SentCommand.Auth)
            {
            }
            else if (this.CurrentSentCommand == SentCommand.Data)
            {
            }
            else if (this.CurrentSentCommand == SentCommand.HistoryData)
            {
            }

            // After reply, reset the Current Sent Command
            this.CurrentSentCommand = SentCommand.None;
        }
コード例 #6
0
ファイル: DataPacket.cs プロジェクト: mrddos/planisphere
 public DataPacket(SentCommand cmd)
 {
     this.Cn = string.Format("{0}", (int)cmd);
 }
コード例 #7
0
ファイル: DataHandler.cs プロジェクト: oisy/scada
        private void OnServerReply(string msg)
        {
            // TODO:
            string ret = Value.Parse(msg, "ExeRtn");
            if (this.CurrentSentCommand == SentCommand.Auth)
            {

            }
            else if (this.CurrentSentCommand == SentCommand.Data)
            {

            }
            else if (this.CurrentSentCommand == SentCommand.HistoryData)
            {

            }

            // After reply, reset the Current Sent Command
            this.CurrentSentCommand = SentCommand.None;
        }
コード例 #8
0
ファイル: DataHandler.cs プロジェクト: oisy/scada
 public void SendAuthPacket()
 {
     // TODO:QN=20090516010101001;ST=38;CN=6011;PW=123456;
     // MN=0101A010000000;Flag=1;CP=&&&&
     var p = this.builder.GetAuthPacket();
     this.agent.SendPacket(p);
     this.CurrentSentCommand = SentCommand.Auth;
 }
コード例 #9
0
 public DataPacket(SentCommand cmd)
 {
     this.Cn = string.Format("{0}", (int)cmd);
 }