Giter Site home page Giter Site logo

greggman / happyfuntimes Goto Github PK

View Code? Open in Web Editor NEW
381.0 27.0 55.0 58.57 MB

A System for creating 10-100+ player local games

Home Page: http://greggman.github.io/HappyFunTimes

License: BSD 3-Clause "New" or "Revised" License

JavaScript 68.89% HTML 4.31% CSS 26.80%
game happyfuntimes localmultiplayer games smartphone

happyfuntimes's Introduction

HappyFunTimes

DEPRECATED

I'm deprecating happyfuntimes. I'll keep the rendevous server running for a while longer but I think it's unfortunately time to mostly depreciate this project

i'll consider accepting PRs still if you want to fix something but otherwise just fork it if you want to keep using it

Issues

There are a few major issues on why

  1. device orientation is no longer usable

    Both Safari and Chrome have made getting device orientation require HTTPS which is something HFT can't provide at the moment. It would require $$$$$$$. If a end-user friendly solution comes up maybe I'll revisit

  2. Browsers break stuff

    Every year or so a browser changes something or breaks something. Over the course of HTF browser broke fullscreen support, audio support, touch support, orientation support, and other things. It's no fun to keep up on that

  3. OSes break stuff

    For whatever reason networking that work before stops working. HFT has to do some things to find out all the ways your phone might connect to the game and that stuff seems to break every 2 years or so

  4. Offline Support breaks

    Using HFT without internet breaks every few year and will likely eventually be unfixable. Both iOS and Android ping Apple and Google respectively when you connect to WiFi to check if you're acutally on the internet. HFT tries to send them fake data so they believe they are, otherwise they'll stop using the WiFi and switch to mobile.

    How they do this changes every few years so HFT has to figure out how to change its faking. It is within Apple and Google's power to make this faking impossible and I supsect they might at sometime which is scary because if they do then there is no solution (well, short of acutally providing internet access)

  5. More browser features require HTTPS

    This is really #1 and #2 repeated but more and more browser features require HTTPS and as it says above there is no way for hft to provide HTTPS at the moment.

Good news

If you don't need device orientation and you have no need for offline mode/installation mode then HFT still works. Write your own controllers to keep up to date with the latest changes in the browsers.

Bad news

I don't really have time to keep it running.

Build Status

Want to play?

Make games with Unity?

Make games with HTML5?

Docs

Other

Support

HappyFunTimes is a system for playing party games that are meant to be played with a bunch of people in the same room and 1 ideally large display.

People participate in the game using their smartphone by going to a webpage provided by the game. The webpage lets them use their phone as a controller. This lets you make games that support more than the typical 4 players.

I suppose theoretically there's no limit to the number of players.

It also lets you make games with unique controllers.

