Giter Site home page Giter Site logo

loicteixeira / gj-unity-api Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 13.0 935 KB

[MOVED] Game Jolt API wrapper for Unity.

Home Page: https://github.com/InfectedBytes/gj-unity-api/

License: MIT License

C# 99.42% Makefile 0.58%
unity c-sharp game-api gamejolt

gj-unity-api's Introduction

‼️ Project has moved 🚨

It is now maintained at InfectedBytes/gj-unity-api.

Game Jolt Unity API

Game Jolt Game API wrapper for Unity.

Check out the documentation.

License

Released under MIT.

Development

Changelog

Keeping /CHANGELOG.md up to date as new features are added make the release of new versions much simpler.

In addition, it gives a clear indication on what has been added/fixed/etc but not released yet.

Documentation

The documentation is generated with Doxygen and can be used via the GUI or the CLI.

The configuration file can be found at /Documentation/Doxyfile. Unfortunately the paths are absolute and will depend on the developer machine.

To update the documentation, run make doc_generate. To preview it, run make doc_serve and visit http://localhost:8000/. Finally, to publish the documentation, commit the changes to master and push to origin, then run make doc_publish to copy the Documentation/Output/html subdirectory to the gh-pages branch so the documentation will be available at loicteixeira.github.io/gj-unity-api/.

Release new version

Part 1 - Prepare the package

  1. Update the version number following Semantic Versioning.
    • VERSION in /Assets/Plugins/GameJolt/Scripts/API/Constants.cs.
    • PROJECT_NUMBER in /Documentation/Doxyfile.
  2. Update CHANGELOG.md.
    • Convert the Unreleased section to the new version number, following the formatting of the previous versions.
    • Make sure to create the corresponding link at the bottom of the file
    • Make sure to update the unreleased link as well to it compare from the new version.
  3. Commit the changes with the message Release vX.Y.Z.
  4. Push the changes to the remote. See the 2.2.0 release as an example.
  5. Create the corresponding tag with git tag vX.Y.Z.
  6. Push the tag to the remote with git push --tags

Part 2 - Create the Unity Package

  1. In the Project view, select the Plugins folder.
  2. Right-click and choose Assets > Export Package....
  3. Uncheck include dependencies.
  4. Click Export.
  5. Save as GameJoltUnityAPI_X.Y.Z.unitypackage in a folder which isn't tracked by git.

Part 3 - Upload the package

  1. GitHub
    1. Go to Code > Releases.
    2. Click Draft a new Release.
    3. In tag and version, use the name of the tag created earlier. It should be vX.Y.Z.
    4. Copy the changes from the changelog in the body (formatting can stay the same)
    5. Attach the newly created package.
    6. Click Publish release
  2. GameJolt
    1. Go to Dashboard > Your Games > Unity API > Manage.
    2. Select Packages.
    3. Find Unity API v2 and click Manage.
    4. Click New Release.
    5. Set the version number.
    6. Attach the build as a Downloadable Build.
    7. Select Other for the platform.
    8. Publish.
    9. Create a news in the Devlog so the developers following the project are notified.
  3. Unity Asset Store

gj-unity-api's People

Contributors

danieljmus avatar infectedbytes avatar loicteixeira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gj-unity-api's Issues

Missing EventSystem

Adding the GamerJoltAPI object in my scene and then calling GameJolt.UI.Manager.Instance.ShowSignIn();
is generating an error : NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UI.Selectable.Select ().
I added a new EventSystem to the scene and it worked fine.
The EventSystem should come with the API object.
I guess someone just deleted it by mistake.

Add a guest name generator

Guest name generator! When saving a score for a guest, it will show the name of the guest followed by "(guest)" on the website, but because the default name is "Guest", it actually shows "Guest (guest)" which is pretty lame. Unless you specify a name yourself, it would be nice to add random names like Mario/Luigi/Sonic/etc (and possibly allow the use of custom lists to match a game universe).

Make MD5 encryption compatible with Windows 8

Use UnityEngine.Windows.Crypto.ComputeMD5Hash for that.

Notes:

  • Find a Windows 8 machine to test on.
  • Investigate if it need to be done only for Windows 8 or for Windows Phone as well.

Prevent user to be unauthenticated if his name is updated but only the case change

Usernames are case insensitive for API calls but are still stored in the database with the right case for display purposes.

When a user sign in, his name is stored in the User objects as it was given. Once authenticated, the API will automatically fetch all the extra information which include the name with the right cas. When updating the name, it flags the User as "not authenticated".

While it is a good thing to flag the User as "not authenticated" when updating its name (it ensure future calls aren't going to fail because the name/token have been updated), it should not flag the User as "not authenticated" if only the case changed.

AutoConnect fails for WebGL builds

It's calling OnGetUserFromWeb which has been renamed to OnAutoConnectWebPlayer during the last refactor.

Issue found by David Florek.

NullReferenceException in editor on play

This happens if you haven't gone to the settings yet. If you went ones to the settings it gone.

the error goes to the start block with this in it
"// Do not try this at home! Seriously, you shouldn't."
so could be code is temporary

editor log

SignIn callback returns before the user information are fetched

Currently the code below results in a null avatar because User.AvatarURL has not yet been set through the User.BulkUpdate method.

        GameJolt.UI.Manager.Instance.ShowSignIn((bool success) =>
        {
            if (success)
            {
                GameJolt.API.Manager.Instance.CurrentUser.DownloadAvatar(GotAvatar);
            }
        }

The cause is likely in User.cs:124

    Core.Request.Get(Constants.API_USERS_AUTH, parameters, (Core.Response response) => {
        IsAuthenticated = response.success;

        if (response.success)
        {
            Manager.Instance.CurrentUser = this;
            Get();
        }

        if (callback != null)
        {
            callback(response.success);
        }

    }, false);

To fix it consider something like this

    Core.Request.Get(Constants.API_USERS_AUTH, parameters, (Core.Response response) => {
        IsAuthenticated = response.success;

        if (response.success)
        {
            Manager.Instance.CurrentUser = this;
            Get((user)=>{
                if (callback != null)
                {
                    callback(response.success);
                }
            });
        }
        else
        {
            if (callback != null)
            {
                callback(response.success);
            }
        }               

    }, false);

Add Licence

  • Find an appropriate license for the API.
  • Create corresponding file.
  • Mention Glypicon as per condition of use of their icons.

DebugUser & DebugToken

there is no safe way to get DebugUser and DebugToken.
this would handy in some cases.

Or allow to access a
'GJAPI.object.user DebugUser;'

this should protect it to not work outside of editor. (with my c++ knowledge)
`
get{

if UNITY_EDITOR

return DebugUser;

else

return "";

endif

}
`

there may be better ways to do this. (are probably)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.