Giter Club home page Giter Club logo

javadestinyapi's Introduction

Hi ๐Ÿ‘‹, I'm dec

Java, Rust and C++ Developer

dec4234

Connect with me:

dec4234

Languages and Tools:

ย dec4234

ย dec4234 Languages

Projects

Java

An API wrapper written in Java for the Bungie platform API. Useful for developers looking to retrieve stats and other information about users and clans inside of the game Destiny 2. Supports clan management such as kicking, banning, promoting and inviting as well using OAuth.

A Discord Bot using JDA and the JavaDestinyAPI to control my Destiny 2 Clan. The bot supports several features related to clan management, most notably: Applications handled inside Discord, Discord role management and functionality to automatically detect people who leave. The bot has made it significantly easier to manage the clan as many tedious actions have been automated. I host it on a Raspberry Pi 4 8 GB at my house.

MongoDB is utilized to store information about each user including both Discord and Bungie IDs, join and leave dates, and usernames. This allows me to have access to all of the information needed to manage clan members.

StreamAlerter is a project I made to be able to detect when Youtubers start a live stream without using the Google API. Normally if you wanted to check for a Youtube livestream, you would have to use the Google API which is limited through quotas. This solution retrieves the web page using a channel ID and then checks for a specific link under a certain html tag. The only potential problem with this solution is bandwith usage, but it can mitigated by limiting the time between calls.

Spigot Plugins (Java)

The third iteration of a Spigot plugin for the semi-private minecraft server I help develop. This is the biggest project relating to Minecraft server development that I have undertaken.

The basic gameplay loop of the server relates around "Pits" where players can go to kill a lot of mobs in order to progress to the next highest pit. In order to be able to make this work, the plugin implements a custom mob spawning solution modeled off of Hypixel Skyblock's system. Whenever mobs are killed they are added to a list of dead mobs, then at a fixed interval all dead mobs are respawned.

Additionally, MongoDB is used to store player information such as kills, deaths, money (shekels) and a Base64 encoded private vault. A public scoreboard using armor stand holograms is used to display the top 5 mob killers on each day. A sidebar scoreboard solution has also been implemented, using a system that I developed.

The server also utilizes command blocks built and managed by another user, Wildfire, to control the finer gameplay elements. The server is by no means amazing but it is a good game to play while at school.

DecsLoginSecurity is an offline mode security solution for offline mode servers. This plugin is used on the "The Pit" which is the same server as above.

All users are required to register a password and use it when logging in. Otherwise, any user with malicious intent could login under another player's name and wreak havoc.

DecsNPCs is a simple solution for NPCs that I made for "The Pit" a while ago. DecsNPCs utilizes packets to spawn and manage NPCs. Functionality is limited however it provided invaluable experience for me in order to better understand packets. We eventually abandoned this project in favor of Citizens2.

Rust Lang

A project nearly identical to the JavaDestinyAPI, except in Rust. Uses Serde and Reqwest to make requests to the Bungie.net API and easily parses all of the responses into pre-made structs. Uses tokio to perform async tests, which ensure that functionality for the API remains intact in-between each update. Uses chrono and a custom Zulu Time deserializer to parse time formats.

A proof of concept of a Proof-Of-Work CryptoCurrency written in Rust.

A packet-based information transfer protocol. Supports serializing and deserializing structs to and from bytes and sending them to connected servers or clients.

An implementation of a Minecraft: Java Edition Server in Rust. Supports the full login sequence up until chunk data is transferred to the client. Supports Server List ping handling.

C++

Implementations of various data structures in C++, including Linked Lists and Array Lists.

javadestinyapi's People

Contributors

dec4234 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

javadestinyapi's Issues

Forwards Compatibility-Breaking Updates

Forwards Compatibility Breaking Updates in v1.5

Soon I will release v1.4 of the API as the last packaged version of "Version 1.0" of the API. I will then begin work on v2 of the API which will start with the marker 1.5.

When I originally created the API, I failed to account for some things that would potentially impact its longevity and versatility. There are some things that need to be changed in order to make conventions and frameworks more consistent with existing rules. A lot of these changes will break lots of existing projects, which is why I am choosing to separate them into a new version specifically made for them.

