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

Host and Join presentations #3

Merged
merged 17 commits into from
May 21, 2014
Merged

Host and Join presentations #3

merged 17 commits into from
May 21, 2014

Conversation

joshterrell805
Copy link
Member

host presentation is pretty much done.. now it's time to be able to join a presentation. All that's left after is sending and receiving messages which is superbly easy.

this requires two new guis which I think kevin is responsible for.

One gui is for the presenter to chose a class to host from, and another gui is so the student can chose a class to join.

I wanted to handle this in the __connectCentral method, but it's not possible
without storing a reference to the callback somewhere. That degrades rapidly
if the user, let's say preses submit twice quickly.

Return a GenericFailure to the user with a conneciton failed method if
connecting to the central server failed.
If the user ever sends a message to the central server, there's a response
associated with it. (at least thus far) Other connections will be different.
@kle622
Copy link
Contributor

kle622 commented May 11, 2014

I will have these done by late (early morning) Sunday night, currently at
home and busy with family shiz so I won't be able to do much :(

On Sat, May 10, 2014 at 5:00 PM, Josh Terrell [email protected]:

host presentation is pretty much done.. now it's time to be able to join a
presentation. All that's left after is sending and receiving messages which
is superbly easy.

this requires two new guis which I think kevin is responsible for.

One gui is for the presenter to chose a class to host from, and another

gui is so the student can chose a class to join.

You can merge this Pull Request by running

git pull https://github.com/joshterrell805/EClass host-presentation

Or view, comment on, or merge it at:

#3
Commit Summary

  • Return GenericFailure for failed connection

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/3
.

@kle622
Copy link
Contributor

kle622 commented May 11, 2014

If it is documented some where, can you point me in the right direction of
where I would get the list of classes a presenter can host from? And the
list of classes a student can join? If not can I get a brief run down of
how to get that data? :P Thanks

On Sat, May 10, 2014 at 9:24 PM, Kevin Le [email protected] wrote:

I will have these done by late (early morning) Sunday night, currently at
home and busy with family shiz so I won't be able to do much :(

On Sat, May 10, 2014 at 5:00 PM, Josh Terrell [email protected]:

host presentation is pretty much done.. now it's time to be able to join
a presentation. All that's left after is sending and receiving messages
which is superbly easy.

this requires two new guis which I think kevin is responsible for.

One gui is for the presenter to chose a class to host from, and another

gui is so the student can chose a class to join.

You can merge this Pull Request by running

git pull https://github.com/joshterrell805/EClass host-presentation

Or view, comment on, or merge it at:

#3
Commit Summary

  • Return GenericFailure for failed connection

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/3
.

@JoelWilcox
Copy link
Contributor

You won't be able to get the actual data yet as far as I know. Our plan was to get that info from CalPoly's CAS after the user logs in. We should discuss it some more soon when we all have a chance.

@joshterrell805
Copy link
Member Author

Joel is correct, we don't have the actual data.. however the server replies back with "moch data" in the login response. Both the student and the presenter receive a list of classes upon logging in. The list is slightly different depending on if the student is a presenter or a student.

The list currently isn't used for anything, but here is where it is available.

Within that callback, authResponse.classes is an array of classes the student/presenter is enrolled in/may host for.

For student, each element of the classes array looks like:

{
   firstname: 'first name of the instructor',
   lastname: 'last name of the instructor',
   name: 'name of the class. eg "CPE 101"'
}

For presenter, each element of the array looks like this:

{
   name: 'the name of the class',
   students: // an array of students enrolled in the course
}

So essentially, we must display these lists to the user so they can select a class to join/host. Once they select a class, we try to host or join the class selected.

Host is completely functional atm. I am working on Join. Both methods are called from the connection object, here is a good example of how that is done. Everything in Connection works with callbacks since we have no idea when the server will respond to us (if at all). Once we have a response from the server or the response has timed out, the callback is called with one argument: the response object.

Every response object is guarenteed to have at least one attribute: success. This is a boolean indicating whether or not the request was satisfied. If success is false, reason is also guaranteed to be defined on the object (a reason for why the request wasn't satisfied.. you used this in the login box already for when the user can't login). If success is true, the data defined on the response object depends on what the user requested.

To host a presentation we need to call connection.hostPresentation and handle success/failure responses accordingly.

To join a presentation we need to call connection.joinPresentation (not commited yet, but here is a screenshot of the signature).

Note: I noticed you replied from email @kle622 . This message will look a lot better in github because I used markdown to format the content.

joshterrell805 and others added 15 commits May 11, 2014 18:42
This is the beginning of join-presentation. First the student requests to join a
presentation. The central server validates the request and responds to the
student. That is the summary of what this commit does.

Next up: the central server responded with connection info for the student
to connect to the presenter.. connect to the presenter now.
Once the central server has responded to the student with the presenter's
ip and port, connect to it.
Next: join the presentation (authenticating with presenter).
The verify field-type methods are used to verify that received data is of the
correct type. Move it to the BaseConneciton that way the presenter server can
use it.
The last phase of join presentation is now complete.

The student joins the presenter and the presenter checks with the central server
to verify that the student may join.
For the time being, this isn't where we want it. Eventually it will go here.
Directly after logging in, the user is greeted with the dialogs to chose the
classes to host/join.

These dialogs need to be updated a bit further.
Calls are being made but I am getting a 'Connection' object has no
attribute _Connection_settings error
Display failure reason in static label if failed.
Display all class properties in Join presentation listCtrl.
Fix logic error in connections where failure and success were swapped.
Add a new verificaiton step in receive_host that verifies that the presenter
isn't hosting the presentation from somewhere else.
Now the server doesn't have to be restarted every time a presentation needs to
be hosted.

If the presenter's conneciton closes and he was hosting a presentation,
stop hosting that presentation.
@joshterrell805 joshterrell805 merged commit 13c5067 into master May 21, 2014
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

Successfully merging this pull request may close these issues.

3 participants