There's a Unity3D library if you'd like to make the game in Unity3D.

  • The smartphones end up just being smart controllers.

    As there is just one machine running the real game this means they are relatively easy to create. No crazy networking, state syncing, or dead reckoning required.

  • JavaScript libraries for the browser and Unity3D libraries are provided

    This makes it easy to bang out a game. Use any JavaScript framework or Unity3D.

  • For controllers the sky is the limit.

    • Have a one button game. The user touches their screen.

    • Make virtual DPads

    • Make virutal paddle controllers (think Pong)

    • Have users choose answers to question like Jeopardy

    • Access the camera, send selfies to the game.

    • Emit sound effects from the phone

    • Use the device orientation API and rotate something in game to match

    • Make a rhythm band where each device becomes an instrument.

    • Make a rhythm game like Parappa but each person is a different color so that they each have to play their part at the right time

    • Let the user draw something on their phone. Insert that drawing into the game.

    • Show diagrams. Let the user plan out football plays.

    • Controllers can change dynamically.

      Have 2 dpads for the dual stick part of your game. Have a single button for the speed contest. Change to a 3 letter box to let a player enter their high score initials.

  • The API is simple to use (for some defintion of simple :D).

    Games create a GameServer object

    var server = new GameServer();

    From that point on anytime a player connects the GameServer will emit an event playerconnect

    server.addEventListener('playerconnect', createNewPlayer);

    It's up to you what to do when a new player connects. For example if you had a Player object you might do something like this

    var players = [];

    Player = function(netPlayer) { this.netPlayer = netPlayer; // remember this Player's NetPlayer };

    // make a new Player anytime the 'playerconnect' event is emitted function createNewPlayer(netPlayer) { players.push(new Player(netPlayer)); }

    If the player disconnects or quits the NetPlayer will emit a disconnect event. If we want to handle that we might do something like

    Player = function(netPlayer) {
      this.netPlayer = netPlayer;  // remember this Player's NetPlayer
    
      netPlayer.addEventListener('disconnect', Player.prototype.remove.bind(this));
    };
    
    Player.prototype.remove = function() {
      players.splice(players.indexOf(this), 1);  // remove ourselves from our array of players.
    };
    

    We can send events to the player's phone by calling netPlayer.sendCmd For example

    Player.prototype.score = function(points) {
      this.netPlayer.sendCmd('score', {points: points});
    };
    

    That will cause an event score to be emitted on the player's phone. The player's phone has a correspondiing sendCmd function. When called an event will be emitted on that player's NetPlayer object. Add listeners for any events you make up

    Player = function(netPlayer) {
      this.netPlayer = netPlayer;  // remember this Player's NetPlayer
    
      netPlayer.addEventListener('disconnect', Player.prototype.remove.bind(this));
      netPlayer.addEventListener('moveleft', Player.prototype.moveleft.bind(this));
      netPlayer.addEventListener('moveright', Player.prototype.moveright.bind(this));
      netPlayer.addEventListener('jump', Player.prototype.jump.bind(this));
    };
    

    Whatever data you pass to sendCmd will arrive with the event.

    ...
    this.netPlayer.sendCmd('die', {
      reason: "So and so killed you",
      pointsToLose: 100,
    });
    

    On the phone we create a GameClient

    var client = new GameClient();
    

    Just like NetPlayer above we can listen for events.

    client.addEventListener('die', handleDie);
    
    function handleDie(data) {
      console.log("you lost", data.pointsToLose, "points. Reason:", data.reason);
    }
    

    Similarly you can send events to the game

    window.addEventListener('pointerdown', function(e) {
       client.sendCmd('jump', { power: e.mouseY });
    });
    

    It's up to you to decide which events to send and receive for your particular game's needs.

  • There is also a synchronized clock across machines.

    Use it as follows.

    var online = true;
    var clock = SyncedClock.createClock(online);
    
    ...
    
    var timeInSeconds = clock.getTime();
    

    If online is false when the clock is created it will create a clock that returns the local time.

Limitations

The number of players that can connect to a game is limited by your networking equipment. With enough access points there's no limit to the number of player that could connect that I know of but of course 1000s of players would require lots of access points and lots of bandwidth and a game design that lets 1000s of people actually participate.

Another limit in the default mode is players must be on the same network behind a NAT. This is standard for most if not all home routers. It's probably less standard in office setups. In this mode you start HappyFunTimes, tell your users to connect to your WiFi and then have them go to happyfuntimes.net.

HappyFunTimes has the option to run it's own DNS which is another option but requires configuring your router. This option is probably more suited to events, installations, and things like that. In this mode, players connect to the WiFi specificaly setup to run HappyFunTimes. iOS devices will automatically find HappyFunTimes once connected to the WiFi, no other interaction required by the user. Android devices require the user to first connect to the WiFi and then go to any random url like hft.com or h.com.

Notes

  • How secure is this?

    Not at all. This is not a library for the internet. It's a library for running a game at a party, meeting, bar, etc...

    That said if there's anything easy and performant you'd like to suggest submit a pull request.

  • What about cheating?

    Again, this is meant for games where everyone is in the same room watching the same display. If someone is off in the corner trying to hack the game through the net maybe you shouldn't have invited them to your party.

    That said if there's anything easy and performant you'd like to suggest submit a pull request.

  • Does it work on Windows, OSX, and Linux?

    The controllers of course run in any modern browser. Games run in whatever environment you've created them for. Most of the samples here are HTML and so should run in any modern browser on any platform.

    As for happyFunTimes I've run it on OSX, Linux and Windows with no problems.

  • Why not WebRTC?

    WebRTC would possibly allow the phones to talk directly the game rather than through the happyfuntimes. happyfuntimes would need to setup a rendevous between the 2 machines but after that the conncetion should be peer to peer.... Or so I'm lead to believe. WebRTC still doesn't currently exist in iOS Safari as of iOS8. It does exist in Chrome.

    Feel free to submit a pull request ;-)

