Skip to content

Commit

Permalink
Added Client Side config file
Browse files Browse the repository at this point in the history
In this JSON file all data has to be in one line
  • Loading branch information
dustin-H committed Jan 20, 2014
1 parent 23ad474 commit 5450867
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions bin/client/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"serveraddress": "ws://localhost:9343","addressalert": false}
1 change: 1 addition & 0 deletions bin/client/index.html → bin/client/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<title id="title">pragm</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600' rel='stylesheet' type='text/css'>
<script type="text/javascript">var globalconfig = '<?php echo file_get_contents('config.json'); ?>';</script>


<script type="text/javascript" src="script.js"></script>
Expand Down
10 changes: 8 additions & 2 deletions bin/client/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var clientversion = "0.606"/******************************************************************************************
var clientversion = "0.609"/******************************************************************************************
#
# Copyright 2014 Dustin Robert Hoffner
#
Expand Down Expand Up @@ -1603,6 +1603,7 @@ var globalEvent = new globalEvent_typ();


var global_typ = function global_typ(){
this.config = JSON.parse(globalconfig);
this.websocket_server_address_online = 'ws://pragm.dyndns-work.com:9343';
this.websocket_server_address_local = 'ws://localhost:9343';
this.websocket_server_address = 'ws://91.89.70.45:9343';
Expand All @@ -1611,13 +1612,18 @@ var global_typ = function global_typ(){
this.websocket_server_address_array[0] = 'ws://localhost:9343'; //ws://pragm.dyndns-work.com:9300
this.websocket_server_address_array[3] = 'ws://localhost:9342';
this.websocket_server_address_array[2] = 'ws://demo.pragm.de:9342';
this.websocket_server_address_array[1] = 'ws://demo.pragm.de:9343';
this.websocket_server_address_array[1] = 'ws://demo.pragm.de:9343';
this.actualServer = -1;
this.pServer = this.websocket_server_address_array[3];
this.firstConnect = true;
this.firstTry = true;

this.get_websocket_server_address = function(){
if(this.config.addressalert){
return prompt("WebSocket Server:", this.pServer);
} else {
return this.config.serveraddress;
}
if(this.firstTry){
this.firstTry = false;
//return prompt("WebSocket Server:", this.pServer);
Expand Down
4 changes: 2 additions & 2 deletions bin/server/serverBuild.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//Server-Build Version: BETA => 0.606
console.log(""); console.log("pragm-Websocket-Server => BUILD 0.606 BETA"); console.log("");
//Server-Build Version: BETA => 0.609
console.log(""); console.log("pragm-Websocket-Server => BUILD 0.609 BETA"); console.log("");
/******************************************************************************************
#
# Copyright 2014 Dustin Robert Hoffner
Expand Down
8 changes: 7 additions & 1 deletion source/client-side/global_vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


var global_typ = function global_typ(){
this.config = JSON.parse(globalconfig);
this.websocket_server_address_online = 'ws://pragm.dyndns-work.com:9343';
this.websocket_server_address_local = 'ws://localhost:9343';
this.websocket_server_address = 'ws://91.89.70.45:9343';
Expand All @@ -32,13 +33,18 @@ var global_typ = function global_typ(){
this.websocket_server_address_array[0] = 'ws://localhost:9343'; //ws://pragm.dyndns-work.com:9300
this.websocket_server_address_array[3] = 'ws://localhost:9342';
this.websocket_server_address_array[2] = 'ws://demo.pragm.de:9342';
this.websocket_server_address_array[1] = 'ws://demo.pragm.de:9343';
this.websocket_server_address_array[1] = 'ws://demo.pragm.de:9343';
this.actualServer = -1;
this.pServer = this.websocket_server_address_array[3];
this.firstConnect = true;
this.firstTry = true;

this.get_websocket_server_address = function(){
if(this.config.addressalert){
return prompt("WebSocket Server:", this.pServer);
} else {
return this.config.serveraddress;
}
if(this.firstTry){
this.firstTry = false;
//return prompt("WebSocket Server:", this.pServer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<title id="title">pragm</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600' rel='stylesheet' type='text/css'>
<script type="text/javascript">var globalconfig = '<?php echo file_get_contents('config.json'); ?>';</script>

<!-- #buildSoftwareCut# -->

Expand Down

0 comments on commit 5450867

Please sign in to comment.