Пример #1
0
        private async Task StartClient(int localWorldId, short portOffset, bool membersWorld)
        {
            Debug.Log($"Starting client.");

            try
            {
                await signlink.startpriv(IPAddress.Parse("127.0.0.1"), new Unity3DResourceCacheLoader());
            }
            catch (Exception e)
            {
                Console.WriteLine($"Failed to load signlink/cache. Reason: {e}");
                throw;
            }

            //Get back onto the main thread.
            if (!RsUnityPlatform.isWebGLBuild)
            {
                await new UnityYieldAwaitable();
            }

            ClientConfiguration configuration = new ClientConfiguration(localWorldId, portOffset, membersWorld);

            RsUnityClient client1 = CreateRsClient(configuration);

            InputObject.InputSubscribable    = client1;
            GraphicsObject.GameStateHookable = client1;
            client1.createClientFrame(765, 503);

            Debug.Log($"Client frame created.");
        }
 public LogOutRunescapeClientOnDisconnectEventListener(INetworkClientDisconnectedEventSubscribable subscriptionService,
                                                       [JetBrains.Annotations.NotNull] IGameContextEventQueueable contextQueueable,
                                                       [JetBrains.Annotations.NotNull] RsUnityClient client)
     : base(subscriptionService)
 {
     Console.WriteLine($"Created LogOutRunescapeClientOnDisconnectEventListener");
     ContextQueueable = contextQueueable ?? throw new ArgumentNullException(nameof(contextQueueable));
     Client           = client ?? throw new ArgumentNullException(nameof(client));
 }
Пример #3
0
        private async Task StartClient(int localWorldId, short portOffset, bool membersWorld)
        {
            Debug.Log($"Starting client.");

            try
            {
                await signlink.startpriv(Endpoint, new Unity3DResourceCacheLoader());
            }
            catch (Exception e)
            {
                Console.WriteLine($"Failed to load signlink/cache. Reason: {e}");
                throw;
            }

            //Get back onto the main thread.
            if (!RsUnityPlatform.isWebGLBuild)
            {
                await new UnityYieldAwaitable();
            }

            //WebGL port is + 1 off normal port for Websocket proxy.
            if (RsUnityPlatform.isWebGLBuild)
            {
                portOffset++;
            }

            ClientConfiguration configuration = new ClientConfiguration(localWorldId, portOffset, membersWorld);

            RsUnityClient client1 = CreateRsClient(configuration);

            InputObject.InputSubscribable    = client1;
            GraphicsObject.GameStateHookable = client1;
            client1.createClientFrame((int)(765 * ResolutionMultiplier), (int)(503 * ResolutionMultiplier));

            Debug.Log($"Client frame created.");
        }
 public Test([NotNull] RsUnityClient client, [NotNull] INetworkSerializationService serializerService)
 {
     Client            = client ?? throw new ArgumentNullException(nameof(client));
     SerializerService = serializerService ?? throw new ArgumentNullException(nameof(serializerService));
 }
 public DespawnRunescapePlayerEventListener(IEntityDeconstructionFinishedEventSubscribable subscriptionService, [JetBrains.Annotations.NotNull] RsUnityClient client,
                                            [JetBrains.Annotations.NotNull] ILog logger)
     : base(subscriptionService)
 {
     Client = client ?? throw new ArgumentNullException(nameof(client));
     Logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public Test([JetBrains.Annotations.NotNull] RsUnityClient client)
 {
     Client = client ?? throw new ArgumentNullException(nameof(client));
 }