Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement server selection #29

Open
rgbkrk opened this issue Dec 14, 2015 · 7 comments
Open

Implement server selection #29

rgbkrk opened this issue Dec 14, 2015 · 7 comments

Comments

@rgbkrk
Copy link
Member

rgbkrk commented Dec 14, 2015

Users should be able to select a server if more than one is available. Color can be the default green for the server selection since we don't know it yet (and don't have a local store).

@luckydonald
Copy link
Member

How does we get a server list?
From what i picked up at discover.js
we need something like

import createDiscovery from 'pipboylib/connection/createDiscovery'

var servers = createDiscovery();

servers.subscribe(function(newServer) {
    $("#serverlist").add("<div>").text(newServer);  // i know this is jquery, but I am desperate now.
});

with createDiscovery being something like a generator we know from python, right?

@luckydonald
Copy link
Member

I also don't quite understand how this would communicate me, that a server is now gone again.

@luckydonald
Copy link
Member

Another question:
Should we be able to display multiple pip boys (= multiple windows) in the same app?
Starting multiple processes with the whole browser runtime doubled for this kinda would suck...

@kitten
Copy link
Contributor

kitten commented Dec 15, 2015

@luckydonald If we change the observable to discover games over time with an interval we can also group the messages that we get back. We group them and thus would receive lists of the available server for each discovery

@luckydonald
Copy link
Member

@philplckthun how long should we wait?

So somethin like this, except there probably is already some function in RxJS

var serverList = [];
while (dontStop) {
   var newServer = server.getSomeServer();
   serverList.append(newServer);
   if (nextIntervall == now) {
      observer.onNext(serverList);  // this does send, right? // python: yield serverList
      serverList = [];
   }
}

also if that happens in the lib, we should keep the waitless version somewhere too.
And forgive me, i am thinking with python generators portals

Edit just saw the sweet

.bufferWithTime(10000)

at #22

@rgbkrk
Copy link
Member Author

rgbkrk commented Dec 15, 2015

Starting multiple processes with the whole browser runtime doubled for this kinda would suck...

It's only one browser runtime with the Electron App, so long as they're just new Windows this isn't a problem. As for if we should do it, I'm not sure of the utility of having multiple pipboys on one screen for multiple games.

how long should we wait?

Re-triggering the probe after some time makes a good amount of sense, since we're working over UDP. The Fallout 4 server only responds once per broadcast and it's fairly quick. We could/should bump the TTL for the UDP packets as well to make sure that we're able to discover all the PCs and PS4s on a given local network (jokingly, making for dorm room or shared wifi tomfoolery).

@luckydonald
Copy link
Member

And I found reactivex -> Interval

var source = Rx.Observable
    .interval(500 /* ms */) 
    .timeInterval() // not sure what that does opposed to interval above

With this it should be possible to let this call the server search and emission the results somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants