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

Multi-instance support #125

Merged
merged 25 commits into from
Oct 23, 2014
Merged

Conversation

AlexanderDzhoganov
Copy link
Member

Only works in the GUI for now, doesn't break the command-line client but the new options are not implemented.

Related to #29

@pjf
Copy link
Member

pjf commented Oct 21, 2014

@AlexanderDzhoganov : Travis says no.

I don't suppose you can add a commit which fixes that test case, could you?

@@ -137,20 +185,12 @@ private static string FindGameDir()
return exe_dir;
}

// Check the registry, maybe it's there.
string registry_dir = FindGamedirRegistry();
Copy link
Member

Choose a reason for hiding this comment

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

I might be missing something here, but we really do want to check the registry first. If the user's configured their default KSP install (ckan config gamedir ...), we don't want to go using a different one.

Copy link
Member

Choose a reason for hiding this comment

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

Just tested with the cmdline client. It now always finds my steam install, rather than my testing install which is in the registry. And even if I use ckan config gamedir, it still can't find it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, looks like I broke the command-line client after all. Let me fix this before merging.

@pjf
Copy link
Member

pjf commented Oct 21, 2014

Looks like adding a new KSP directory (which has never had a CKAN client see it) causes problems:

http://pastebin.com/cmjDFuXD

@@ -224,9 +218,9 @@ public void InstallList(List<string> modules, RelationshipResolverOptions option
}
}

if (!notCached.Any())
if (!notCached.Any() && !cached.Any())
Copy link
Member

Choose a reason for hiding this comment

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

Wait... If not not cached any, and not cached any... Well, not not cached is cached, and not cached is the opposite of that, and they're anded together, so...

This line really needs a comment. I can't tell what it's supposed to be doing or testing for.

Copy link
Member Author

Choose a reason for hiding this comment

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

It tests if both notCached and cached are empty

Copy link
Member

Choose a reason for hiding this comment

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

So... if we have no modules cached, and no modules not cached, that means... we're installing no modules and hence we do a roll-back? Under what circumstances would we encounter that? When ModList is empty, which I don't think can happen unless modules is empty...

So wouldn't be be better of testing one of those variables earlier on, and signalling appropriately if they're empty?

It's late and I'm low on sleep, so I may be missing something here, but that's a typical state for developers, so if it's confusing me now it'll almost certainly confuse someone else (possibly future me) later on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it'd be better to test at the start of the function.

@pjf
Copy link
Member

pjf commented Oct 22, 2014

Let me know if you'd like me to re-review this. I may not get a chance to do so tonight (my apologies), but I hope to do so soon! <3

@pjf
Copy link
Member

pjf commented Oct 22, 2014

(Today has been a flurry of build crews and plumbers fixing a burst pipe, and has been hectic!)

@AlexanderDzhoganov
Copy link
Member Author

I need a few more hours to modify the command line client and we can merge this :)

else
{
// auto-start instance specified
if (KSP.AutoStartInstance != null && KSP.AutoStartInstance != "" && KSP.Instances.ContainsKey(KSP.AutoStartInstance))
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I didn't realise there was an autostart instance. Perfect!

  • Does this check the current working directory for KSP first? We need that for portable installs.

Copy link
Member Author

Choose a reason for hiding this comment

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

It uses the old "find default install" method, so it should work.

@pjf
Copy link
Member

pjf commented Oct 23, 2014

Review finished, going through checklist items now. :)

@AlexanderDzhoganov
Copy link
Member Author

I responded to some of your comments :)

pjf added a commit to pjf/CKAN that referenced this pull request Oct 23, 2014
pjf added a commit to pjf/CKAN that referenced this pull request Oct 23, 2014
@pjf
Copy link
Member

pjf commented Oct 23, 2014

Hooray! I super-duper want to get this merged tonight, but I'm occupied right now. Do feel free to make new work on top of this, but if you can make sure it's on a branch that would be grand. :)

You rock, and thanks again! <3

@AlexanderDzhoganov AlexanderDzhoganov merged commit fdf649f into KSP-CKAN:master Oct 23, 2014
@AlexanderDzhoganov
Copy link
Member Author

Ok, here's how I fucked up:

What I thought I was doing was making a branch off my master and then merging it back (into my master). What actually happened was that it merged into KSP-CKAN master o.O . I managed to revert it back but this pull request got closed for some reason.
I hope this is easily fixable but I'm not sure how, I'm sorry, @pjf :)

@techman83
Copy link
Member

@AlexanderDzhoganov - Everything is fixable. I've got myself into some weird weird situations with git :)

@pjf
Copy link
Member

pjf commented Oct 24, 2014

@AlexanderDzhoganov : Aah! The PR closed because github saw its commits merge into KSP-CKAN/master.

I'll go look at how everything is now, but I don't imagine it'll be more than a few minutes work to put back. :)

@pjf pjf self-assigned this Oct 24, 2014
@pjf
Copy link
Member

pjf commented Oct 24, 2014

And fixed! It's super easy when you know how! (See #140 on step-by-steps, in case you ever need them!)

pjf added a commit to pjf/CKAN that referenced this pull request Oct 24, 2014
- Split management of multiple instances into KSPManager
- No need to manually save or load from registry.
- Added GetPreferredInstance() as the best way to find the user's
  preferred instance, if a single preferred instance exists.
- Added PortableDir() to install portable installs.
- Decoupled transactional file transactions from KSP class.
- KSPPathConstants in their own file
- KSPPathUtils in its own file.
- Some tests, but not enough, darn it!

For KSP-CKAN#125
@pjf pjf added the In progress We're still working on this label Oct 24, 2014
@pjf pjf mentioned this pull request Oct 24, 2014
AlexanderDzhoganov added a commit that referenced this pull request Oct 24, 2014
RichardLake pushed a commit to RichardLake/CKAN that referenced this pull request May 30, 2015
RichardLake pushed a commit to RichardLake/CKAN that referenced this pull request May 30, 2015
RichardLake pushed a commit to RichardLake/CKAN that referenced this pull request May 30, 2015
- Split management of multiple instances into KSPManager
- No need to manually save or load from registry.
- Added GetPreferredInstance() as the best way to find the user's
  preferred instance, if a single preferred instance exists.
- Added PortableDir() to install portable installs.
- Decoupled transactional file transactions from KSP class.
- KSPPathConstants in their own file
- KSPPathUtils in its own file.
- Some tests, but not enough, darn it!

For KSP-CKAN#125
RichardLake pushed a commit to RichardLake/CKAN that referenced this pull request May 30, 2015
- Split management of multiple instances into KSPManager
- No need to manually save or load from registry.
- Added GetPreferredInstance() as the best way to find the user's
  preferred instance, if a single preferred instance exists.
- Added PortableDir() to install portable installs.
- Decoupled transactional file transactions from KSP class.
- KSPPathConstants in their own file
- KSPPathUtils in its own file.
- Some tests, but not enough, darn it!

For KSP-CKAN#125
RichardLake pushed a commit to RichardLake/CKAN that referenced this pull request May 30, 2015
- Split management of multiple instances into KSPManager
- No need to manually save or load from registry.
- Added GetPreferredInstance() as the best way to find the user's
  preferred instance, if a single preferred instance exists.
- Added PortableDir() to install portable installs.
- Decoupled transactional file transactions from KSP class.
- KSPPathConstants in their own file
- KSPPathUtils in its own file.
- Some tests, but not enough, darn it!

For KSP-CKAN#125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In progress We're still working on this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants