mage / mage-sdk-unity

MAGE client SDK for Unity
MIT License
2 stars 13 forks source link

removed redundant code, also minor bugfixes #66

Closed AlmirKadric closed 6 years ago

AlmirKadric commented 7 years ago

Now with Unity having a much nicer way to handle asynchronous behaviour (amongst other niceties) as well the current implementation of modules not conforming to the JS SDK (and being a bit bloated as well), I have taken the opportunity to remove some redundant code / features and change minor behaviours to make the SDK nicer to work with in C#.

For those wondering how setup works now, it would look something like this:

Mage mage = Mage.Instance;

// Set configured MAGE endpoint and setup it's internals
mage.SetEndpoints(environment.urlServer, "game");
mage.Setup();

// Set configured MAGE logger levels
Logger.SetConfig(new Dictionary<String, List<String>> {
        { "console", environment.logLevelConsole },
        { "server", environment.logLevelServer },
});

Also since the optional module setup function wasn't bringing much except for some logs to tell you if you had one or not, the feature has been removed. Instead you are responsible to setup your own modules. In Unity it could look something like this:

// Setup application mage modules (pre-login)
yield return StartCoroutine(User.Instance.SetupPreLogin(this));

Lastly since the usercommand wrapper wasn't doing much and people prefer to wrap it inside their module class for type safety, you can now instead call it directly using the Command functions rather than selecting the command from the list of Actions.

stelcheck commented 7 years ago

Is this ready to be merged? I see no reviewers assigned, but the PR is no longer a WIP

AlmirKadric commented 7 years ago

This PR is ready to be merged, but I was waiting to have the core architecture done in the current project to make sure this PR is good enough. Once we're confident that this is a good change we will push for a merge.

stelcheck commented 6 years ago

Any updates on this PR?

stelcheck commented 6 years ago

Next time could we make sure to follow the review process, and make sure someone approves the PR?