To Do

There's lots of ideas.

happyfuntimes's People

Contributors

amelzer avatar greggman avatar kovah avatar minimapletinytools avatar wyattscarpenter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

happyfuntimes's Issues

Chromecast

Idea without having done research on it yet: I wonder if Chromecast would be able to act as the server and display.

SoundTestScene not playing sounds on devices.

Here's the error I get in chrome's console

Uncaught TypeError: audioManager.loadSounds is not a function
    at r.handleLoadSounds (controller.js:209)
    at r.<anonymous> (hft-min.js:1)
    at r.g (hft-min.js:1)
    at WebSocket.t.onmessage (hft-min.js:1)

Using Unity 5.6.1.

Run hft without electron

Hi there, I'm wondering how to run hft game without electron? I'm using cocos as client game engine but got this error:

:7456/build/src/project.js:1 WebSocket connection to 'ws://localhost:7456/' failed: Connection closed before receiving a handshake response

I'd like to know how to start websocket server if not using electron but a hosted web page?

Inform Co-routine failing in Unity 2017

HappyFunTimes informs happyfuntimes.net of a running server in Informer.InformCoroutine() by sending a www message with custom headers. In Unity 2017, trying to manually set a "Host" header will throw an exception: (InvalidOperationException: Cannot override system-specified headers).

Removing the host header will cause the exception to go away, but then the game never registers itself because the server is returning error 503 (probably because the host header is expected server-side).

Since the host header isn't getting set automatically client-side due to usage of a direct ip address, I added an Informer object that just used the happyfuntimes.net hostname, without converting that to a IPv4 or v6 address. This sets the host-header correctly, and so registers the game correctly and everything is happy and fun again.

Probably this might warrant a proper fix though, since I assume the direct IP conversion was done for a reason...

HFT Redirects Multiple Times on Game Join

I'm running my game in Unity, with the Installation mode checked through Unity. I have a home router that I connect to, and this issue happens even when I connect on mobile, or directly go to localhost:18679 on the running computer's browser.

Whenever a player joins the game by going to the website, the screen will flash between the "Switching Game" blue screen, and the default brownish controller screen (which I'm using). As this happens, I get an error message and log message in Unity (attached). Sometimes it will redirect only 10 times, others might take longer - 50 or so. This only happens for the first player to connect, and the second player will connect instantly. My guess is that the game hasn't been set up in the first X seconds by then, and it's still trying get set up while the player is connecting.

hfterrormessage
hftlogmessage

Allow multiple HFT on same network

I understand this isn't yet supported yet, but I would like to help work on it. Are there any limitations you foresee? Any hints that could point me in the right direction would be awesome!

default controllers seem laggy/broken in different ways on current mobile browsers

When I load the 'platform' test scene, on latest Chrome on an Android phone, the A/B buttons are sticky and do not get reset until another button elsewhere on the pad is pressed (e.g. the d-pad).

On an ipad, the jump buttons are not sticky (they return to an unpressed state), but ~15-30% of inputs seem to be lost.

Interestingly, when I load the 'touch' test scene, both devices show smooth, generally non-laggy, loss-free tracking of the finger moves.

The server in these cases is the most recent HFT, running on OSX, with latest HFT plugin running in Unity 5.1.1f. If there's any other debugging info I could provide, happy to help.

Custom URL

I was wondering if it was possible to recreate the functionality of your HappyFunTimes Redirector? I basically want to keep that branded in line with the game.

Is there any info you could give on this?

'GameClient: unknown event' while sending message to controller

I followed the docs on sending messages from the game to the phones and implemented the following code:

game.js

player.netPlayer.sendCmd('roundStart', data)

controller.js

function onRoundStart() {
    //
}

var g_client = new GameClient();
g_client.addEventListener('roundStart', onRoundStart());

However, I get the following error in the console after the message arrived on the phone:
GameClient: unknown event: roundStart

Am I doing something wrong? I already tried other spellings like round-start and roundstart but none worked. Do I have to add custom events anywhere?

not working on XP

It's not working on XP. It gets the following error

C:\Documents and Settings\gregg>hft list
path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.win32.join (path.js:221:5)
    at getConfigPath (C:\Documents and Settings\gregg\Local Settings\Application
 Data\Greggman\HappyFunTimes\lib\config.js:57:15)
    at Object.<anonymous> (C:\Documents and Settings\gregg\Local Settings\Applic
ation Data\Greggman\HappyFunTimes\lib\config.js:61:15)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)

