Skip to content

Commit

Permalink
Added gumroad link
Browse files Browse the repository at this point in the history
  • Loading branch information
tinspin committed Feb 12, 2022
1 parent 605bdb4 commit ccd8382
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ platform:
license:

- Hybrid, MIT but you have to show the logo on startup,
sponsor the fuse tier on gumroad while you are
sponsor the fuse tier on <a href="http://tinspin.gumroad.com/l/xwluh">gumroad</a> while you are
using this commercially and .html files are
proprietary except the javascript in play.html!

Expand Down
2 changes: 1 addition & 1 deletion res/fuse.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
Competition:
<ul style="list-style-type: none;">
<li>None of the competition has an integrated<br>async-to-async distributed database or web<br>server that can scale across continents<br>or hot-deploy in under 2 seconds.<br><br></li>
<li><a href="https://forums.improbable.io/t/newer-dependencies/3042">SpatialOS</a> (Java, uses netty/akka) <font color="red">80MB total size = x400!</font></li>
<li><a href="https://forums.improbable.io/t/newer-dependencies/3042">SpatialOS</a> (Java, uses netty/akka) <font color="red">80MB total size = x400 and now military only?!</font></li>
<li><a href="http://www.smartfoxserver.com">Goto & Play</a> (Java)</li>
<li><br>None of the systems below can scale on<br>multiple cores across the same room<br>instance:<br><br></li>
<li><a href="http://defunct">Much Different</a> (C#) <font color="red">Defunct</font></li>
Expand Down
19 changes: 13 additions & 6 deletions res/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
Query q = event.query();
String font = q.string("font", "soda");
String host = q.string("host", Router.fuse);
String real = q.header("host");

if(!host.equals(real)) {
host = real;
}

String game = q.string("game", "cube");
String path = q.string("path", game + ".html");
boolean test = q.bit("test", false);
Expand All @@ -43,6 +49,7 @@
<html style="margin: 0px; padding: 0px; height: 100%; min-height: 100%; overflow: hidden;">
<head>
<meta charset="utf-8">
<title>[[ host ]]</title>
<meta name="referrer" content="no-referrer">
<!--meta name="viewport" content="width=300, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"-->
<style>
Expand Down Expand Up @@ -121,7 +128,7 @@
padding: 25px;
}
</style>
<script src="[[ Router.hash.equals("md5") ? "md5" : "sha256" ]].js"></script>
<script src="js/[[ Router.hash.equals("md5") ? "md5" : "sha256" ]].js"></script>
<!-- fuse network code -->
<script>
var agent = (navigator.userAgent.indexOf('Android') > 0 ? 'Android' : 'Other');
Expand Down Expand Up @@ -236,7 +243,7 @@
read(trim);
}
catch(e) {
alert(e);
alert(e + ' ' + body);
}
}
}
Expand Down Expand Up @@ -473,12 +480,12 @@
var pass = '[[ pass ]]';
function user() {
name = id('name');
if(name.length < 3) {
if(name.length < 2) {
show_fail('name too short');
return;
}
//pass = id('pass');
if(pass.length < 3) {
if(pass.length < 4) {
show_fail('pass too short');
return;
}
Expand All @@ -499,12 +506,12 @@
var digits = /^\d+$/;
function hash() {
name = id('name');
if(name.length < 3) {
if(name.length < 2) {
show_fail('name too short');
return;
}
//pass = id('pass');
if(pass.length < 3) {
if(pass.length < 4) {
show_fail('pass too short');
return;
}
Expand Down
16 changes: 10 additions & 6 deletions src/fuse/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,24 @@ public String push(final Event event, String data) throws Event, Exception {
final boolean mail = split.length > 3 && split[3].length() > 0;

if(name) {
if(split[1].length() < 3)
if(split[1].length() < 2)
return "user|fail|name too short";

if(split[1].length() > 12)
return "user|fail|name too long";
/* The distributed name service I'm building
* is going to use 5-bit letters so to fit inside
* an integer we can only have 6 letters.
*/
if(split[1].length() > 6)
return "user|fail|name too long (6)";

if(name && !split[1].matches("[a-zA-Z0-9.\\-]+"))
return "user|fail|name invalid";
if(name && !split[1].matches("[a-zA-Z1-6.\\-]+"))
return "user|fail|name invalid (a-z/1-6)";

if(name && split[1].matches("[0-9]+"))
return "user|fail|name alpha missing"; // [0-9]+ reserved for <id>
}

if(pass && split[2].length() < 3)
if(pass && split[2].length() < 4)
return "user|fail|pass too short";

if(mail && split[3].indexOf("@") < 1 && !split[3].matches("[a-zA-Z0-9.@\\-\\+]+"))
Expand Down

0 comments on commit ccd8382

Please sign in to comment.