Converted webclient to use websockets on port 8001. Ideally one would make it so the ajax and websocket clients work under the same django wrapper, but for now this functionality is elusive.

This commit is contained in:
Griatch 2014-06-15 21:58:53 +02:00
parent 2a6cfaca7d
commit ede6634081
11 changed files with 326 additions and 37 deletions

View file

@ -14,12 +14,12 @@
{% if app_list %}
{% for app in app_list %}
{% for app in app_list %}
{% if app.name in evennia_userapps %}
{% if app.name == 'Players' %}
<h2>Admin</h2>
<h2>Admin</h2>
<p><i>Players are the out-of-character representation of a
game account. A Player can potentially control any number of
in-game character Objects (depending on game).</i></p>
@ -49,7 +49,7 @@
<td>&nbsp;</td>
{% endif %}
</tr>
{% endif %}
{% endif %}
{% endfor %}
</table>
@ -58,15 +58,15 @@
{% endif %}
{% endfor %}
<h2>Game entities</h2>
<h2>Game entities</h2>
{% for app in app_list %}
{% for app in app_list %}
{% if app.name in evennia_entityapps %}
{% if app.name == 'Comms' %}
{% if app.name == 'Comms' %}
<p><i>This defines entities that has an in-game precense or
effect of some kind.</i></p>
effect of some kind.</i></p>
{% endif %}
<div class="module">
@ -99,18 +99,18 @@
{% endif %}
{% endfor %}
<h2>Website</h2>
{% for app in app_list %}
<h2>Website</h2>
{% for app in app_list %}
{% if app.name in evennia_websiteapps %}
{% if app.name == 'Flatpages' %}
{% if app.name == 'Flatpages' %}
<p><i>Miscellaneous objects related to the running and
managing of the Web presence.</i></p>
managing of the Web presence.</i></p>
{% endif %}
<div class="module">

View file

@ -9,13 +9,26 @@
<link rel='stylesheet' type="text/css" media="screen" href="/media/css/webclient.css">
<!-- Importing the online jQuery javascript library -->
<script src="http://code.jquery.com/jquery-1.6.1.js" type="text/javascript" charset="utf-8"></script>
<!--script src="http://code.jquery.com/jquery-1.6.1.js" type="text/javascript" charset="utf-8"></script-->
<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
<!--for offline testing, download the jquery library from jquery.com-->
<!--script src="/media/javascript/jquery-1.4.4.js" type="text/javascript" charset="utf-8"></script-->
<!--script src="/media/javascript/jquery-1.11.1.js" type="text/javascript" charset="utf-8"></script-->
{% if websocket_enabled %}
<script language="javascript" type="text/javascript">
if ("WebSocket" in window) {
<!-- Importing the Evennia websocket webclient component (requires jQuery) -->
document.write("\<script src=\"/media/javascript/evennia_websocket_webclient.js\" type=\"text/javascript\" charset=\"utf-8\"\>\</script\>")}
else {
<!-- Importing the Evennia ajax webclient component (requires jQuery) -->
document.write("\<script src=\"/media/javascript/evennia_ajax_webclient.js\" type=\"text/javascript\" charset=\"utf-8\"\>\</script\>")}
</script>
{% else %}
<!-- websocket not enabled; use ajax -->
<script src="/media/javascript/evennia_ajax_webclient.js" type="text/javascript" charset="utf-8"></script>
{% endif %}
<!-- Importing the Evennia ajax webclient component (requires jQuery) -->
<script src="/media/javascript/evennia_webclient.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
@ -38,7 +51,7 @@
</div>
<form id="inputform" action="javascript:void(0);">
<div id="playercount">Logged in Players: {{num_players_connected}}</div>
<div id="inputcontrol"><input type="text" id="inputfield" autocomplete="off"><input id="inputsend" type="button" value="send" onClick="webclient_input()" /></div>
<div id="inputcontrol"><input type="text" id="inputfield" autocomplete="off"><input id="inputsend" type="button" value="send" onClick="doSend()" /></div>
</form>
</div>