commit d3e8551cf846cb4d2c34a4b2a18939e153c87502 Author: KaasKop- Date: Mon Mar 13 14:28:23 2023 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b17aacb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.vs diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..37ebdc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:stable +RUN mkdir -p /srv/http/games +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c64df2d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + web: + image: nginx-gds + build: ./ + volumes: + - ./games:/srv/http/games + ports: + - "6080:80" \ No newline at end of file diff --git a/games/config/nginx.conf b/games/config/nginx.conf new file mode 100644 index 0000000..a803463 --- /dev/null +++ b/games/config/nginx.conf @@ -0,0 +1,89 @@ +worker_processes 6; + +error_log /var/log/nginx/nginx_error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +events { + worker_connections 2048; +} + + +http { + include mime.types; + default_type application/octet-stream; + + client_max_body_size 1G; + + sendfile on; + #tcp_nopush on; + + #keepalive_timeout 0; + keepalive_timeout 65; + + gzip on; + server { + server_name gds.mitchelbv.nl; + access_log /var/log/nginx/guus.mitchelbv.nl; + error_log /var/log/nginx/guus.mitchelbv.nl; + + index index.html; + root /srv/http/games; + + location / { + try_files $uri $uri/ =404; + } + + location ~ .+\.(data|symbols\.json)\.br$ { + # Because this file is already pre-compressed on disk, disable the on-demand compression on it. + # Otherwise nginx would attempt double compression. + gzip off; + add_header Content-Encoding br; + default_type application/octet-stream; + } + + # On-disk Brotli-precompressed JavaScript code files: + location ~ .+\.js\.br$ { + gzip off; # Do not attempt dynamic gzip compression on an already compressed file + add_header Content-Encoding br; + default_type application/javascript; + } + + # On-disk Brotli-precompressed WebAssembly files: + location ~ .+\.wasm\.br$ { + gzip off; # Do not attempt dynamic gzip compression on an already compressed file + add_header Content-Encoding br; + # Enable streaming WebAssembly compilation by specifying the correct MIME type for + # Wasm files. + default_type application/wasm; + } + + # On-disk gzip-precompressed data files should be served with compression enabled: + location ~ .+\.(data|symbols\.json)\.gz$ { + gzip off; # Do not attempt dynamic gzip compression on an already compressed file + add_header Content-Encoding gzip; + default_type application/gzip; + } + + # On-disk gzip-precompressed JavaScript code files: + location ~ .+\.js\.gz$ { + gzip off; # Do not attempt dynamic gzip compression on an already compressed file + add_header Content-Encoding gzip; # The correct MIME type here would be application/octet-stream, but due to Safari bug https://bugs.webkit.org/show_bug.cgi?id=247421, it's preferable to use MIME Type application/gzip instead. + default_type application/javascript; + } + + # On-disk gzip-precompressed WebAssembly files: + location ~ .+\.wasm\.gz$ { + gzip off; # Do not attempt dynamic gzip compression on an already compressed file + add_header Content-Encoding gzip; + # Enable streaming WebAssembly compilation by specifying the correct MIME type for + # Wasm files. + default_type application/wasm; + } + + } + types_hash_max_size 1024; + types_hash_bucket_size 128; +} + + diff --git a/games/game_1/Build/Build.data.gz b/games/game_1/Build/Build.data.gz new file mode 100644 index 0000000..d0b1f06 Binary files /dev/null and b/games/game_1/Build/Build.data.gz differ diff --git a/games/game_1/Build/Build.framework.js.gz b/games/game_1/Build/Build.framework.js.gz new file mode 100644 index 0000000..bc16e6c Binary files /dev/null and b/games/game_1/Build/Build.framework.js.gz differ diff --git a/games/game_1/Build/Build.loader.js b/games/game_1/Build/Build.loader.js new file mode 100644 index 0000000..e38bf6a --- /dev/null +++ b/games/game_1/Build/Build.loader.js @@ -0,0 +1 @@ +function createUnityInstance(t,r,d){function i(e,t){if(!i.aborted&&r.showBanner)return"error"==t&&(i.aborted=!0),r.showBanner(e,t);switch(t){case"error":console.error(e);break;case"warning":console.warn(e);break;default:console.log(e)}}function n(e){var t=e.reason||e.error,r=t?t.toString():e.message||e.reason||"",n=t&&t.stack?t.stack.toString():"";(r+="\n"+(n=n.startsWith(r)?n.substring(r.length):n).trim())&&c.stackTraceRegExp&&c.stackTraceRegExp.test(r)&&C(r,e.filename||t&&(t.fileName||t.sourceURL)||"",e.lineno||t&&(t.lineNumber||t.line)||0)}function e(e,t,r){var n=e[t];void 0!==n&&n||(console.warn('Config option "'+t+'" is missing or empty. Falling back to default value: "'+r+'". Consider updating your WebGL template to include the missing config option.'),e[t]=r)}d=d||function(){};var o,c={canvas:t,webglContextAttributes:{preserveDrawingBuffer:!1,powerPreference:2},cacheControl:function(e){return e==c.dataUrl?"must-revalidate":"no-store"},streamingAssetsUrl:"StreamingAssets",downloadProgress:{},deinitializers:[],intervals:{},setInterval:function(e,t){e=window.setInterval(e,t);return this.intervals[e]=!0,e},clearInterval:function(e){delete this.intervals[e],window.clearInterval(e)},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e),"string"==typeof e&&-1!=e.indexOf("wasm streaming compile failed")&&(-1!=e.toLowerCase().indexOf("mime")?i('HTTP Response Header "Content-Type" configured incorrectly on the server for file '+c.codeUrl+' , should be "application/wasm". Startup time performance will suffer.',"warning"):i('WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file '+c.codeUrl+", but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.","warning"))},locateFile:function(e){return"build.wasm"==e?this.codeUrl:e},disabledCanvasEvents:["contextmenu","dragstart"]};for(o in e(r,"companyName","Unity"),e(r,"productName","WebGL Player"),e(r,"productVersion","1.0"),r)c[o]=r[o];c.streamingAssetsUrl=new URL(c.streamingAssetsUrl,document.URL).href;var a=c.disabledCanvasEvents.slice();function s(e){e.preventDefault()}a.forEach(function(e){t.addEventListener(e,s)}),window.addEventListener("error",n),window.addEventListener("unhandledrejection",n),c.deinitializers.push(function(){for(var e in c.disableAccessToMediaDevices(),a.forEach(function(e){t.removeEventListener(e,s)}),window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",n),c.intervals)window.clearInterval(e);c.intervals={}}),c.QuitCleanup=function(){for(var e=0;eIf using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported in Firefox over HTTP connections. '+n+' See https://bugzilla.mozilla.org/show_bug.cgi?id=1670675 for more information.':"Unable to parse "+c.frameworkUrl+'!
If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported over HTTP connections. Migrate your server to use HTTPS.'),void i(r,"error"))}i("Unable to parse "+c.frameworkUrl+"! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)","error")}var o=unityFramework;unityFramework=null,s.onload=null,a(o)},s.onerror=function(e){i("Unable to load file "+c.frameworkUrl+"! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)","error")},document.body.appendChild(s),c.deinitializers.push(function(){document.body.removeChild(s)})}).then(function(e){e(c)});x(r="dataUrl"),e=c.cacheControl(c[r]),t=c.companyName&&c.productName?c.cachedFetch:c.fetchWithProgress,n=c[r],n=/file:\/\//.exec(n)?"same-origin":void 0;var r,e,t,n,o=t(c[r],{method:"GET",companyName:c.companyName,productName:c.productName,control:e,mode:n,onProgress:function(e){x(r,e)}}).then(function(e){return e.parsedBody}).catch(function(e){var t="Failed to download file "+c[r];"file:"==location.protocol?i(t+". Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.","error"):console.error(t)});c.preRun.push(function(){c.addRunDependency("dataUrl"),o.then(function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0,n="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,e.subarray(r,r+n.length))==n)throw"unknown data format";var o=t.getUint32(r+=n.length,!0);for(r+=4;r + + + + + Unity WebGL Player | StateMachine + + + + +

Game 1 - Statemachine

+

This is the gold 1 achievement of Game Development, the following states are available:

+
    +
  • Idle
  • +
  • Rollin'
  • +
  • Jumping
  • +
    • Double Jump
    +
+ <- Go back +
+ +
+ +
+
+
+
+
+ +
+ + + diff --git a/games/index.html b/games/index.html new file mode 100644 index 0000000..85279ac --- /dev/null +++ b/games/index.html @@ -0,0 +1,9 @@ + + + Games! + + + + Play game 1! + + \ No newline at end of file