Can't get unity example to work

Trying to follow the instructions in unitydocs.md.

At step 3, "Standard Assets" is not one of the available options in Unity 4.3.4f1.

After steps 4-7 my unity project has this folder structure:

/Assets/Plugins/websocket-sharp.dll
/Assets/Plugins/HappyFunTimes/ClientMessageArgs.cs
/Assets/Plugins/HappyFunTimes/EventProcessor.cs
/Assets/Plugins/HappyFunTimes/GameServer.cs
/Assets/Plugins/HappyFunTimes/MessageCmd.cs
/Assets/Plugins/HappyFunTimes/NetPlayer.cs
/Assets/Plugins/HappyFunTimes/PlayerConnectMessageArgs.cs
/Assets/Plugins/HappyFunTimes/PlayerDisconnectMessageArgs.cs
/Assets/Plugins/HappyFunTimesExtra/CSSParse.cs
/Assets/Plugins/HappyFunTimesExtra/DeJson.cs
/Assets/Plugins/HappyFunTimesExtra/MiniJSON.cs
/Assets/Scripts/HappyFunTimes/DPadEmuJS.js
/Assets/Scripts/HappyFunTimes/Example3rdPersonController.js
/Assets/Scripts/HappyFunTimes/ExampleBasicMaterial.mat
/Assets/Scripts/HappyFunTimes/ExampleCharacterGameSettings.cs
/Assets/Scripts/HappyFunTimes/ExampleCharacterMultiPlayerCamera.js
/Assets/Scripts/HappyFunTimes/ExampleCharacterSpawner.js
/Assets/Scripts/HappyFunTimes/ExampleSimple.cs
/Assets/Scripts/HappyFunTimes/ExampleSimpleGameSettings.cs
/Assets/Scripts/HappyFunTimes/ExampleSimpleGoal.cs
/Assets/Scripts/HappyFunTimes/ExampleSimplePlayer.cs
/Assets/Scripts/HappyFunTimes/Prefabs/Prefab Example 3rd Person Controller.prefab
/Assets/Scripts/HappyFunTimes/Prefabs/PrefabForExampleSimple.prefab
/Assets/Scripts/HappyFunTimes/Scenes/HappyFunTimesCharacterExample.unity
/Assets/Scripts/HappyFunTimes/Scenes/HappyFunTimesSimpleExample.unity

At step 8, opening HappyFunTimesCharacterExample.unity reveals that the Main Camera and ExampleCharacterController game objects have missing scripts. In the inspector, each missing script has this error:
"The associated script cannot be loaded. Please fix any compile errors and assign a valid script."
There are no compile errors, but when trying to play the scene the warning "The referenced script on this Behavior is missing!" appears in the console for each missing script.

With the relay server running, the UnityCharacterExample link on http://localhost:8080/games.html points to http://localhost:8080/%(gameUrl)s which results in a 404 error.

Looking for executable with wrong name on Linux (Unity3D)

When I download and want to play a HFT Unity game on Linux, then HFT wants to start "[name]-linux", instead of "[name]-linux.x86", saying "native game does not exist".
Also the executable flag must be set, otherwise the game cannot be started.

A workaround is renaming the executable and setting the executable flag manually, obviously.

hfterror

HFT doesn't run on Linux

I followed the instructions from http://docs.happyfuntimes.net/docs/linux.html

All seemed to work until I run the last step:

    $  hft start --app-mode
    ERROR: happyFunTimes does not appear to be installed.

Apparently it's looking for a config file in

    $HOME/.happyfuntimes/config.json

but this directory does not exist, nor the file. Thus getHftInstallDir() in hft-config.js is throwing an exception and returning "undefined".

Probably the problem would be solved with one more step in the instructions for creating the missing directory + config file.

UriFormatException: Invalid URI: Invalid port specified.

Running the sample 2d platform scene gives this error.

