Exemplo n.º 1
0
        private void Run()
        {
            serverConnection.Error += (s, e) =>
            {
                var error = e.Error;
                Console.WriteLine($"[Client] Error: {error}");
            };

            serverConnection.Connected += (s, e) =>
            {
                Console.WriteLine($"[Client] Connected");
                serverConnection.RequestChunks();
            };

            serverConnection.Disconnected += (s, e) => { Console.WriteLine($"[Client] Disconnected"); };

            serverConnection.ChunkReceived += (s, e) =>
            {
                var chunk = e.Chunk;
                world.SetChunk(chunk);
            };

            serverConnection.Run();
            window.Run();
        }