Esempio n. 1
0
            public IPromise <Void> ChangeShipNameAndId(string name, string id)
            {
                try
                {
                    var oldId = Aos.Node.ShipId;
                    Aos.Node.ShipAlias = name;
                    Aos.Node.ShipId    = id;
                    _gameContext.Me.UpdateName(Aos.Node.ShipId);

                    if (Aos.Node.IsMainNode)
                    {
                        var nameAndId = new Pair <Primitive <string>, Primitive <string> >
                        {
                            First  = name.AsPrimitive(),
                            Second = id.AsPrimitive()
                        };

                        ShipBroadcast($"T|System.ChangeShipNameAndId|{{{nameAndId.Stringify()}}}", oldId);
                    }

                    _log.Info($"Renamed {oldId} to {Aos.Node.ShipAlias}-{Aos.Node.ShipId}");

                    return(Void.Promise());
                }
                catch (Exception e)
                {
                    _log.Error($"Rename failed: {e}");
                    return(Promise <Void> .FromError(e));
                }
            }
Esempio n. 2
0
            IPromise <Void> _ChangeShipName(Primitive <string> name)
            {
                var oldName = Aos.Node.ShipAlias;

                Aos.Node.ShipAlias = name.Value;
                return(Void.Promise());
            }
Esempio n. 3
0
 public IPromise <Void> ChangeNodeNameAndId(string name, string id)
 {
     Aos.Node.NodeAlias = name;
     Aos.Node.NodeId    = id;
     return(Void.Promise());
 }
Esempio n. 4
0
 IPromise <Void> _UpdatePbTag(Void a)
 {
     return(Void.Promise());
 }
Esempio n. 5
0
 IPromise <Void> _AssignRandomShipId(Void a)
 {
     return(Void.Promise());
 }
Esempio n. 6
0
 IPromise <Void> _ChangeNodeNameAndId(Pair <Primitive <string>, Primitive <string> > nameAndId)
 {
     Aos.Node.NodeAlias = nameAndId.First.Value;
     Aos.Node.NodeId    = nameAndId.Second.Value;
     return(Void.Promise());
 }