UriFormatException: Invalid URI: Invalid port specified.
UnityEngineInternal.WebRequestUtils.MakeInitialUrl (System.String targetUrl, System.String localUrl) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestUtils.cs:548)
UnityEngine.Networking.UnityWebRequest.set_url (System.String value) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/UnityWebRequest.bindings.cs:400)
UnityEngine.Networking.UnityWebRequest..ctor (System.String url, System.String method) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/UnityWebRequest.bindings.cs:176)
HappyFunTimes.HFTSite+Informer+d__15.MoveNext () (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:90)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
HappyFunTimes.Informer:Inform(Boolean, MonoBehaviour, Byte[], String) (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:72)
HappyFunTimes.d__8:MoveNext() (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:241)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
HappyFunTimes.HFTSite:Init(Options) (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:175)
HappyFunTimes.HFTManager:StartServer() (at Assets/HappyFunTimes/HappyFunTimesCore/HFTManager.cs:272)
HappyFunTimes.HFTManager:Start(HFTRuntimeOptions, GameObject) (at Assets/HappyFunTimes/HappyFunTimesCore/HFTManager.cs:57)
HappyFunTimes.HFTConnectionManager:StartHappyFunTimes() (at Assets/HappyFunTimes/HappyFunTimesCore/HFTConnectionManager.cs:54)
HappyFunTimes.PlayerSpawner:StartHappyFunTimes() (at Assets/HappyFunTimes/HappyFunTimesCore/PlayerSpawner.cs:104)
HappyFunTimes.PlayerSpawner:Start() (at Assets/HappyFunTimes/HappyFunTimesCore/PlayerSpawner.cs:172)

https://imgs.info/i/k7tFw

Problems running Unity3d build of game?

I built a game with HappyFunTimes using unity and I don't know how to run a build? Works fine in the Unity editor, though.

I get the following when I point my controller to "happyfuntimes.net"

TypeError: Cannot read property 'originalGameId' of undefined
at handleHappyFunTimesPingRequest ...

If I go straight to the ip address nothing happens just stays at "Waiting for game ..."

It's a OSX Build, btw.

Thanks. :)

Unity 2019.2.3f1 Broken

Hi, I've been working on a project and updated unity to the newest release and now HappyFunTimes doesn't work. It returns the following error. Any suggestions on how to fix it?

UriFormatException: Invalid URI: Invalid port specified.
UnityEngineInternal.WebRequestUtils.MakeInitialUrl (System.String targetUrl, System.String localUrl) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestUtils.cs:540)
UnityEngine.Networking.UnityWebRequest.set_url (System.String value) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/UnityWebRequest.bindings.cs:400)
UnityEngine.Networking.UnityWebRequest..ctor (System.String url, System.String method) (at C:/buildslave/unity/build/Modules/UnityWebRequest/Public/UnityWebRequest.bindings.cs:176)
HappyFunTimes.HFTSite+Informer+d__15.MoveNext () (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:89)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
HappyFunTimes.Informer:Inform(Boolean, MonoBehaviour, Byte[], String) (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:72)
HappyFunTimes.d__8:MoveNext() (at Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTSite.cs:240)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

questions on stackoverflow

I tried to ask a question on stackoverflow using the "happyfuntimes" tag. But since the tag seems not to be used yet, I can create no question with this tag. (You need a certain reputation to create an own tag for questions.)

My question is:
How can I modify the preset controller?

I am using the 2D sample project of happyfuntimes and would like to display the player's score directly on their phone.

Which script do I use to accomplish this? HFTGamepad.cs? controller.js? PhonePlayerScript?

Can I test the controller without connecting a phone to the game? E.g. by opening a browser?

What to do about HTTPS

In order for the browser to go fullscreen (currently Android only), access the mic (also Android only), use the camera for real time input (Android only), and even read the gyroscrope pages are required to be served as HTTPS

Unfortunately that's rather complicated. To use HTTPS requires Certificates. Certificates require domain names.

Lots of people have suggested solutions but they all seem to fail in some way

A solution needs to have zero user interaction IMO. Run the game, it just works. No login, no registration, no configuration

The solution I think would work is to run a free DNS server for happyfuntimes and get it listed on the Public Suffix List (or talk to letsencrypt for a special exemption).

The free DNS server would have an API that lets games generate a DNS server like this

<sha256ofgamename+internalip+externalip>.dyndns.happyfuntimes.net

That domain is would point to internal IP address of the game and the DNS server would have an API to support validating letsencrypt using TXT records.

The game (happyfuntimes library) would then have to contact happyfuntimes.net, ask for a domain name, it could then use that name to get a cert from letsencrypt. It would store that locally and if it's close to expiring try to get a new cert.

