コード例 #1
0
    public async Task <ImprovedInstantMessageMessage> SendInstantMessage(bool isFromGroup, Guid toAgentId, UInt32 parentEstateId, DialogType dialogType, Guid id, string message, byte[] binaryBucket)
    {
        Guid       agentId       = Session.Instance.AgentId;
        Guid       sessionId     = Session.Instance.SessionId;
        Guid       regionId      = Guid.Empty;   // TODO: Should I ever specify this?
        Vector3    position      = Vector3.zero; // TODO: Should I ever specify this?
        OnlineMode onlineMode    = OnlineMode.Online;
        UInt32     timestamp     = 0;            // TODO: Tests show this as 0
        string     fromAgentName = Agent.CurrentPlayer.DisplayName;

        ImprovedInstantMessageMessage msg = new ImprovedInstantMessageMessage(agentId,
                                                                              sessionId,
                                                                              isFromGroup,
                                                                              toAgentId,
                                                                              parentEstateId,
                                                                              regionId,
                                                                              position,
                                                                              onlineMode,
                                                                              dialogType,
                                                                              id,
                                                                              timestamp,
                                                                              fromAgentName,
                                                                              message,
                                                                              binaryBucket);

        await SendReliable(msg);

        return(msg);
    }
コード例 #2
0
        public ImprovedInstantMessageMessage(Guid agentId,
                                             Guid sessionId,
                                             bool isFromGroup,
                                             Guid toAgentId,
                                             UInt32 parentEstateId,
                                             Guid regionId,
                                             Vector3 position,
                                             OnlineMode onlineMode,
                                             DialogType dialogType,
                                             Guid id,
                                             UInt32 timestamp,
                                             string fromAgentName,
                                             string messageText,
                                             byte[] binaryBucket)
        {
            MessageId = MessageId.ImprovedInstantMessage;
            Flags     = PacketFlags.Reliable; //TODO: Could be zerocoded

            AgentId        = agentId;
            SessionId      = sessionId;
            IsFromGroup    = isFromGroup;
            ToAgentId      = toAgentId;
            ParentEstateId = parentEstateId;
            RegionId       = regionId;
            Position       = position;
            OnlineMode     = onlineMode;
            DialogType     = dialogType;
            Id             = id;
            Timestamp      = timestamp;
            FromAgentName  = fromAgentName;
            MessageText    = messageText;
            BinaryBucket   = binaryBucket;
        }
コード例 #3
0
        public VelocityOfChangeParametersXY(OnlineMode onlineMode, string title = "Brzina promene parametara")
        {
            try
            {
                InitializeComponent();
                this.onMode = onlineMode;
                createChangeOfRGraphic();
                createChangeOfEGraphic();
                createChangeOfRGraphic_Fitting();
                createChangeOfEGraphic_Fitting();

                this.onMode.IsChangeParametersGraphicsOpen = true;
                this.Title = title;

                loadOptionsOnlineManagingOfTTM();
                lineRmax                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.Rmax);
                lineRmax.Stroke          = Brushes.Red;
                lineRmax.StrokeThickness = 2;
                plotterChangeOfR.Children.Add(lineRmax);
                lineRmin                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.Rmin);
                lineRmin.Stroke          = Brushes.Red;
                lineRmin.StrokeThickness = 2;
                plotterChangeOfR.Children.Add(lineRmin);
                double Lc  = 0;
                bool   isN = double.TryParse(LastInputOutputSavedData.tfLc, out Lc);

                lineE2min                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.eR2 * (Lc) * 0.8);
                lineE2min.Stroke          = Brushes.Red;
                lineE2min.StrokeThickness = 2;
                plotterChangeOfE.Children.Add(lineE2min);
                lineE2max                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.eR2 * (Lc) * 1.2);
                lineE2max.Stroke          = Brushes.Red;
                lineE2max.StrokeThickness = 2;
                plotterChangeOfE.Children.Add(lineE2max);
                lineE4min                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.eR4 * (Lc) * 0.8);
                lineE4min.Stroke          = Brushes.Red;
                lineE4min.StrokeThickness = 2;
                plotterChangeOfE.Children.Add(lineE4min);
                lineE4max                 = new HorizontalLine(OptionsInOnlineManagingOfTTM.eR4 * (Lc) * 1.2);
                lineE4max.Stroke          = Brushes.Red;
                lineE4max.StrokeThickness = 2;
                plotterChangeOfE.Children.Add(lineE4max);
                plotterChangeOfR.Legend.Visibility = Visibility.Hidden;
                plotterChangeOfE.Legend.Visibility = Visibility.Hidden;

                //WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

                this.WindowStartupLocation = WindowStartupLocation.Manual;
                this.Left = xconst;
                this.Top  = yconst;
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {public VelocityOfChangeParametersXY(OnlineMode onlineMode, string title = )}", System.DateTime.Now);
            }
        }
        /// <summary>
        /// Coloca o equipamento em modo online informando um servidor já existente)
        /// </summary>
        public StatusResult GoOnline(OnlineMode mode, long serverId)
        {
            ConfigValues config = new ConfigValues(true, true);

            config.general.Online = true;
            config.general.LocalIdentification   = mode == OnlineMode.ReturnUserId ? true : false;
            config.online_client.ExtractTemplate = false; // mode == OnlineMode.ReturnTemplate ? true : false;
            config.online_client.ServerId        = serverId;

            return(SetConfiguration(config));
        }
