public void AddAirplaneToQueueFromServer(Airplane airplane)
 {
     AllPlanesInAirport.Add(airplane);
     AManager.AddAirplane(airplane);
     AService.Invoke("SendAirplaneToClient", airplane);
     SManager.SetAirplaneOnStartingStationAsync(airplane).ContinueWith(t => t.Result.Move());
 }
Beispiel #2
0
    void Start()
    {
        if (ChannelType == NetworkProtocol.TCP)
        {
            m_AService = new TService(Packet.PacketSizeLength2);
        }
        else if (ChannelType == NetworkProtocol.KCP)
        {
            m_AService = new KService();
        }
        else if (ChannelType == NetworkProtocol.WebSocket)
        {
            m_AService = new WService();
        }

        m_AService.DisConnectedCallback += AService_DisConnectedCallback;
    }
Beispiel #3
0
        public override bool Init()
        {
            IdGenerater.AppId = 10;
            if (ChannelType == NetworkProtocol.TCP)
            {
                m_AService = new TService(Packet.PacketSizeLength2, NetHelper.ToIPEndPoint("127.0.0.1", 2500), Accept);
            }
            else if (ChannelType == NetworkProtocol.KCP)
            {
                m_AService = new KService(NetHelper.ToIPEndPoint("127.0.0.1", 2000), Accept);
            }
            else if (ChannelType == NetworkProtocol.WebSocket)
            {
                m_AService = new WService(new string[] { $"http://127.0.0.1:3000/" }, Accept);
            }

            m_AService.DisConnectedCallback += AService_DisConnectedCallback;
            return(base.Init());
        }
Beispiel #4
0
        public void ShouldCallXyzServiceToSendNotification()
        {
            // given
            var             xyzServiceMock = new Mock <IXYZService>();
            ABCNotification notification   = new Filler <ABCNotification>().Create();

            ABCNotificationResponse notificationResponse =
                new Filler <ABCNotificationResponse>().Create();

            xyzServiceMock.Setup(broker => broker.SendNotification(notification))
            .Returns(notificationResponse);

            // when
            var aService = new AService(xyzServiceMock.Object);

            aService.DoStuffA(notification);

            // then
            xyzServiceMock.Verify(
                broker => broker.SendNotification(notification),
                Times.Once);
        }
Beispiel #5
0
        public void Initialize(NetworkProtocol rProtocol)
        {
            this.mSessions = new Dict <long, Session>();

            // 热更新端的初始化
            OpcodeTypes.Instance.Initialize();
            HotfixManager.Instance.InvokeStatic("WindHotfix.Net.NetworkClient", "Initialize");
            this.MessageDispatcher = HotfixManager.Instance.Instantiate("WindHotfix.Net.MessageDispatcher");

            switch (rProtocol)
            {
            case NetworkProtocol.TCP:
                this.mService = new TService();
                break;

            case NetworkProtocol.UDP:
                this.mService = new UService();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
 public string WhoIsA()
 {
     return(AService.WhoAmI());
 }
 public AServiceTests()
 {
     unitOfWork = Substitute.For <IUnitOfWork>();
     service    = Substitute.ForPartsOf <AService>(unitOfWork);
 }
Beispiel #8
0
 public HummingbirdV1CalendarAPIModule(AService service)
     : base()
 {
     Service   = service;
     Supported = true;
 }
 public CustomGroupObject1 WithFromQuery([FromQuery] string id, [FromBody] CustomGroupObj3 body, [FromServices] AService service)
 {
     return(new CustomGroupObject1()
     {
         AnotherStringList = new List <string>()
         {
             id, body.StringProp
         }
     });
 }
 public HummingbirdV1SocialAPIModule(AService service)
     : base()
 {
     Service   = service;
     Supported = true;
 }
Beispiel #11
0
 private void Awake()
 {
     this.Service = new TService(Packet.PacketSizeLength4);
 }
Beispiel #12
0
 //if both services registered in DI then this is used
 public MultiConstructorController(AService aService, AnotherService anotherService)
 {
     _aService           = aService;
     _anotherService     = anotherService;
     this.constuctorused = "constructor 2 used";
 }
Beispiel #13
0
 //if only one service registered in DI then this is used
 public MultiConstructorController(AService aService)
 {
     _aService           = aService;
     this.constuctorused = "consructor 1 used";
 }
 public AConsumer(AService service, AnotherService anotherService)
 {
     Service = service;
     AnotherService = anotherService;
 }
 public ApiResult <string[]> Get([FromServices] AService a)
 {
     return(new string[] { "ok" });
 }
Beispiel #16
0
 void InspectorPage_Loaded(object sender, RoutedEventArgs e)
 {
     HummingbirdV1 = new HummingbirdV1Service("");
 }
 public AConsumer(AService service, AnotherService anotherService)
 {
     Service        = service;
     AnotherService = anotherService;
 }
 public HummingbirdV1MangaAPI(AService service)
     : base()
 {
     Service   = service;
     Supported = false;
 }
 public HummingbirdV1AnimeAPI(AService service)
     : base()
 {
     Service   = service;
     Supported = true;
 }
Beispiel #20
0
 public MainPageVM(AService someConcreteService)
 {
     this.someConcreteService = someConcreteService;
 }