Browse Source

got self-hosted website working.

Stephen McQuay 3 years ago
parent
commit
bb5f76cd97
4 changed files with 5741 additions and 13 deletions
  1. 12
    12
      ui/js/arena.js
  2. 1
    1
      ui/js/gorobots_render_webgl.js
  3. 5537
    0
      ui/obj/robot.obj
  4. 191
    0
      ui/obj/rocket.obj

+ 12
- 12
ui/js/arena.js View File

@@ -1,5 +1,5 @@
1 1
 $(document).ready(function(){
2
-    $('#starter,#watch').prop('disabled', 'disabled');
2
+    $('#starter').prop('disabled', 'disabled');
3 3
     $("#error").hide();
4 4
     editor = ace.edit("editor");
5 5
     editor.setTheme("ace/theme/monokai");
@@ -26,21 +26,13 @@ $(document).ready(function(){
26 26
 
27 27
     $('#starter').click(function() {
28 28
         $('#tabs a[href="#arena"]').tab('show');
29
-        var url = "ws://{{ server.hostname }}:8666/ws/";
30 29
         gorobots.set_spectator(false);
31
-        gorobots.set_server(
32
-                url,
33
-                "{{ game }}"
34
-                );
30
+        gorobots.set_server(wsurl(), getGameID());
35 31
     });
36 32
     $('#watch').click(function() {
37 33
         $('#tabs a[href="#arena"]').tab('show');
38
-        var url = "ws://{{ server.hostname }}:8666/ws/";
39 34
         gorobots.set_spectator(true);
40
-        gorobots.set_server(
41
-                url,
42
-                "{{ game }}"
43
-                );
35
+        gorobots.set_server(wsurl(), getGameID());
44 36
     });
45 37
 
46 38
     $('#tabs a[href="#code"]').tab('show');
@@ -60,7 +52,7 @@ function loadCode() {
60 52
         editor.setValue(e);
61 53
         $("#editor").show();
62 54
         $("#fetch-area").hide();
63
-        $('#starter,#watch').prop('disabled', function(i, v) { return !v; });
55
+        $('#starter').prop('disabled', '');
64 56
     }).fail(function(e){
65 57
         var msg = "got a useless error message; is the remote server down?";
66 58
         if (e.statusText != "error") {
@@ -69,3 +61,11 @@ function loadCode() {
69 61
         $("#error").text(msg).show();
70 62
     });
71 63
 }
64
+
65
+function wsurl() {
66
+    return "ws://" + window.location.host + "/ws/";
67
+}
68
+
69
+function getGameID() {
70
+    return window.location.search.split("=")[1];
71
+}

+ 1
- 1
ui/js/gorobots_render_webgl.js View File

@@ -183,7 +183,7 @@ var gorobots_render_webgl = function(){
183 183
         my.robot_geom = new THREE.CubeGeometry(5,5,5);
184 184
 
185 185
         var loader = new THREE.OBJLoader();
186
-        loader.load( '/s/robot.obj', function ( object ) {
186
+        loader.load( '/ui/obj/robot.obj', function ( object ) {
187 187
             object.position.x = 100;
188 188
             object.position.y = 100;
189 189
             object.position.z = 1;

+ 5537
- 0
ui/obj/robot.obj
File diff suppressed because it is too large
View File


+ 191
- 0
ui/obj/rocket.obj View File

@@ -0,0 +1,191 @@
1
+# Blender v2.69 (sub 0) OBJ File: 'rocket.blend'
2
+# www.blender.org
3
+mtllib rocket.mtl
4
+o Cylinder_Cylinder.002
5
+v 0.094494 0.228129 -2.096091
6
+v 0.094494 0.228130 2.096091
7
+v 0.174603 0.174603 -2.096091
8
+v 0.174603 0.174603 2.096091
9
+v 0.228129 0.094494 -2.096091
10
+v 0.228129 0.094494 2.096091
11
+v 0.094494 0.228129 -1.832518
12
+v 0.094494 0.228129 -1.108436
13
+v 0.174603 0.174603 -1.108436
14
+v 0.174603 0.174603 -1.832518
15
+v 0.249110 0.047154 -1.108436
16
+v 0.249110 0.047154 -1.832518
17
+v 0.353101 0.666917 -1.832518
18
+v 0.353101 0.666917 -1.730601
19
+v 0.481025 0.581441 -1.730601
20
+v 0.481025 0.581441 -1.832518
21
+v 0.930706 0.050610 -1.744594
22
+v 0.930706 0.050610 -1.832518
23
+v 0.000000 0.246925 -2.096091
24
+v 0.000000 0.246926 2.096091
25
+v -0.094494 0.228129 -2.096091
26
+v -0.094494 0.228130 2.096091
27
+v -0.174603 0.174603 -2.096091
28
+v -0.174603 0.174603 2.096091
29
+v -0.228129 0.094494 -2.096091
30
+v -0.228129 0.094494 2.096091
31
+v -0.094494 0.228129 -1.832518
32
+v -0.094494 0.228129 -1.108436
33
+v 0.000000 0.246925 -1.108436
34
+v 0.000000 0.246925 -1.832518
35
+v -0.174603 0.174603 -1.108436
36
+v -0.174603 0.174603 -1.832518
37
+v -0.249110 0.047154 -1.108436
38
+v -0.249110 0.047154 -1.832518
39
+v -0.353101 0.666917 -1.832518
40
+v -0.353101 0.666917 -1.730601
41
+v -0.481025 0.581441 -1.730601
42
+v -0.481025 0.581441 -1.832518
43
+v -0.930706 0.050610 -1.744594
44
+v -0.930706 0.050610 -1.832518
45
+v 0.094494 -0.228130 -2.096091
46
+v 0.094494 -0.228129 2.096091
47
+v 0.174603 -0.174603 -2.096091
48
+v 0.174603 -0.174603 2.096091
49
+v 0.228129 -0.094494 -2.096091
50
+v 0.228129 -0.094494 2.096091
51
+v 0.246925 -0.000000 -2.096091
52
+v 0.246925 0.000000 2.096091
53
+v 0.094494 -0.228130 -1.832518
54
+v 0.094494 -0.228129 -1.108436
55
+v 0.174603 -0.174603 -1.108436
56
+v 0.174603 -0.174603 -1.832518
57
+v 0.249110 -0.047154 -1.108436
58
+v 0.249110 -0.047154 -1.832518
59
+v 0.246925 -0.000000 -1.108436
60
+v 0.246925 -0.000000 -1.832518
61
+v 0.353101 -0.666917 -1.832518
62
+v 0.353101 -0.666917 -1.730601
63
+v 0.481025 -0.581441 -1.730601
64
+v 0.481025 -0.581441 -1.832518
65
+v 0.930706 -0.050610 -1.744594
66
+v 0.930706 -0.050610 -1.832518
67
+v 0.927217 -0.000000 -1.744594
68
+v 0.927217 -0.000000 -1.832518
69
+v 0.000000 -0.246926 -2.096091
70
+v 0.000000 -0.246925 2.096091
71
+v -0.094494 -0.228130 -2.096091
72
+v -0.094494 -0.228129 2.096091
73
+v -0.174603 -0.174603 -2.096091
74
+v -0.174603 -0.174603 2.096091
75
+v -0.228129 -0.094494 -2.096091
76
+v -0.228129 -0.094494 2.096091
77
+v -0.246925 -0.000000 -2.096091
78
+v -0.246925 0.000000 2.096091
79
+v 0.000000 0.000000 4.552414
80
+v -0.094494 -0.228130 -1.832518
81
+v -0.094494 -0.228129 -1.108436
82
+v 0.000000 -0.246926 -1.108436
83
+v 0.000000 -0.246926 -1.832518
84
+v -0.174603 -0.174603 -1.108436
85
+v -0.174603 -0.174603 -1.832518
86
+v -0.249110 -0.047154 -1.108436
87
+v -0.249110 -0.047154 -1.832518
88
+v -0.246925 -0.000000 -1.108436
89
+v -0.246925 -0.000000 -1.832518
90
+v -0.353101 -0.666917 -1.832518
91
+v -0.353101 -0.666917 -1.730601
92
+v -0.481025 -0.581441 -1.730601
93
+v -0.481025 -0.581441 -1.832518
94
+v -0.930706 -0.050610 -1.744594
95
+v -0.930706 -0.050610 -1.832518
96
+v -0.927217 -0.000000 -1.744594
97
+v -0.927217 -0.000000 -1.832518
98
+usemtl None
99
+s off
100
+f 29 20 2 8
101
+f 8 2 4 9
102
+f 9 4 6 11
103
+f 11 6 48 55
104
+f 8 9 15 14
105
+f 1 7 10 3
106
+f 30 29 8 7
107
+f 19 30 7 1
108
+f 48 6 75
109
+f 6 4 75
110
+f 4 2 75
111
+f 2 20 75
112
+f 3 10 12 5
113
+f 10 9 11 12
114
+f 5 12 56 47
115
+f 11 55 63 17
116
+f 13 14 15 16
117
+f 10 7 13 16
118
+f 7 8 14 13
119
+f 9 10 16 15
120
+f 18 17 63 64
121
+f 56 12 18 64
122
+f 12 11 17 18
123
+f 29 28 22 20
124
+f 28 31 24 22
125
+f 31 33 26 24
126
+f 33 84 74 26
127
+f 28 36 37 31
128
+f 21 23 32 27
129
+f 30 27 28 29
130
+f 19 21 27 30
131
+f 74 75 26
132
+f 26 75 24
133
+f 24 75 22
134
+f 22 75 20
135
+f 23 25 34 32
136
+f 32 34 33 31
137
+f 25 73 85 34
138
+f 33 39 92 84
139
+f 35 38 37 36
140
+f 32 38 35 27
141
+f 27 35 36 28
142
+f 31 37 38 32
143
+f 40 93 92 39
144
+f 85 93 40 34
145
+f 34 40 39 33
146
+f 78 50 42 66
147
+f 50 51 44 42
148
+f 51 53 46 44
149
+f 53 55 48 46
150
+f 50 58 59 51
151
+f 41 43 52 49
152
+f 79 49 50 78
153
+f 65 41 49 79
154
+f 48 75 46
155
+f 46 75 44
156
+f 44 75 42
157
+f 42 75 66
158
+f 43 45 54 52
159
+f 52 54 53 51
160
+f 45 47 56 54
161
+f 53 61 63 55
162
+f 57 60 59 58
163
+f 52 60 57 49
164
+f 49 57 58 50
165
+f 51 59 60 52
166
+f 62 64 63 61
167
+f 56 64 62 54
168
+f 54 62 61 53
169
+f 78 66 68 77
170
+f 77 68 70 80
171
+f 80 70 72 82
172
+f 82 72 74 84
173
+f 77 80 88 87
174
+f 67 76 81 69
175
+f 79 78 77 76
176
+f 65 79 76 67
177
+f 74 72 75
178
+f 72 70 75
179
+f 70 68 75
180
+f 68 66 75
181
+f 69 81 83 71
182
+f 81 80 82 83
183
+f 71 83 85 73
184
+f 82 84 92 90
185
+f 86 87 88 89
186
+f 81 76 86 89
187
+f 76 77 87 86
188
+f 80 81 89 88
189
+f 91 90 92 93
190
+f 85 83 91 93
191
+f 83 82 90 91

Loading…
Cancel
Save