Some issues

  • Do I need to have API keys?

This would only be a pain point for devs not users. Basically like many other services the dev has to register their game and get an API key used to talk to happyfuntimes.net. This allows knowing who owns what and or ban abusers?

  • Can I get on the Public Suffix List

Last time I asked I was told the fact that I was just trying to get more certs was bad. I'm not trying to get more certs though. I'm trying get let users get certs. Maybe they'd let me on. My only thinking there was if I separate the "get a domain" into a separate non-happyfuntimes service then it's more generic and more likely to be approved. Also useful for other projects.

  • Does the domain name matter?

I choose sha256-internalip-externalip-gamename because it means the game knows what domain it will use without having to ask. But, since it has to at least contact happyfuntimes.net in some way maybe happyfuntimes.net should just make some random number and return the domain name in the result.

Similarly originally I was going to try to do something like externalip-internalip-gamename (no sha256). The idea being that since the ip addresses are in the name the dynamic dns server doesn't have to store any data to resolve DNS. It just looks at the name and returns the number in the name. I forgot why I moved away from that ideas. I'd base32 the addresses which for ipv6 is 26 characters per address so internal + external is 52 leaving just 11 for some kind of id (since 2 or more games running on the same machine need their own certs).

Or maybe they don't need their own certs? I don't like the idea of games sharing data. Especially if the dynamic dns portion was unrelated to happyfuntimes and could be used for anything that needed an instant domain and a cert then it seems like the certs should not be shared.

I think the reason random names or whatever came up is the DNS server has to store the DNS-01 challenge stuff for each domain anyway. Since it has to store anything it might as well store more like the generated domain name.

Anyway, other ideas welcome - though please explain how it will require zero end-user interaction to both the person running the game and the people playing the game.

Issue starting "TypeError: Cannot read property 'stdout' of undefined"

Hello! I was just starting to work on a new game for HFT and I went to start up the app and I get this error. I have tried uninstalling (config files and all) and reinstalling. I am running Mac OS 10.9. I have run and developed for HFT until very recently. I have tried opening from the app icon and from terminal with the same result. Also I have started as root. I fear it is a node issue of some kind which is an area that I am a little unfamiliar with.

using ip address: 10.0.1.xx

WARNING!!!: EACCES: could NOT connect to port: 80

Listening on port(s): 18679, 8080


/Applications/HappyFunTimes.app/Contents/hft/lib/computername.js:38
    computerName = res.stdout.split()[0];
                      ^

TypeError: Cannot read property 'stdout' of undefined
    at /Applications/HappyFunTimes.app/Contents/hft/lib/computername.js:38:23
    at ChildProcess.<anonymous> (/Applications/HappyFunTimes.app/Contents/hft/lib/utils.js:67:7)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

The fact that port 80 isn't opened hasn't mattered in the past. I assume that it can't get access to 80 because it isn't running in root. I don't think this is the issue.

Thanks in advance!

Unity crashes

I believe I have everything set up correctly since I can see games i've added but whenever I try running Unity example the exe crashes and HFT crashes. both from localhost and from superhappyfuntime installs. The html games seem to work fine. any ideas what it might be?

Device motion and orientation

Since iOS and Android does not allow to use the sensor data per default the orientation controller does not. I assume that the code should be enhanced by something like this;
DeviceOrientationEvent.requestPermission()
.then(response => {
if (response == 'granted') {
window.addEventListener('deviceorientation', (e) => {
// do something with e
})
}
})
.catch(console.error)

Connection issue

I tried to use happyfuntimes on new computer, but can unfortunately not connect to happyfuntimes.

I get the error messages:

ERROR: parsing C:\Users\ Johanna Jacob\Documents\Game Jam\HappyFunTime_2\Assets\WebplayerTemplates\HappyFunTimes\package.json
ERROR: Reading C:\Users\ Johanna Jacob\Documents\Game Jam\HappyFunTime_2\Assets\WebplayerTemplates\HappyFunTimes\package.json
Type Error: Cannot read property 'gamesDir' of undefined

Any idea what can I do there?

Change window appearance

Hi,

I would like to know if there is a way to change the appearance of the "Looking for HappyFunTimes" dialog (it appears when the app is turned off and the user tries to reconnect to happyfuntimes.net). It seems that the css and javascript behind this particular html is generated at runtime.

Many thanks for considering my request =)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.