Skip to content

Commit 60ff833

Browse files
committed
Webpack and production mode
1 parent 72b1d92 commit 60ff833

File tree

804 files changed

+12952
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

804 files changed

+12952
-80
lines changed

coffee/client/module/World/World.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class World
2121
@neighbours=[[-1, 0, 0],[1, 0, 0],[0, -1, 0],[0, 1, 0],[0, 0, -1],[0, 0, 1]]
2222

2323
#Utworzenie Workera do obliczania geometrii chunków
24-
@chunkWorker=new Worker "/module/World/ChunkWorker.js", {type:'module'}
24+
@chunkWorker=new Worker "chunk.worker.js", {type:'module'}
2525
@chunkWorker.onmessage=(message)->
2626
_this.updateCell message.data
2727
@chunkWorker.postMessage {
@@ -39,7 +39,7 @@ class World
3939
}
4040

4141
#Utworzenie Workera do przekształcania bufforów otrzymanych z serwera
42-
@sectionsWorker=new Worker "/module/World/SectionsWorker.js", {type:'module'}
42+
@sectionsWorker=new Worker "sections.worker.js", {type:'module'}
4343
@sectionsWorker.onmessage=(data)->
4444
result=data.data.result
4545
for i in result
File renamed without changes.
File renamed without changes.

coffee/index.coffee

Lines changed: 0 additions & 7 deletions
This file was deleted.

coffee/server-development.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("./server")("development")

coffee/server-production.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("./server")("production")

coffee/server.coffee

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
module.exports=(config)->
1+
module.exports=(type)->
22
#biblioteki
3+
opn=require "opn"
34
fs=require "fs"
5+
config=JSON.parse fs.readFileSync(__dirname+"/../config.json")
46
http=require "http"
57
server=http.createServer()
68
io=require("socket.io")(server)
@@ -12,13 +14,20 @@ module.exports=(config)->
1214
Convert = require 'ansi-to-html'
1315
convert = new Convert()
1416

17+
18+
19+
opn("http://#{config.host}:#{config['express-port']}")
20+
1521
#początkowe zmienne
1622
sf={}
1723
port=config["express-port"]
1824
socketInfo={}
1925

2026
#Konfiguracja serwera express
21-
app.use express.static(__dirname + "/client/")
27+
if type is "production"
28+
app.use express.static(__dirname + "/../dist/")
29+
else
30+
app.use express.static(__dirname + "/client/")
2231
app.use (req, res, next) ->
2332
res.set 'Cache-Control', 'no-store'
2433
next()

dist/assets/assetLoader.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"steve":{
3+
"path":"assets/textures/steve.png",
4+
"type":"texture"
5+
},
6+
"ghast":{
7+
"path":"assets/textures/ghast.png",
8+
"type":"texture"
9+
},
10+
"ghastS":{
11+
"path":"assets/textures/ghast_shooting.png",
12+
"type":"texture"
13+
},
14+
"blocksMapping":{
15+
"path":"assets/blocks/blocksMapping.json",
16+
"type":"text"
17+
},
18+
"blocks":{
19+
"path":"assets/blocks/blocks.json",
20+
"type":"text"
21+
},
22+
"blocksAtlasFull":{
23+
"path":"assets/blocks/blocksAtlas-full.png",
24+
"type":"image"
25+
},
26+
"blocksMappingFull":{
27+
"path":"assets/blocks/blocksMapping-full.json",
28+
"type":"text"
29+
},
30+
"clouds":{
31+
"path":"assets/models/clouds/clouds.fbx",
32+
"type":"fbx"
33+
},
34+
"ghastF":{
35+
"path":"assets/models/ghast/ghast.fbx",
36+
"type":"fbx"
37+
},
38+
"player":{
39+
"path":"assets/models/player/player.fbx",
40+
"type":"fbx"
41+
},
42+
"anvil":{
43+
"path":"assets/models/anvil/anvil.fbx",
44+
"type":"fbx"
45+
},
46+
"skybox":{
47+
"path":"assets/images/skybox.jpg",
48+
"type":"texture"
49+
},
50+
"websocket-port":{
51+
"path":"/websocket/",
52+
"type":"text"
53+
},
54+
"host":{
55+
"path":"/host/",
56+
"type":"text"
57+
}
58+
}

dist/assets/blocks/blocks.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"0":{
3+
"name":"air",
4+
"isBlock":false
5+
},
6+
"1": {
7+
"name":"grass",
8+
"isBlock":true,
9+
"faces": {
10+
"nx": "grass_block_side",
11+
"ny": "grass_block_top",
12+
"nz": "grass_block_side",
13+
"px": "grass_block_side",
14+
"py": "grass_block_top",
15+
"pz": "grass_block_side"
16+
}
17+
},
18+
"2": {
19+
"name":"stone",
20+
"isBlock":true,
21+
"faces": {
22+
"nx": "stone",
23+
"ny": "stone",
24+
"nz": "stone",
25+
"px": "stone",
26+
"py": "stone",
27+
"pz": "stone"
28+
}
29+
},
30+
"3": {
31+
"name":"oak_planks",
32+
"isBlock":true,
33+
"faces": {
34+
"nx": "oak_planks",
35+
"ny": "oak_planks",
36+
"nz": "oak_planks",
37+
"px": "oak_planks",
38+
"py": "oak_planks",
39+
"pz": "oak_planks"
40+
}
41+
},
42+
"4": {
43+
"name":"smoker",
44+
"isBlock":true,
45+
"faces": {
46+
"nx": "smoker_side",
47+
"ny": "smoker_top",
48+
"nz": "smoker_side",
49+
"px": "smoker_side",
50+
"py": "smoker_top",
51+
"pz": "smoker_front_on"
52+
}
53+
},
54+
"5": {
55+
"name":"anvil",
56+
"isBlock":false,
57+
"model":"anvil"
58+
},
59+
"6": {
60+
"name":"brick",
61+
"isBlock":true,
62+
"faces": {
63+
"nx": "bricks",
64+
"ny": "bricks",
65+
"nz": "bricks",
66+
"px": "bricks",
67+
"py": "bricks",
68+
"pz": "bricks"
69+
}
70+
},
71+
"7": {
72+
"name":"furnace",
73+
"isBlock":true,
74+
"faces": {
75+
"nx": "furnace_side",
76+
"ny": "furnace_top",
77+
"nz": "furnace_side",
78+
"px": "furnace_side",
79+
"py": "furnace_top",
80+
"pz": "furnace_front"
81+
}
82+
},
83+
"8": {
84+
"name":"library",
85+
"isBlock":true,
86+
"faces": {
87+
"nx": "bookshelf",
88+
"ny": "oak_planks",
89+
"nz": "bookshelf",
90+
"px": "bookshelf",
91+
"py": "oak_planks",
92+
"pz": "bookshelf"
93+
}
94+
},
95+
"9": {
96+
"name":"tnt",
97+
"isBlock":true,
98+
"faces": {
99+
"nx": "tnt_side",
100+
"ny": "tnt_bottom",
101+
"nz": "tnt_side",
102+
"px": "tnt_side",
103+
"py": "tnt_top",
104+
"pz": "tnt_side"
105+
}
106+
}
107+
}
393 KB
Loading

0 commit comments

Comments
 (0)