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); }
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; }
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. }
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); }
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; }
public DataPacket(SentCommand cmd) { this.Cn = string.Format("{0}", (int)cmd); }