HeyZeer0/Paladins-Java-API


A simple wrapper for HiRez paladins API.

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.HeyZeer0:Paladins-Java-API:'
	}
	dependencies {
		implementation("com.github.HeyZeer0:Paladins-Java-API:")
	}
	<dependency>
	    <groupId>com.github.HeyZeer0</groupId>
	    <artifactId>Paladins-Java-API</artifactId>
	    <version></version>
	</dependency>

                            
    libraryDependencies += "com.github.HeyZeer0" % "Paladins-Java-API" % ""
        
        

                            
    :dependencies [[com.github.HeyZeer0/Paladins-Java-API ""]]
        
        

Readme


Paladins Java API <img align="right" src="https://hzweb.hi-rezgame.net/paladins-web/wp-content/uploads/2016/06/cropped-2016-06-03-192x192.png" height="192" width="192">

Build Status Version</br> This is a simple wrapper for HiRez Paladins API.</br> This project is in a Working in Progress status and more functions will be added soon.

Maven

Don't forget to add the jcenter repository ;)

<dependency>
  <groupId>net.heyzeer0.papi</groupId>
  <artifactId>PaladinsAPI</artifactId>
  <version>+</version>
</dependency>
compile 'net.heyzeer0.papi:PaladinsAPI:+'

Usage example

    public class Example {

        public static PaladinsAPI api = new PaladinsAPI("your dev_id", "your_dev_key", Platform.PC);
        //                                               ^ dev_id       ^ dev_key      ^ Platform#PC/XBOX/PS4

        public static void main(String args[]) {
            //getting a player info
            try{
                PaladinsPlayer p = api.getRequestManager().requestPlayer("HeyZeer0");
                System.out.println("User: " + p.getName() + " | ID: " + p.getID() + " | Level: " + p.getLevel());
                System.out.println("Wins: " + p.getWins() + " | Losses: " + p.getLosses() + " | Leaves: " + p.getLeaves());
                System.out.println("Join date: " + p.getJoinDate() + " | Last login: " + p.getLastLogin());
                /// and others
            }catch (UnknowPlayerException e) {
                System.out.print("There is no player with that nick");
            }catch (SessionException e) {
                System.out.println("An error ocurred while trying to create the session: " + e.getLocalizedMessage());
            }catch (Exception e) {
                e.printStackTrace();
            }

            //applying a created session
            //Use: if your program restart, you can simple save your actual key and use it when restarts, respecting the 15m time limit
            try{
                api.getRequestManager().applySession("your_key");
            }catch (SessionException e) {
                System.out.println("An error ocurred while trying to create the session: " + e.getLocalizedMessage());
            }catch (Exception e) {
                e.printStackTrace();
            }

        }

    }

License

The MIT License (MIT)

Copyright (c) 2017 HeyZeer0

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Paladins Logo is over Copyright © by HiRez Studios so it is not my property.