Skip to content

Adam Reid - [LambdaMUD-Client]#112

Open
iAmAdamReid wants to merge 11 commits into
bloominstituteoftechnology:masterfrom
iAmAdamReid:master
Open

Adam Reid - [LambdaMUD-Client]#112
iAmAdamReid wants to merge 11 commits into
bloominstituteoftechnology:masterfrom
iAmAdamReid:master

Conversation

@iAmAdamReid

Copy link
Copy Markdown

No description provided.

@TheDeterminator TheDeterminator left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adam, everything looks great! Please refer to my sprint review comments for a better summary of my overall impression of this project.

@@ -0,0 +1,140 @@
import axios from 'axios';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I know you showed us your logs but I forgot that you used Redux in here. Good job!

// if(this.state.command === 'n' || this.state.command === 's' || this.state.command === 'e' || this.state.command === 'w'){
if(this.state.command && this.state.command[0] !== '/'){
let direction = '';
switch(this.state.command){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good but looking at the syntax it makes me wonder if you couldn't have just set the direction variable directly from the command attribute instead of using a switch statement to set it (and then having error handling if the user inputs an invalid command). Maybe I'm not seeing the full picture of this method though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was more of an exercise in utilizing switch/case statements than anything else, as I haven't built them as often as I've built nested if statements, which can become jumbled and messy if they go on too long. The idea behind this input sanitization was to ensure that the backend receives the proper value, which is just a single character direction, instead of the full direction string (e.g. 'n' vs 'north'), while still giving users some freedom as to how they want to move directions.

password2: this.state.password2
}
this.props.register(newUser);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this load the game screen after registration? Seems like that might be desirable beahviour, like you have for the login.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had cut the registration redirect while attempting to implement the redirect in another place (actions/reducers), so that the pusher registration could propagate properly on the redirect. I was unable to find a solution in time for the demos, so it just never got put back in. It's back for now, though there's a package (react-router-redux) that may offer some insight as to how to implement redux redirects that I'm looking into.

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.

2 participants