The changes planned (in no particular order):

  • Changing package names to directly package them together
    This is one of the most egregious examples of not planning for a well-made API. All of the packages just have their own name rather than being prefixed by "net.dec4234.javadestinyapi" This has made and will make it difficult to identify which packages specifically belong to JDA.
  • Removing duplicate and often confusing methods and renaming many others
    As I have covered more and more of the API I have made many functions which often overlap with existing functions to an unnecessary degree. This has made it increasingly confusing to determine which are appropriate for each situation. On top of that, the names of many methods are unnecessarily long or cryptic, which may cause first-time users to miss a functionality that they could use. Appropriately naming functions based on their use and output will make the API more accessible.
  • Renaming certain class names to be less cluttered and a little more relevant
    This is one that I am not as sure about. I think that some class names may benefit from being renamed, but I'll need to see how it pans out and how necessary it is.
  • Standardizing id variable types
    This one is going to impact a lot of existing infrastructure.
    Just a couple days ago, I finally realized that all ids in the bungie api can fit under int64, which is a long in java. When I was originally building the API, I thought that ids could only fit under a String, because I only tested them being placed in ints. I think that it would be best if we switched all IDs referenced in the API from Strings to longs in order to make them a little more recognizable.

To Be Continued

v1.5 and v1.6 roadmap

v1.5

  • BungieUser Profiles
    Each BungieUser could correspond to multiple bungie profiles that are all equally valid. BungieUser should be reworked to include a List of valid DestinyUserProfiles.
  • Return List of DestinyProfiles in user searching
    For the same reasons as above, when searching for a user it could come up with multiple valid profiles pointing to the same user. The search methods should return a List of valid profiles.
  • Rework getMembers() system
    All of the getMembers() methods in the Clan class need to be combined down to one method. They should exclusively return a List of ClanMembers rather than BungieUser. Remove the entire async splitting architecture, as it isn't very beneficial anymore.
  • Iteration options for searching
    Thanks to the suggestion in #16 the search methods should be at least partially reworked to include iteration options for the end-user. This could potentially improve search times in some cases.
  • Add getOldestMembers() to Clan
    Use code from Benedict 99-40 to add a getOldestMembers() call, which returns a list of the oldest members in the clan.

v1.6

  • Continue Work On Activities
    Pick up where we left off with the Activity and related scraping system.
  • Continue work on Inventory and Collections Management
    Only partially complete, still missing some very important things.
  • Implement system to use cached manifest file
    Instead of downloading the entire JSON Object or making individual calls, we can save the manifest file if the user wants and use SQL to get the manifest items.

searchUsers method is very slow to return data when searching for common words

for (int i = 0; i < 100; i++) { // Start at page 0 and increment each time until there are no more valid pages
JsonObject jsonObject = httpUtils.urlRequestPOST(HttpUtils.URL_BASE + "/User/Search/GlobalName/" + i + "/", body);
// Only continue looping if the result has a list of search results
if (jsonObject.has("Response") && jsonObject.getAsJsonObject("Response").getAsJsonArray("searchResults").size() != 0) {
JsonArray jsonArray = jsonObject.getAsJsonObject("Response").getAsJsonArray("searchResults");
for (JsonElement jsonElement : jsonArray) { // Add all user info objects into one list
jsonObjects.add(jsonElement.getAsJsonObject());
}
} else {
break;
}
}

Paginating through the API automatically to get all the data at once is an inefficient way handle search. This is slow when searching for common terms in a username, i.e. "guardian"

Ideally, you should simply expose the pagination and allow developers to customize this a bit so that it can be performant

Catchup

This list is kept so I have tasks to work on when I feel like working on the API again.

  • Guardian Ranks

  • King's Fall Hashes & Lightfall Raid & Other Activities

  • Loadouts

  • Start setting up V2

NPE Regarding Access Token?

So the code is pretty straight forward just wanted to see if it actually worked and
public static DestinyAPI api; public static void main(String[] args) throws LoginException { api = new DestinyAPI().setApiKey("api-key"); System.out.println(api.getUser("76561198334940394"));

Then i decided to just simply print out a BungieUser and was getting a NPE for getAccessToken.`

Caused by: java.lang.NullPointerException
at material.DestinyAPI.getAccessToken(DestinyAPI.java:136)
at utils.HttpUtils.(HttpUtils.java:31)

Add unit tests

Add unit tests for all major functionality using JUnit

Update Documentation

Improve documentation overall throughout the entire library.
Maybe also bundle javadocs?

External .jar build

I would like to use the API with your wrapper. However, I don't usually use maven for my projects and was wondering if you could publish a version of the wrapper as a jar file.

User Searching Issues

Multiple issues keep arising from the user searching system.

  1. getUserWithName() cannot handle a scenario with a discriminator with a leading zero. Such as 0946 for whatever reason.
  2. Begin working on implementing some sort of test system like there is in Rust to squash these before we release a new update.

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.