コード例 #5
0
        public OptionsOnlineChangeOfRAndE(OnlineMode oMode)
        {
            try
            {
                InitializeComponent();
                _onlineMode = oMode;

                LoadOptionsOnlineChangeOfRAndE();
                _onlineMode.IsOptionsForChangeGraphic = true;
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[OptionsOnlineChangeOfRAndE.xaml.cs] {public OptionsOnlineChangeOfRAndE(OnlineMode oMode)}", System.DateTime.Now);
            }
        }
コード例 #6
0
        /// <summary>
        /// Define um servidor, e coloca o equipamento online
        /// </summary>
        public StatusResult SetOnline(OnlineMode mode, string cName, string url)
        {
            var devSRV = new Devices()
            {
                id        = -1,
                name      = cName,
                IP        = url,
                PublicKey = "anA="
            };

            LoadOrSet(-1, devSRV);

            ConfigValues config = new ConfigValues(true, true);

            config.general.Online = true;
            config.general.LocalIdentification   = mode == OnlineMode.ReturnUserId ? true : false;
            config.online_client.ExtractTemplate = false; // mode == OnlineMode.ReturnTemplate ? true : false;
            config.online_client.ServerId        = devSRV.id;

            return(SetConfiguration(config));
        }
コード例 #7
0
        /// <summary>
        /// Configura o equipamento como cliente de um servidor
        /// </summary>
        /// <param name="server_url">IP ou URL completa do servidor</param>
        /// <param name="mode">Modo de operação online</param>
        /// <param name="Overwrite">Apaga server antigo</param>
        public StatusResult ConfigureServer(string server_url, OnlineMode mode, bool Overwrite = false)
        {
            const long serverId = -1;
            Devices    server   = new Devices()
            {
                id = serverId, IP = server_url, name = "Server", PublicKey = "anA="
            };

            if (Overwrite)
            {
                Destroy <Devices>(serverId);
            }

            if (Add(server) == serverId)
            {
                return(GoOnline(mode, serverId));
            }
            else
            {
                return(new StatusResult(500, "Não foi possível incluir o servidor no equipamento"));
            }
        }
コード例 #8
0
        public OptionsOnlineManagingOfTTM(OnlineMode oMode)
        {
            try
            {
                InitializeComponent();
                _onlineMode = oMode;
                LoadOptionsOnlineManagingOfTTM();

                _onlineMode.IsOptionsForManagingOfTTM = true;

                if (OptionsInOnlineMode.isE2E4BorderSelected == true)
                {
                    lblE2Part2.Text = "(R2)";
                }
                else
                {
                    lblE2Part2.Text = "(R3)";
                }
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[OptionsOnlineChangeOfRAndE.xaml.cs] {public OptionsOnlineManagingOfTTM(OnlineMode oMode)}", System.DateTime.Now);
            }
        }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceStartupType"/> class.
 /// </summary>
 /// <param name="onlineMode">The online mode.</param>
 public ServiceStartupType(OnlineMode onlineMode)
 {
     OnlineMode = onlineMode;
 }