diff options
author | syeyoung <cyong06@naver.com> | 2021-08-08 18:21:51 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-08-08 22:02:06 +0900 |
commit | eaaac61857654f7f629fa9ada669f40301009e31 (patch) | |
tree | 98189a04dcb1cd351d8ab30e31e932e65ad9454d | |
parent | a6eb8b879e8bad88aa334c3e681067e314723c59 (diff) | |
download | Skyblock-Dungeons-Guide-eaaac61857654f7f629fa9ada669f40301009e31.tar.gz Skyblock-Dungeons-Guide-eaaac61857654f7f629fa9ada669f40301009e31.tar.bz2 Skyblock-Dungeons-Guide-eaaac61857654f7f629fa9ada669f40301009e31.zip |
- GameSDK Binding
Welp it was painful writing a tool to generating these bindings, then manually correcting classes
102 files changed, 4339 insertions, 1015 deletions
diff --git a/out/discord_game_sdk.h b/out/discord_game_sdk.h new file mode 100644 index 00000000..779be2e2 --- /dev/null +++ b/out/discord_game_sdk.h @@ -0,0 +1,237 @@ +struct IDiscordLobbyTransaction { + enum EDiscordResult (*set_type)(struct IDiscordLobbyTransaction* lobby_transaction, enum EDiscordLobbyType type); + enum EDiscordResult (*set_owner)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordUserId owner_id); + enum EDiscordResult (*set_capacity)(struct IDiscordLobbyTransaction* lobby_transaction, uint32_t capacity); + enum EDiscordResult (*set_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordMetadataKey key, DiscordMetadataValue value); + enum EDiscordResult (*delete_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordMetadataKey key); + enum EDiscordResult (*set_locked)(struct IDiscordLobbyTransaction* lobby_transaction, bool locked); +}; + +struct IDiscordLobbyMemberTransaction { + enum EDiscordResult (*set_metadata)(struct IDiscordLobbyMemberTransaction* lobby_member_transaction, DiscordMetadataKey key, DiscordMetadataValue value); + enum EDiscordResult (*delete_metadata)(struct IDiscordLobbyMemberTransaction* lobby_member_transaction, DiscordMetadataKey key); +}; + +struct IDiscordLobbySearchQuery { + enum EDiscordResult (*filter)(struct IDiscordLobbySearchQuery* lobby_search_query, DiscordMetadataKey key, enum EDiscordLobbySearchComparison comparison, enum EDiscordLobbySearchCast cast, DiscordMetadataValue value); + enum EDiscordResult (*sort)(struct IDiscordLobbySearchQuery* lobby_search_query, DiscordMetadataKey key, enum EDiscordLobbySearchCast cast, DiscordMetadataValue value); + enum EDiscordResult (*limit)(struct IDiscordLobbySearchQuery* lobby_search_query, uint32_t limit); + enum EDiscordResult (*distance)(struct IDiscordLobbySearchQuery* lobby_search_query, enum EDiscordLobbySearchDistance distance); +}; + +typedef void* IDiscordApplicationEvents; + +struct IDiscordApplicationManager { + void (*validate_or_exit)(struct IDiscordApplicationManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*get_current_locale)(struct IDiscordApplicationManager* manager, DiscordLocale* locale); + void (*get_current_branch)(struct IDiscordApplicationManager* manager, DiscordBranch* branch); + void (*get_oauth2_token)(struct IDiscordApplicationManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordOAuth2Token* oauth2_token)); + void (*get_ticket)(struct IDiscordApplicationManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, const char* data)); +}; + +struct IDiscordUserEvents { + void (*on_current_user_update)(void* event_data); +}; + +struct IDiscordUserManager { + enum EDiscordResult (*get_current_user)(struct IDiscordUserManager* manager, struct DiscordUser* current_user); + void (*get_user)(struct IDiscordUserManager* manager, DiscordUserId user_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordUser* user)); + enum EDiscordResult (*get_current_user_premium_type)(struct IDiscordUserManager* manager, enum EDiscordPremiumType* premium_type); + enum EDiscordResult (*current_user_has_flag)(struct IDiscordUserManager* manager, enum EDiscordUserFlag flag, bool* has_flag); +}; + +typedef void* IDiscordImageEvents; + +struct IDiscordImageManager { + void (*fetch)(struct IDiscordImageManager* manager, struct DiscordImageHandle handle, bool refresh, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordImageHandle handle_result)); + enum EDiscordResult (*get_dimensions)(struct IDiscordImageManager* manager, struct DiscordImageHandle handle, struct DiscordImageDimensions* dimensions); + enum EDiscordResult (*get_data)(struct IDiscordImageManager* manager, struct DiscordImageHandle handle, uint8_t* data, uint32_t data_length); +}; + +struct IDiscordActivityEvents { + void (*on_activity_join)(void* event_data, const char* secret); + void (*on_activity_spectate)(void* event_data, const char* secret); + void (*on_activity_join_request)(void* event_data, struct DiscordUser* user); + void (*on_activity_invite)(void* event_data, enum EDiscordActivityActionType type, struct DiscordUser* user, struct DiscordActivity* activity); +}; + +struct IDiscordActivityManager { + enum EDiscordResult (*register_command)(struct IDiscordActivityManager* manager, const char* command); + enum EDiscordResult (*register_steam)(struct IDiscordActivityManager* manager, uint32_t steam_id); + void (*update_activity)(struct IDiscordActivityManager* manager, struct DiscordActivity* activity, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*clear_activity)(struct IDiscordActivityManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*send_request_reply)(struct IDiscordActivityManager* manager, DiscordUserId user_id, enum EDiscordActivityJoinRequestReply reply, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*send_invite)(struct IDiscordActivityManager* manager, DiscordUserId user_id, enum EDiscordActivityActionType type, const char* content, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*accept_invite)(struct IDiscordActivityManager* manager, DiscordUserId user_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); +}; + +struct IDiscordRelationshipEvents { + void (*on_refresh)(void* event_data); + void (*on_relationship_update)(void* event_data, struct DiscordRelationship* relationship); +}; + +struct IDiscordRelationshipManager { + void (*filter)(struct IDiscordRelationshipManager* manager, void* filter_data, bool (*filter)(void* filter_data, struct DiscordRelationship* relationship)); + enum EDiscordResult (*count)(struct IDiscordRelationshipManager* manager, int32_t* count); + enum EDiscordResult (*get)(struct IDiscordRelationshipManager* manager, DiscordUserId user_id, struct DiscordRelationship* relationship); + enum EDiscordResult (*get_at)(struct IDiscordRelationshipManager* manager, uint32_t index, struct DiscordRelationship* relationship); +}; + +struct IDiscordLobbyEvents { + void (*on_lobby_update)(void* event_data, int64_t lobby_id); + void (*on_lobby_delete)(void* event_data, int64_t lobby_id, uint32_t reason); + void (*on_member_connect)(void* event_data, int64_t lobby_id, int64_t user_id); + void (*on_member_update)(void* event_data, int64_t lobby_id, int64_t user_id); + void (*on_member_disconnect)(void* event_data, int64_t lobby_id, int64_t user_id); + void (*on_lobby_message)(void* event_data, int64_t lobby_id, int64_t user_id, uint8_t* data, uint32_t data_length); + void (*on_speaking)(void* event_data, int64_t lobby_id, int64_t user_id, bool speaking); + void (*on_network_message)(void* event_data, int64_t lobby_id, int64_t user_id, uint8_t channel_id, uint8_t* data, uint32_t data_length); +}; + +struct IDiscordLobbyManager { + enum EDiscordResult (*get_lobby_create_transaction)(struct IDiscordLobbyManager* manager, struct IDiscordLobbyTransaction** transaction); + enum EDiscordResult (*get_lobby_update_transaction)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, struct IDiscordLobbyTransaction** transaction); + enum EDiscordResult (*get_member_update_transaction)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, struct IDiscordLobbyMemberTransaction** transaction); + void (*create_lobby)(struct IDiscordLobbyManager* manager, struct IDiscordLobbyTransaction* transaction, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordLobby* lobby)); + void (*update_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, struct IDiscordLobbyTransaction* transaction, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*delete_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*connect_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordLobbySecret secret, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordLobby* lobby)); + void (*connect_lobby_with_activity_secret)(struct IDiscordLobbyManager* manager, DiscordLobbySecret activity_secret, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, struct DiscordLobby* lobby)); + void (*disconnect_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult (*get_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, struct DiscordLobby* lobby); + enum EDiscordResult (*get_lobby_activity_secret)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordLobbySecret* secret); + enum EDiscordResult (*get_lobby_metadata_value)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordMetadataKey key, DiscordMetadataValue* value); + enum EDiscordResult (*get_lobby_metadata_key)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, int32_t index, DiscordMetadataKey* key); + enum EDiscordResult (*lobby_metadata_count)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, int32_t* count); + enum EDiscordResult (*member_count)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, int32_t* count); + enum EDiscordResult (*get_member_user_id)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, int32_t index, DiscordUserId* user_id); + enum EDiscordResult (*get_member_user)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, struct DiscordUser* user); + enum EDiscordResult (*get_member_metadata_value)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, DiscordMetadataKey key, DiscordMetadataValue* value); + enum EDiscordResult (*get_member_metadata_key)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, int32_t index, DiscordMetadataKey* key); + enum EDiscordResult (*member_metadata_count)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, int32_t* count); + void (*update_member)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, struct IDiscordLobbyMemberTransaction* transaction, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*send_lobby_message)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, uint8_t* data, uint32_t data_length, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult (*get_search_query)(struct IDiscordLobbyManager* manager, struct IDiscordLobbySearchQuery** query); + void (*search)(struct IDiscordLobbyManager* manager, struct IDiscordLobbySearchQuery* query, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*lobby_count)(struct IDiscordLobbyManager* manager, int32_t* count); + enum EDiscordResult (*get_lobby_id)(struct IDiscordLobbyManager* manager, int32_t index, DiscordLobbyId* lobby_id); + void (*connect_voice)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*disconnect_voice)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult (*connect_network)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id); + enum EDiscordResult (*disconnect_network)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id); + enum EDiscordResult (*flush_network)(struct IDiscordLobbyManager* manager); + enum EDiscordResult (*open_network_channel)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, uint8_t channel_id, bool reliable); + enum EDiscordResult (*send_network_message)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, uint8_t channel_id, uint8_t* data, uint32_t data_length); +}; + +struct IDiscordNetworkEvents { + void (*on_message)(void* event_data, DiscordNetworkPeerId peer_id, DiscordNetworkChannelId channel_id, uint8_t* data, uint32_t data_length); + void (*on_route_update)(void* event_data, const char* route_data); +}; + +struct IDiscordNetworkManager { + void (*get_peer_id)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId* peer_id); + enum EDiscordResult (*flush)(struct IDiscordNetworkManager* manager); + enum EDiscordResult (*open_peer)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id, const char* route_data); + enum EDiscordResult (*update_peer)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id, const char* route_data); + enum EDiscordResult (*close_peer)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id); + enum EDiscordResult (*open_channel)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id, DiscordNetworkChannelId channel_id, bool reliable); + enum EDiscordResult (*close_channel)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id, DiscordNetworkChannelId channel_id); + enum EDiscordResult (*send_message)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId peer_id, DiscordNetworkChannelId channel_id, uint8_t* data, uint32_t data_length); +}; + +struct IDiscordOverlayEvents { + void (*on_toggle)(void* event_data, bool locked); +}; + +struct IDiscordOverlayManager { + void (*is_enabled)(struct IDiscordOverlayManager* manager, bool* enabled); + void (*is_locked)(struct IDiscordOverlayManager* manager, bool* locked); + void (*set_locked)(struct IDiscordOverlayManager* manager, bool locked, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*open_activity_invite)(struct IDiscordOverlayManager* manager, enum EDiscordActivityActionType type, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*open_guild_invite)(struct IDiscordOverlayManager* manager, const char* code, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*open_voice_settings)(struct IDiscordOverlayManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); +}; + +typedef void* IDiscordStorageEvents; + +struct IDiscordStorageManager { + enum EDiscordResult (*read)(struct IDiscordStorageManager* manager, const char* name, uint8_t* data, uint32_t data_length, uint32_t* read); + void (*read_async)(struct IDiscordStorageManager* manager, const char* name, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, uint8_t* data, uint32_t data_length)); + void (*read_async_partial)(struct IDiscordStorageManager* manager, const char* name, uint64_t offset, uint64_t length, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result, uint8_t* data, uint32_t data_length)); + enum EDiscordResult (*write)(struct IDiscordStorageManager* manager, const char* name, uint8_t* data, uint32_t data_length); + void (*write_async)(struct IDiscordStorageManager* manager, const char* name, uint8_t* data, uint32_t data_length, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult (*delete_)(struct IDiscordStorageManager* manager, const char* name); + enum EDiscordResult (*exists)(struct IDiscordStorageManager* manager, const char* name, bool* exists); + void (*count)(struct IDiscordStorageManager* manager, int32_t* count); + enum EDiscordResult (*stat)(struct IDiscordStorageManager* manager, const char* name, struct DiscordFileStat* stat); + enum EDiscordResult (*stat_at)(struct IDiscordStorageManager* manager, int32_t index, struct DiscordFileStat* stat); + enum EDiscordResult (*get_path)(struct IDiscordStorageManager* manager, DiscordPath* path); +}; + +struct IDiscordStoreEvents { + void (*on_entitlement_create)(void* event_data, struct DiscordEntitlement* entitlement); + void (*on_entitlement_delete)(void* event_data, struct DiscordEntitlement* entitlement); +}; + +struct IDiscordStoreManager { + void (*fetch_skus)(struct IDiscordStoreManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*count_skus)(struct IDiscordStoreManager* manager, int32_t* count); + enum EDiscordResult (*get_sku)(struct IDiscordStoreManager* manager, DiscordSnowflake sku_id, struct DiscordSku* sku); + enum EDiscordResult (*get_sku_at)(struct IDiscordStoreManager* manager, int32_t index, struct DiscordSku* sku); + void (*fetch_entitlements)(struct IDiscordStoreManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*count_entitlements)(struct IDiscordStoreManager* manager, int32_t* count); + enum EDiscordResult (*get_entitlement)(struct IDiscordStoreManager* manager, DiscordSnowflake entitlement_id, struct DiscordEntitlement* entitlement); + enum EDiscordResult (*get_entitlement_at)(struct IDiscordStoreManager* manager, int32_t index, struct DiscordEntitlement* entitlement); + enum EDiscordResult (*has_sku_entitlement)(struct IDiscordStoreManager* manager, DiscordSnowflake sku_id, bool* has_entitlement); + void (*start_purchase)(struct IDiscordStoreManager* manager, DiscordSnowflake sku_id, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); +}; + +struct IDiscordVoiceEvents { + void (*on_settings_update)(void* event_data); +}; + +struct IDiscordVoiceManager { + enum EDiscordResult (*get_input_mode)(struct IDiscordVoiceManager* manager, struct DiscordInputMode* input_mode); + void (*set_input_mode)(struct IDiscordVoiceManager* manager, struct DiscordInputMode input_mode, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult (*is_self_mute)(struct IDiscordVoiceManager* manager, bool* mute); + enum EDiscordResult (*set_self_mute)(struct IDiscordVoiceManager* manager, bool mute); + enum EDiscordResult (*is_self_deaf)(struct IDiscordVoiceManager* manager, bool* deaf); + enum EDiscordResult (*set_self_deaf)(struct IDiscordVoiceManager* manager, bool deaf); + enum EDiscordResult (*is_local_mute)(struct IDiscordVoiceManager* manager, DiscordSnowflake user_id, bool* mute); + enum EDiscordResult (*set_local_mute)(struct IDiscordVoiceManager* manager, DiscordSnowflake user_id, bool mute); + enum EDiscordResult (*get_local_volume)(struct IDiscordVoiceManager* manager, DiscordSnowflake user_id, uint8_t* volume); + enum EDiscordResult (*set_local_volume)(struct IDiscordVoiceManager* manager, DiscordSnowflake user_id, uint8_t volume); +}; + +struct IDiscordAchievementEvents { + void (*on_user_achievement_update)(void* event_data, struct DiscordUserAchievement* user_achievement); +}; + +struct IDiscordAchievementManager { + void (*set_user_achievement)(struct IDiscordAchievementManager* manager, DiscordSnowflake achievement_id, uint8_t percent_complete, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*fetch_user_achievements)(struct IDiscordAchievementManager* manager, void* callback_data, void (*callback)(void* callback_data, enum EDiscordResult result)); + void (*count_user_achievements)(struct IDiscordAchievementManager* manager, int32_t* count); + enum EDiscordResult (*get_user_achievement)(struct IDiscordAchievementManager* manager, DiscordSnowflake user_achievement_id, struct DiscordUserAchievement* user_achievement); + enum EDiscordResult (*get_user_achievement_at)(struct IDiscordAchievementManager* manager, int32_t index, struct DiscordUserAchievement* user_achievement); +}; + +typedef void* IDiscordCoreEvents; + +struct IDiscordCore { + void (*destroy)(struct IDiscordCore* core); + enum EDiscordResult (*run_callbacks)(struct IDiscordCore* core); + void (*set_log_hook)(struct IDiscordCore* core, enum EDiscordLogLevel min_level, void* hook_data, void (*hook)(void* hook_data, enum EDiscordLogLevel level, const char* message)); + struct IDiscordApplicationManager* (*get_application_manager)(struct IDiscordCore* core); + struct IDiscordUserManager* (*get_user_manager)(struct IDiscordCore* core); + struct IDiscordImageManager* (*get_image_manager)(struct IDiscordCore* core); + struct IDiscordActivityManager* (*get_activity_manager)(struct IDiscordCore* core); + struct IDiscordRelationshipManager* (*get_relationship_manager)(struct IDiscordCore* core); + struct IDiscordLobbyManager* (*get_lobby_manager)(struct IDiscordCore* core); + struct IDiscordNetworkManager* (*get_network_manager)(struct IDiscordCore* core); + struct IDiscordOverlayManager* (*get_overlay_manager)(struct IDiscordCore* core); + struct IDiscordStorageManager* (*get_storage_manager)(struct IDiscordCore* core); + struct IDiscordStoreManager* (*get_store_manager)(struct IDiscordCore* core); + struct IDiscordVoiceManager* (*get_voice_manager)(struct IDiscordCore* core); + struct IDiscordAchievementManager* (*get_achievement_manager)(struct IDiscordCore* core); +};
\ No newline at end of file diff --git a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java index d1175563..abecd8a7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java @@ -27,8 +27,6 @@ import kr.syeyoung.dungeonsguide.party.PartyJoinRequest; import kr.syeyoung.dungeonsguide.party.PartyManager; import kr.syeyoung.dungeonsguide.stomp.StompHeader; import kr.syeyoung.dungeonsguide.stomp.StompPayload; -import net.arikia.dev.drpc.*; -import net.arikia.dev.drpc.callbacks.*; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.json.JSONObject; @@ -40,65 +38,65 @@ public class RichPresenceManager implements Runnable { public RichPresenceManager() { t.start(); - Runtime.getRuntime().addShutdownHook(new Thread(DiscordRPC::discordShutdown)); +// Runtime.getRuntime().addShutdownHook(new Thread(DiscordRPC::discordShutdown)); } public void setup() { - DiscordRPC.discordInitialize("816298079732498473", new DiscordEventHandlers.Builder() - .setReadyEventHandler(new ReadyCallback() { - @Override - public void apply(DiscordUser user) { - updatePresence(); - } - }).setJoinRequestEventHandler(request -> { - PartyJoinRequest partyJoinRequest = new PartyJoinRequest(); - partyJoinRequest.setDiscordUser(request); - partyJoinRequest.setExpire(System.currentTimeMillis() + 30000); - - PartyInviteViewer.INSTANCE.joinRequests.add(partyJoinRequest); - }).setJoinGameEventHandler(joinSecret -> { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().method(StompHeader.SEND) - .header("destination", "/app/party.askedtojoin") - .payload(new JSONObject().put("token", joinSecret).toString())); - }).setErroredEventHandler((errorCode, message) -> { - System.out.println("ERROR! "+errorCode+ " - "+message); - t.interrupt(); - (t = new Thread(this)).start(); - }).setDisconnectedEventHandler((errorCode, message) -> { - System.out.println("ERROR! "+errorCode+ " - "+message); - t.interrupt(); - (t = new Thread(this)).start(); - }).build(), true); +// DiscordRPC.discordInitialize("816298079732498473", new DiscordEventHandlers.Builder() +// .setReadyEventHandler(new ReadyCallback() { +// @Override +// public void apply(DiscordUser user) { +// updatePresence(); +// } +// }).setJoinRequestEventHandler(request -> { +// PartyJoinRequest partyJoinRequest = new PartyJoinRequest(); +// partyJoinRequest.setDiscordUser(request); +// partyJoinRequest.setExpire(System.currentTimeMillis() + 30000); +// +// PartyInviteViewer.INSTANCE.joinRequests.add(partyJoinRequest); +// }).setJoinGameEventHandler(joinSecret -> { +// DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().method(StompHeader.SEND) +// .header("destination", "/app/party.askedtojoin") +// .payload(new JSONObject().put("token", joinSecret).toString())); +// }).setErroredEventHandler((errorCode, message) -> { +// System.out.println("ERROR! "+errorCode+ " - "+message); +// t.interrupt(); +// (t = new Thread(this)).start(); +// }).setDisconnectedEventHandler((errorCode, message) -> { +// System.out.println("ERROR! "+errorCode+ " - "+message); +// t.interrupt(); +// (t = new Thread(this)).start(); +// }).build(), true); } private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public void updatePresence() { - if (!skyblockStatus.isOnHypixel() || !FeatureRegistry.ADVANCED_RICHPRESENCE.isEnabled() || (!skyblockStatus.isOnSkyblock() && FeatureRegistry.ADVANCED_RICHPRESENCE.<Boolean>getParameter("disablenotskyblock").getValue())) { - DiscordRPC.discordClearPresence(); - } else { - String name = skyblockStatus.getDungeonName(); - if (name.trim().equals("Your Island")) name = "Private Island"; - DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(name); - richPresenceBuilder.setBigImage("mort", "mort") - .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), PartyManager.INSTANCE.getMaxParty()); - - if (skyblockStatus.getContext() != null) { - DungeonContext dungeonContext = skyblockStatus.getContext(); - long init = dungeonContext.getInit(); - richPresenceBuilder.setStartTimestamps(init); - - if (dungeonContext.getBossfightProcessor() != null) { - richPresenceBuilder.setDetails("Fighting "+dungeonContext.getBossfightProcessor().getBossName()+": "+dungeonContext.getBossfightProcessor().getCurrentPhase()); - } else { - richPresenceBuilder.setDetails("Clearing rooms"); - } - } - if (PartyManager.INSTANCE.isAllowAskToJoin()) - richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); - richPresenceBuilder.setDetails("Dungeons Guide"); - DiscordRPC.discordUpdatePresence(richPresenceBuilder.build()); - } +// if (!skyblockStatus.isOnHypixel() || !FeatureRegistry.ADVANCED_RICHPRESENCE.isEnabled() || (!skyblockStatus.isOnSkyblock() && FeatureRegistry.ADVANCED_RICHPRESENCE.<Boolean>getParameter("disablenotskyblock").getValue())) { +// DiscordRPC.discordClearPresence(); +// } else { +// String name = skyblockStatus.getDungeonName(); +// if (name.trim().equals("Your Island")) name = "Private Island"; +// DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(name); +// richPresenceBuilder.setBigImage("mort", "mort") +// .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), PartyManager.INSTANCE.getMaxParty()); +// +// if (skyblockStatus.getContext() != null) { +// DungeonContext dungeonContext = skyblockStatus.getContext(); +// long init = dungeonContext.getInit(); +// richPresenceBuilder.setStartTimestamps(init); +// +// if (dungeonContext.getBossfightProcessor() != null) { +// richPresenceBuilder.setDetails("Fighting "+dungeonContext.getBossfightProcessor().getBossName()+": "+dungeonContext.getBossfightProcessor().getCurrentPhase()); +// } else { +// richPresenceBuilder.setDetails("Clearing rooms"); +// } +// } +// if (PartyManager.INSTANCE.isAllowAskToJoin()) +// richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); +// richPresenceBuilder.setDetails("Dungeons Guide"); +// DiscordRPC.discordUpdatePresence(richPresenceBuilder.build()); +// } } @@ -119,17 +117,17 @@ public class RichPresenceManager implements Runnable { @Override public void run() { - try { - Thread.sleep(300L); - setup(); - while(!Thread.interrupted()) { - DiscordRPC.discordRunCallbacks(); - if (skyblockStatus.isOnSkyblock() && !lastLoc.equalsIgnoreCase(skyblockStatus.getDungeonName())) { - lastLoc = skyblockStatus.getDungeonName()+""; - } - updatePresence(); - Thread.sleep(300L); - } - } catch (Exception e) {e.printStackTrace();} +// try { +// Thread.sleep(300L); +// setup(); +// while(!Thread.interrupted()) { +// DiscordRPC.discordRunCallbacks(); +// if (skyblockStatus.isOnSkyblock() && !lastLoc.equalsIgnoreCase(skyblockStatus.getDungeonName())) { +// lastLoc = skyblockStatus.getDungeonName()+""; +// } +// updatePresence(); +// Thread.sleep(300L); +// } +// } catch (Exception e) {e.printStackTrace();} } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java new file mode 100644 index 00000000..973e5fca --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java @@ -0,0 +1,176 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk; + +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.Platform; +import com.sun.jna.Pointer; +import com.sun.jna.ptr.PointerByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.*; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.*; +import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityEvents; +import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityManager; +import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordCore; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.*; +import lombok.Getter; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.Collections; + +public class GameSDK { + @Getter + private static NativeGameSDK nativeGameSDK; + + static { + try { + extractLibrary(); + } catch (IOException e) { + e.printStackTrace(); + } + } + public static void extractLibrary() throws IOException { + String libName = System.mapLibraryName("discord_game_sdk"); + String dir = ""; + switch(Platform.getOSType()) { + case Platform.MAC: + dir = "darwin"; + break; + case Platform.LINUX: + dir = "linux"; + break; + case Platform.WINDOWS: + if (Platform.is64Bit()) dir = "win-x64"; + else dir = "win-x86"; + break; + default: + throw new IllegalStateException("Unsupported OS Type"); + } + + String resourceLoc = "/gamesdk/"+dir+"/"+libName; + File targetExtractionPath = new File("native/"+libName); + targetExtractionPath.getParentFile().mkdirs(); + try (InputStream is = GameSDK.class.getResourceAsStream(resourceLoc)) { + Files.copy(is, targetExtractionPath.toPath(), StandardCopyOption.REPLACE_EXISTING); + targetExtractionPath.deleteOnExit(); + } + + nativeGameSDK = (NativeGameSDK) Native.loadLibrary(targetExtractionPath.getAbsolutePath(), NativeGameSDK.class, + Collections.singletonMap(Library.OPTION_TYPE_MAPPER, GameSDKTypeMapper.INSTANCE)); + } + + public static void writeString(byte[] bts, String str) { + System.arraycopy(str.getBytes(), 0, bts, 0, str.getBytes().length); + } + public static String readString(byte[] bts) { + int i; + for (i = 0; i < bts.length && bts[i] != 0; i++); + byte[] asdasd = new byte[i+1]; + System.arraycopy(bts, 0, asdasd, 0, i); + return new String(asdasd); + } + + public static void main(String args[]) throws InterruptedException { + NativeGameSDK nativeGameSDK = getNativeGameSDK(); + DiscordCreateParams discordCreateParams = new DiscordCreateParams(); + discordCreateParams.client_id = new DiscordClientID(816298079732498473L); + + IDiscordActivityEvents activityEvents = new IDiscordActivityEvents(); + activityEvents.OnActivityInvite = new IDiscordActivityEvents.OnActivityInviteCallback() { + @Override + public void onActivityInvite(Pointer eventData, EDiscordActivityActionType type, DiscordUser user, DiscordActivity activity) { + + } + }; + activityEvents.OnActivityJoin = new IDiscordActivityEvents.OnActivityJoinCallback() { + @Override + public void onActivityJoin(Pointer eventData, String secret) { + + } + }; + activityEvents.OnActivityJoinRequest = new IDiscordActivityEvents.OnActivityJoinRequestCallback() { + @Override + public void onActivityJoinRequest(Pointer eventData, DiscordUser user) { + + } + }; + activityEvents.OnActivitySpectate = new IDiscordActivityEvents.OnActivitySpectateCallback() { + @Override + public void onActivitySpectate(Pointer eventData, String secret) { + + } + }; + activityEvents.write(); + discordCreateParams.activity_events = new IDiscordActivityEvents.ByReference(activityEvents.getPointer()); + + + PointerByReference pointerByReference = new PointerByReference(); + nativeGameSDK.DiscordCreate(new DiscordVersion(NativeGameSDK.DISCORD_VERSION), discordCreateParams, pointerByReference); + IDiscordCore iDiscordCore = new IDiscordCore(pointerByReference.getValue()); + + iDiscordCore.SetLogHook.setLogHook(iDiscordCore, EDiscordLogLevel.DiscordLogLevel_Debug, Pointer.NULL, new IDiscordCore.LogHook() { + @Override + public void hook(Pointer hookData, EDiscordLogLevel level, String message) { + System.out.println(message+" - "+level+" - "+hookData); + } + }); + + DiscordActivity discordActivity = new DiscordActivity(); + discordActivity.activityType = EDiscordActivityType.DiscordActivityType_Playing; + writeString(discordActivity.details, "Dungeons Guide RPC Test Det"); + writeString(discordActivity.state, "Dungeons Guide RPC Test Sta"); + discordActivity.party = new DiscordActivityParty(); + writeString(discordActivity.party.id, "partyid"); + discordActivity.party.discordActivityParty = new DiscordPartySize(); + discordActivity.party.discordActivityParty.current_size = new Int32(4); + discordActivity.party.discordActivityParty.max_size = new Int32(10); + discordActivity.instance = false; + discordActivity.timestamps = new DiscordActivityTimestamps(); + discordActivity.timestamps.start = new DiscordTimestamp(System.currentTimeMillis()); + discordActivity.timestamps.end = new DiscordTimestamp(System.currentTimeMillis()+1000*60*60); + discordActivity.secrets = new DiscordActivitySecrets(); + writeString(discordActivity.secrets.join, "thisisjoinsecret"); + writeString(discordActivity.secrets.spectate, "thisisspectatesecret"); + writeString(discordActivity.secrets.match, "thisismatchsecret"); + discordActivity.assets = new DiscordActivityAssets(); + writeString(discordActivity.assets.large_text, "thisislargetext"); + writeString(discordActivity.assets.large_image, "mort"); + + + + IDiscordActivityManager iDiscordActivityManager = iDiscordCore.GetActivityManager.getActivityManager(iDiscordCore); + iDiscordActivityManager.UpdateActivity.updateActivity(iDiscordActivityManager, discordActivity, Pointer.NULL, new NativeGameSDK.DiscordCallback() { + @Override + public void callback(Pointer callbackData, EDiscordResult result) { + System.out.println("Callback: "+callbackData+" - "+result); + } + }); + + while(true) { + iDiscordCore.RunCallbacks.runCallbacks(iDiscordCore); + Thread.sleep(100); + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java new file mode 100644 index 00000000..1d8a4ef8 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java @@ -0,0 +1,46 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna; + +import com.sun.jna.DefaultTypeMapper; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.*; + +public class GameSDKTypeMapper extends DefaultTypeMapper { + public static final GameSDKTypeMapper INSTANCE = new GameSDKTypeMapper(); + private GameSDKTypeMapper() { + addTypeConverter(EDiscordResult.class, new EDiscordResult.EDiscordResultTypeConverter()); + addTypeConverter(EDiscordCreateFlags.class, new EDiscordCreateFlags.EDiscordCreateFlagsTypeConverter()); + addTypeConverter(EDiscordLogLevel.class, new EDiscordLogLevel.EDiscordLogLevelTypeConverter()); + addTypeConverter(EDiscordUserFlag.class, new EDiscordUserFlag.EDiscordUserFlagTypeConverter()); + addTypeConverter(EDiscordPremiumType.class, new EDiscordPremiumType.EDiscordPremiumTypeTypeConverter()); + addTypeConverter(EDiscordImageType.class, new EDiscordImageType.EDiscordImageTypeTypeConverter()); + addTypeConverter(EDiscordActivityType.class, new EDiscordActivityType.EDiscordActivityTypeTypeConverter()); + addTypeConverter(EDiscordActivityActionType.class, new EDiscordActivityActionType.EDiscordActivityActionTypeTypeConverter()); + addTypeConverter(EDiscordActivityJoinRequestReply.class, new EDiscordActivityJoinRequestReply.EDiscordActivityJoinRequestReplyTypeConverter()); + addTypeConverter(EDiscordStatus.class, new EDiscordStatus.EDiscordStatusTypeConverter()); + addTypeConverter(EDiscordRelationshipType.class, new EDiscordRelationshipType.EDiscordRelationshipTypeTypeConverter()); + addTypeConverter(EDiscordLobbyType.class, new EDiscordLobbyType.EDiscordLobbyTypeTypeConverter()); + addTypeConverter(EDiscordLobbySearchComparison.class, new EDiscordLobbySearchComparison.EDiscordLobbySearchComparisonTypeConverter()); + addTypeConverter(EDiscordLobbySearchCast.class, new EDiscordLobbySearchCast.EDiscordLobbySearchCastTypeConverter()); + addTypeConverter(EDiscordLobbySearchDistance.class, new EDiscordLobbySearchDistance.EDiscordLobbySearchDistanceTypeConverter()); + addTypeConverter(EDiscordEntitlementType.class, new EDiscordEntitlementType.EDiscordEntitlementTypeTypeConverter()); + addTypeConverter(EDiscordSkuType.class, new EDiscordSkuType.EDiscordSkuTypeTypeConverter()); + addTypeConverter(EDiscordInputModeType.class, new EDiscordInputModeType.EDiscordInputModeTypeTypeConverter()); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java new file mode 100644 index 00000000..59fc0339 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java @@ -0,0 +1,50 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna; + +import com.sun.jna.Callback; +import com.sun.jna.Library; +import com.sun.jna.Pointer; +import com.sun.jna.ptr.PointerByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordCreateParams; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordVersion; + +public interface NativeGameSDK extends Library { + + public static final int DISCORD_VERSION = 2; + public static final int DISCORD_APPLICATION_MANAGER_VERSION = 1; + public static final int DISCORD_USER_MANAGER_VERSION = 1; + public static final int DISCORD_IMAGE_MANAGER_VERSION = 1; + public static final int DISCORD_ACTIVITY_MANAGER_VERSION = 1; + public static final int DISCORD_RELATIONSHIP_MANAGER_VERSION = 1; + public static final int DISCORD_LOBBY_MANAGER_VERSION = 1; + public static final int DISCORD_NETWORK_MANAGER_VERSION = 1; + public static final int DISCORD_OVERLAY_MANAGER_VERSION = 1; + public static final int DISCORD_STORAGE_MANAGER_VERSION = 1; + public static final int DISCORD_STORE_MANAGER_VERSION = 1; + public static final int DISCORD_VOICE_MANAGER_VERSION = 1; + public static final int DISCORD_ACHIEVEMENT_MANAGER_VERSION = 1; + + EDiscordResult DiscordCreate(DiscordVersion version, DiscordCreateParams params, PointerByReference result); // result is double pointer of IDiscordCore + + interface DiscordCallback extends Callback { + void callback(Pointer callbackData, EDiscordResult result); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java new file mode 100644 index 00000000..3b6951a2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java @@ -0,0 +1,42 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; + + +public class DiscordActivity extends DiscordStruct { + public EDiscordActivityType activityType = EDiscordActivityType.DiscordActivityType_Playing; + public Int64 applicationId = new Int64(); + public byte[] name = new byte[128]; + public byte[] state = new byte[128]; + public byte[] details = new byte[128]; + public DiscordActivityTimestamps timestamps; + public DiscordActivityAssets assets; + public DiscordActivityParty party; + public DiscordActivitySecrets secrets; + public boolean instance; + public DiscordActivity() {super();} public DiscordActivity(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordActivity implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordActivity implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java new file mode 100644 index 00000000..5908fb1d --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; + + +public class DiscordActivityAssets extends DiscordStruct{ + public byte[] large_image = new byte[128]; + public byte[] large_text = new byte[128]; + public byte[] small_image = new byte[128]; + public byte[] small_text = new byte[128]; + public DiscordActivityAssets() {super();}public DiscordActivityAssets(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordActivityAssets implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordActivityAssets implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java new file mode 100644 index 00000000..697cb6b8 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java @@ -0,0 +1,32 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; + + +public class DiscordActivityParty extends DiscordStruct { + public byte[] id = new byte[128]; + public DiscordPartySize discordActivityParty; + public DiscordActivityParty() {super();} public DiscordActivityParty(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordActivityParty implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordActivityParty implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java new file mode 100644 index 00000000..db8f42e9 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java @@ -0,0 +1,33 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; + + +public class DiscordActivitySecrets extends DiscordStruct { + public byte[] match = new byte[128]; + public byte[] join = new byte[128]; + public byte[] spectate = new byte[128]; + public DiscordActivitySecrets() {super();} public DiscordActivitySecrets(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordActivitySecrets implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordActivitySecrets implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java new file mode 100644 index 00000000..6f0c5f04 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java @@ -0,0 +1,32 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordTimestamp; + +public class DiscordActivityTimestamps extends DiscordStruct { + public DiscordTimestamp start = new DiscordTimestamp(); + public DiscordTimestamp end = new DiscordTimestamp(); + public DiscordActivityTimestamps() {super();} public DiscordActivityTimestamps(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordActivityTimestamps implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordActivityTimestamps implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java new file mode 100644 index 00000000..edb29844 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java @@ -0,0 +1,60 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.*; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordClientID; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordVersion; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; + +public class DiscordCreateParams extends DiscordStruct { public DiscordCreateParams() {super();} public DiscordCreateParams(Pointer pointer) {super(pointer);} + public DiscordClientID client_id = new DiscordClientID(); + public UInt64 flags = new UInt64(); + public Pointer events; // void* + public Pointer event_data; // void* + public Pointer application_events; + public DiscordVersion application_version = new DiscordVersion(); + public IDiscordUserEvents.ByReference user_events; + public DiscordVersion user_version= new DiscordVersion(); + public Pointer image_events;// void* + public DiscordVersion image_version= new DiscordVersion(); + public IDiscordActivityEvents.ByReference activity_events; + public DiscordVersion activity_version= new DiscordVersion(); + public IDiscordRelationshipEvents.ByReference relationship_events; + public DiscordVersion relationship_version= new DiscordVersion(); + public IDiscordLobbyEvents.ByReference lobby_events; + public DiscordVersion lobby_version= new DiscordVersion(); + public IDiscordNetworkEvents.ByReference network_events; + public DiscordVersion network_version= new DiscordVersion(); + public IDiscordOverlayEvents.ByReference overlay_events; + public DiscordVersion overlay_version= new DiscordVersion(); + public Pointer storage_events;// void* + public DiscordVersion storage_version= new DiscordVersion(); + public IDiscordStoreEvents.ByReference store_events; + public DiscordVersion store_version= new DiscordVersion(); + public IDiscordVoiceEvents.ByReference voice_events; + public DiscordVersion voice_version= new DiscordVersion(); + public IDiscordAchievementEvents.ByReference achievement_events; + public DiscordVersion achievement_version= new DiscordVersion(); + + public static class ByReference extends DiscordCreateParams implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordCreateParams implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java new file mode 100644 index 00000000..d3d4361e --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordEntitlementType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +public class DiscordEntitlement extends DiscordStruct { + public DiscordSnowflake id = new DiscordSnowflake(); + public EDiscordEntitlementType type = EDiscordEntitlementType.DiscordEntitlementType_Purchase; + public DiscordSnowflake sku_id = new DiscordSnowflake(); + public DiscordEntitlement() {super();} public DiscordEntitlement(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordEntitlement implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordEntitlement implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java new file mode 100644 index 00000000..200ac74a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; + +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; + +public class DiscordFileStat extends DiscordStruct { + public byte[] filename = new byte[260]; + public UInt64 size = new UInt64(); + public UInt64 last_modified = new UInt64(); + public DiscordFileStat() {super();} public DiscordFileStat(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordFileStat implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordFileStat implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java new file mode 100644 index 00000000..6d569993 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java @@ -0,0 +1,32 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class DiscordImageDimensions extends DiscordStruct { + public UInt32 width = new UInt32(); + public UInt32 height = new UInt32(); + public DiscordImageDimensions() {super();} public DiscordImageDimensions(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordImageDimensions implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) { super(pointer);}} + public static class ByValue extends DiscordImageDimensions implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) { super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java new file mode 100644 index 00000000..1eafce70 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java @@ -0,0 +1,35 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordImageType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class DiscordImageHandle extends DiscordStruct { + public EDiscordImageType type = EDiscordImageType.DiscordImageType_User; + public Int64 integerType = new Int64(); + public UInt32 size = new UInt32(); + public DiscordImageHandle() {super();} public DiscordImageHandle(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordImageHandle implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordImageHandle implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java new file mode 100644 index 00000000..45084b56 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java @@ -0,0 +1,33 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordInputModeType; + + +public class DiscordInputMode extends DiscordStruct { + public EDiscordInputModeType type = EDiscordInputModeType.DiscordInputModeType_PushToTalk; + public byte[] shortcut = new byte[256]; + public DiscordInputMode() {super();} public DiscordInputMode(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordInputMode implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordInputMode implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java new file mode 100644 index 00000000..514ddadf --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java @@ -0,0 +1,39 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbyType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class DiscordLobby extends DiscordStruct { + public DiscordSnowflake id = new DiscordSnowflake(); + public EDiscordLobbyType type = EDiscordLobbyType.DiscordLobbyType_Private; + public DiscordSnowflake owner_id = new DiscordSnowflake(); + public byte[] secret = new byte[128]; + public UInt32 capacity = new UInt32(); + public boolean locked; + public DiscordLobby() {super();} public DiscordLobby(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordLobby implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordLobby implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java new file mode 100644 index 00000000..f03a0aa3 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordTimestamp; + + +public class DiscordOAuth2Token extends DiscordStruct { + public byte[] access_token = new byte[128]; + public byte[] scopes = new byte[1024]; + public DiscordTimestamp expires = new DiscordTimestamp(); + public DiscordOAuth2Token() {super();} public DiscordOAuth2Token(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordOAuth2Token implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordOAuth2Token implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java new file mode 100644 index 00000000..a890d235 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java @@ -0,0 +1,32 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; + +public class DiscordPartySize extends DiscordStruct{ + public Int32 current_size = new Int32(); + public Int32 max_size = new Int32(); + public DiscordPartySize() {super();} public DiscordPartySize(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordPartySize implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordPartySize implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java new file mode 100644 index 00000000..1c17bdac --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java @@ -0,0 +1,32 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordStatus; + +public class DiscordPresence extends DiscordStruct { + public EDiscordStatus status = EDiscordStatus.DiscordStatus_Offline; + public DiscordActivity activity; + public DiscordPresence() {super();} public DiscordPresence(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordPresence implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordPresence implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java new file mode 100644 index 00000000..3b22d0d2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java @@ -0,0 +1,33 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType; + +public class DiscordRelationship extends DiscordStruct { + public EDiscordRelationshipType type = EDiscordRelationshipType.DiscordRelationshipType_None; + public DiscordUser user; + public DiscordPresence presence; + public DiscordRelationship() {super();} public DiscordRelationship(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordRelationship implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordRelationship implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java new file mode 100644 index 00000000..51693fa0 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java @@ -0,0 +1,36 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordSkuType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + + +public class DiscordSku extends DiscordStruct { + public DiscordSnowflake id = new DiscordSnowflake(); + public EDiscordSkuType type = EDiscordSkuType.DiscordSkuType_Application; + public byte[] name = new byte[256]; + public DiscordSkuPrice discordSkuPrice; + public DiscordSku() {super();} public DiscordSku(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordSku implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordSku implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java new file mode 100644 index 00000000..74be946a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java @@ -0,0 +1,33 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; + +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class DiscordSkuPrice extends DiscordStruct { + public UInt32 amount = new UInt32(); + public byte[] currency = new byte[16]; + public DiscordSkuPrice() {super();} public DiscordSkuPrice(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordSkuPrice implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordSkuPrice implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java new file mode 100644 index 00000000..f6a19d82 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java @@ -0,0 +1,36 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Library; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import com.sun.jna.TypeMapper; +import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; + +import java.util.Collections; +import java.util.Map; + +public abstract class DiscordStruct extends Structure { + public static final Map<String, Object> OPTIONS = Collections.singletonMap(Library.OPTION_TYPE_MAPPER, GameSDKTypeMapper.INSTANCE); + protected DiscordStruct() { + super(GameSDKTypeMapper.INSTANCE); + } + protected DiscordStruct(Pointer p) {super(p); read();} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java new file mode 100644 index 00000000..7abd0c71 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java @@ -0,0 +1,38 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +import lombok.Getter; +import lombok.Setter; + +public class DiscordUser extends DiscordStruct { + public DiscordSnowflake id = new DiscordSnowflake(); + public byte[] username = new byte[256]; + public byte[] discriminator = new byte[8]; + public byte[] avatar = new byte[128]; + public boolean bot; + public DiscordUser() {super();} public DiscordUser(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordUser implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordUser implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java new file mode 100644 index 00000000..1f2b4cb8 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java @@ -0,0 +1,36 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; + +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class DiscordUserAchievement extends DiscordStruct { + public DiscordSnowflake user_id = new DiscordSnowflake(); + public DiscordSnowflake achievement_id = new DiscordSnowflake(); + public UInt32 percent_complete = new UInt32(); + public byte[] unlocked_at = new byte[64]; + public DiscordUserAchievement() {super();} public DiscordUserAchievement(Pointer pointer) {super(pointer);} + + public static class ByReference extends DiscordUserAchievement implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends DiscordUserAchievement implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java new file mode 100644 index 00000000..d46fdfc6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordActivityActionType { + DiscordActivityActionType_Join(1), + DiscordActivityActionType_Spectate(2); + + @Getter + private final int value; + private EDiscordActivityActionType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordActivityActionType> valueMap = new HashMap<>(); + static { + for (EDiscordActivityActionType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordActivityActionType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordActivityActionTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordActivityActionType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordActivityActionType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java new file mode 100644 index 00000000..a8deda60 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java @@ -0,0 +1,68 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordActivityJoinRequestReply { + DiscordActivityJoinRequestReply_No(0), + DiscordActivityJoinRequestReply_Yes(1), + DiscordActivityJoinRequestReply_Ignore(2); + + @Getter + private final int value; + private EDiscordActivityJoinRequestReply(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordActivityJoinRequestReply> valueMap = new HashMap<>(); + static { + for (EDiscordActivityJoinRequestReply value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordActivityJoinRequestReply fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordActivityJoinRequestReplyTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordActivityJoinRequestReply.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordActivityJoinRequestReply)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java new file mode 100644 index 00000000..9328758a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordActivityType { + DiscordActivityType_Playing(0), + DiscordActivityType_Streaming(1), + DiscordActivityType_Listening(2), + DiscordActivityType_Watching(3); + + @Getter + private final int value; + private EDiscordActivityType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordActivityType> valueMap = new HashMap<>(); + static { + for (EDiscordActivityType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordActivityType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordActivityTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordActivityType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordActivityType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java new file mode 100644 index 00000000..29598b47 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordCreateFlags { + DiscordCreateFlags_Default(0), + DiscordCreateFlags_NoRequireDiscord(1); + + @Getter + private final int value; + private EDiscordCreateFlags(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordCreateFlags> valueMap = new HashMap<>(); + static { + for (EDiscordCreateFlags value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordCreateFlags fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordCreateFlagsTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordCreateFlags.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordCreateFlags)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java new file mode 100644 index 00000000..d155fbc6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java @@ -0,0 +1,72 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordEntitlementType { + DiscordEntitlementType_Purchase(1), + DiscordEntitlementType_PremiumSubscription(2), + DiscordEntitlementType_DeveloperGift(3), + DiscordEntitlementType_TestModePurchase(4), + DiscordEntitlementType_FreePurchase(5), + DiscordEntitlementType_UserGift(6), + DiscordEntitlementType_PremiumPurchase(7); + + @Getter + private final int value; + private EDiscordEntitlementType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordEntitlementType> valueMap = new HashMap<>(); + static { + for (EDiscordEntitlementType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordEntitlementType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordEntitlementTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordEntitlementType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordEntitlementType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java new file mode 100644 index 00000000..db4258db --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java @@ -0,0 +1,66 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordImageType { + DiscordImageType_User(0); + + @Getter + private final int value; + private EDiscordImageType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordImageType> valueMap = new HashMap<>(); + static { + for (EDiscordImageType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordImageType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordImageTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordImageType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + + if (value == null) return 0;return ((EDiscordImageType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java new file mode 100644 index 00000000..1cc49b7e --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordInputModeType { + DiscordInputModeType_VoiceActivity(0), + DiscordInputModeType_PushToTalk(1); + + @Getter + private final int value; + private EDiscordInputModeType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordInputModeType> valueMap = new HashMap<>(); + static { + for (EDiscordInputModeType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordInputModeType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordInputModeTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordInputModeType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordInputModeType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java new file mode 100644 index 00000000..5bd97267 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordLobbySearchCast { + DiscordLobbySearchCast_String(1), + DiscordLobbySearchCast_Number(2); + + @Getter + private final int value; + private EDiscordLobbySearchCast(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordLobbySearchCast> valueMap = new HashMap<>(); + static { + for (EDiscordLobbySearchCast value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordLobbySearchCast fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordLobbySearchCastTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordLobbySearchCast.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordLobbySearchCast)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java new file mode 100644 index 00000000..5cc8f934 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java @@ -0,0 +1,71 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordLobbySearchComparison { + DiscordLobbySearchComparison_LessThanOrEqual(-2), + DiscordLobbySearchComparison_LessThan(-1), + DiscordLobbySearchComparison_Equal(0), + DiscordLobbySearchComparison_GreaterThan(1), + DiscordLobbySearchComparison_GreaterThanOrEqual(2), + DiscordLobbySearchComparison_NotEqual(3); + + @Getter + private final int value; + private EDiscordLobbySearchComparison(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordLobbySearchComparison> valueMap = new HashMap<>(); + static { + for (EDiscordLobbySearchComparison value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordLobbySearchComparison fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordLobbySearchComparisonTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordLobbySearchComparison.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordLobbySearchComparison)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java new file mode 100644 index 00000000..e8a920ea --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordLobbySearchDistance { + DiscordLobbySearchDistance_Local(0), + DiscordLobbySearchDistance_Default(1), + DiscordLobbySearchDistance_Extended(2), + DiscordLobbySearchDistance_Global(3); + + @Getter + private final int value; + private EDiscordLobbySearchDistance(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordLobbySearchDistance> valueMap = new HashMap<>(); + static { + for (EDiscordLobbySearchDistance value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordLobbySearchDistance fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordLobbySearchDistanceTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordLobbySearchDistance.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordLobbySearchDistance)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java new file mode 100644 index 00000000..d8353d59 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordLobbyType { + DiscordLobbyType_Private(1), + DiscordLobbyType_Public(2); + + @Getter + private final int value; + private EDiscordLobbyType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordLobbyType> valueMap = new HashMap<>(); + static { + for (EDiscordLobbyType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordLobbyType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordLobbyTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordLobbyType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + + if (value == null) return 0;return ((EDiscordLobbyType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java new file mode 100644 index 00000000..0fa0f3ab --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordLogLevel { + DiscordLogLevel_Error(1), + DiscordLogLevel_Warn(2), + DiscordLogLevel_Info(3), + DiscordLogLevel_Debug(4); + + @Getter + private final int value; + private EDiscordLogLevel(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordLogLevel> valueMap = new HashMap<>(); + static { + for (EDiscordLogLevel value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordLogLevel fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordLogLevelTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordLogLevel.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + + if (value == null) return 0;return ((EDiscordLogLevel)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java new file mode 100644 index 00000000..4ca426d5 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java @@ -0,0 +1,68 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordPremiumType { + DiscordPremiumType_None(0), + DiscordPremiumType_Tier1(1), + DiscordPremiumType_Tier2(2); + + @Getter + private final int value; + private EDiscordPremiumType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordPremiumType> valueMap = new HashMap<>(); + static { + for (EDiscordPremiumType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordPremiumType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordPremiumTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordPremiumType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordPremiumType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java new file mode 100644 index 00000000..b2edb714 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java @@ -0,0 +1,71 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordRelationshipType { + DiscordRelationshipType_None(0), + DiscordRelationshipType_Friend(1), + DiscordRelationshipType_Blocked(2), + DiscordRelationshipType_PendingIncoming(3), + DiscordRelationshipType_PendingOutgoing(4), + DiscordRelationshipType_Implicit(5); + + @Getter + private final int value; + private EDiscordRelationshipType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordRelationshipType> valueMap = new HashMap<>(); + static { + for (EDiscordRelationshipType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordRelationshipType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordRelationshipTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordRelationshipType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordRelationshipType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java new file mode 100644 index 00000000..cb0541bf --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java @@ -0,0 +1,109 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordResult { + DiscordResult_Ok(0), + DiscordResult_ServiceUnavailable(1), + DiscordResult_InvalidVersion(2), + DiscordResult_LockFailed(3), + DiscordResult_InternalError(4), + DiscordResult_InvalidPayload(5), + DiscordResult_InvalidCommand(6), + DiscordResult_InvalidPermissions(7), + DiscordResult_NotFetched(8), + DiscordResult_NotFound(9), + DiscordResult_Conflict(10), + DiscordResult_InvalidSecret(11), + DiscordResult_InvalidJoinSecret(12), + DiscordResult_NoEligibleActivity(13), + DiscordResult_InvalidInvite(14), + DiscordResult_NotAuthenticated(15), + DiscordResult_InvalidAccessToken(16), + DiscordResult_ApplicationMismatch(17), + DiscordResult_InvalidDataUrl(18), + DiscordResult_InvalidBase64(19), + DiscordResult_NotFiltered(20), + DiscordResult_LobbyFull(21), + DiscordResult_InvalidLobbySecret(22), + DiscordResult_InvalidFilename(23), + DiscordResult_InvalidFileSize(24), + DiscordResult_InvalidEntitlement(25), + DiscordResult_NotInstalled(26), + DiscordResult_NotRunning(27), + DiscordResult_InsufficientBuffer(28), + DiscordResult_PurchaseCanceled(29), + DiscordResult_InvalidGuild(30), + DiscordResult_InvalidEvent(31), + DiscordResult_InvalidChannel(32), + DiscordResult_InvalidOrigin(33), + DiscordResult_RateLimited(34), + DiscordResult_OAuth2Error(35), + DiscordResult_SelectChannelTimeout(36), + DiscordResult_GetGuildTimeout(37), + DiscordResult_SelectVoiceForceRequired(38), + DiscordResult_CaptureShortcutAlreadyListening(39), + DiscordResult_UnauthorizedForAchievement(40), + DiscordResult_InvalidGiftCode(41), + DiscordResult_PurchaseError(42), + DiscordResult_TransactionAborted(43); + + @Getter + private final int value; + private EDiscordResult(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordResult> valueMap = new HashMap<>(); + static { + for (EDiscordResult value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordResult fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordResultTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordResult.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordResult)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java new file mode 100644 index 00000000..ba174a17 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordSkuType { + DiscordSkuType_Application(1), + DiscordSkuType_DLC(2), + DiscordSkuType_Consumable(3), + DiscordSkuType_Bundle(4); + + @Getter + private final int value; + private EDiscordSkuType(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordSkuType> valueMap = new HashMap<>(); + static { + for (EDiscordSkuType value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordSkuType fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordSkuTypeTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordSkuType.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + + if (value == null) return 0;return ((EDiscordSkuType)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java new file mode 100644 index 00000000..b788aa62 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordStatus { + DiscordStatus_Offline(0), + DiscordStatus_Online(1), + DiscordStatus_Idle(2), + DiscordStatus_DoNotDisturb(3); + + @Getter + private final int value; + private EDiscordStatus(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordStatus> valueMap = new HashMap<>(); + static { + for (EDiscordStatus value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordStatus fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordStatusTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordStatus.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + + if (value == null) return 0;return ((EDiscordStatus)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java new file mode 100644 index 00000000..242e5f1e --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java @@ -0,0 +1,70 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; + +import com.sun.jna.FromNativeContext; +import com.sun.jna.ToNativeContext; +import com.sun.jna.TypeConverter; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +public enum EDiscordUserFlag { + DiscordUserFlag_Partner(2), + DiscordUserFlag_HypeSquadEvents(4), + DiscordUserFlag_HypeSquadHouse1(64), + DiscordUserFlag_HypeSquadHouse2(128), + DiscordUserFlag_HypeSquadHouse3(256); + + @Getter + private final int value; + private EDiscordUserFlag(int value) { + this.value = value; + } + + private static final Map<Integer,EDiscordUserFlag> valueMap = new HashMap<>(); + static { + for (EDiscordUserFlag value : values()) { + valueMap.put(value.value, value); + } + } + + public static EDiscordUserFlag fromValue(int value) { + return valueMap.get(value); + } + + public static class EDiscordUserFlagTypeConverter implements TypeConverter { + @Override + public Object fromNative(Object nativeValue, FromNativeContext context) { + return EDiscordUserFlag.fromValue((Integer)nativeValue); + } + + @Override + public Object toNative(Object value, ToNativeContext context) { + if (value == null) return 0; + return ((EDiscordUserFlag)value).getValue(); + } + + @Override + public Class nativeType() { + return Integer.class; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java new file mode 100644 index 00000000..6f139163 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Library; +import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; + +import java.util.Collections; +import java.util.Map; + +public interface GameSDKCallback extends Callback { + public static final Map<String, Object> OPTIONS = Collections.singletonMap(Library.OPTION_TYPE_MAPPER, GameSDKTypeMapper.INSTANCE); +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java new file mode 100644 index 00000000..6cfd19cd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java @@ -0,0 +1,35 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUserAchievement; + +public class IDiscordAchievementEvents extends DiscordStruct { public IDiscordAchievementEvents() {super();} public IDiscordAchievementEvents(Pointer pointer) {super(pointer);} + public interface OnUserAchievementUpdateCallback extends GameSDKCallback { void onUserAchievementUpdate(Pointer eventData, DiscordUserAchievement userAchievement); } + public OnUserAchievementUpdateCallback OnUserAchievementUpdate; + + + + public static class ByReference extends IDiscordAchievementEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordAchievementEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java new file mode 100644 index 00000000..2103cf67 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java @@ -0,0 +1,53 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUserAchievement; + +public class IDiscordAchievementManager extends DiscordStruct { public IDiscordAchievementManager() {super();} public IDiscordAchievementManager(Pointer pointer) {super(pointer);} + public interface SetUserAchievementCallback extends GameSDKCallback { void setUserAchievement(IDiscordAchievementManager manager, DiscordSnowflake achievementId, UInt8 percentComplete, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SetUserAchievementCallback SetUserAchievement; + + public interface FetchUserAchievementsCallback extends GameSDKCallback { void fetchUserAchievements(IDiscordAchievementManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public FetchUserAchievementsCallback FetchUserAchievements; + + public interface CountUserAchievementsCallback extends GameSDKCallback { void countUserAchievements(IDiscordAchievementManager manager, IntByReference count); } + public CountUserAchievementsCallback CountUserAchievements; + + public interface GetUserAchievementCallback extends GameSDKCallback { EDiscordResult getUserAchievement(IDiscordAchievementManager manager, DiscordSnowflake userAchievementId, DiscordUserAchievement userAchievement); } + public GetUserAchievementCallback GetUserAchievement; + + public interface GetUserAchievementAtCallback extends GameSDKCallback { EDiscordResult getUserAchievementAt(IDiscordAchievementManager manager, Int32 index, DiscordUserAchievement userAchievement); } + public GetUserAchievementAtCallback GetUserAchievementAt; + + + + public static class ByReference extends IDiscordAchievementManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordAchievementManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java new file mode 100644 index 00000000..26819edd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java @@ -0,0 +1,46 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordActivity; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; + +public class IDiscordActivityEvents extends DiscordStruct { public IDiscordActivityEvents() {super();} public IDiscordActivityEvents(Pointer pointer) {super(pointer);} + public interface OnActivityJoinCallback extends GameSDKCallback { void onActivityJoin(Pointer eventData, String secret); } + public OnActivityJoinCallback OnActivityJoin; + + public interface OnActivitySpectateCallback extends GameSDKCallback { void onActivitySpectate(Pointer eventData, String secret); } + public OnActivitySpectateCallback OnActivitySpectate; + + public interface OnActivityJoinRequestCallback extends GameSDKCallback { void onActivityJoinRequest(Pointer eventData, DiscordUser user); } + public OnActivityJoinRequestCallback OnActivityJoinRequest; + + public interface OnActivityInviteCallback extends GameSDKCallback { void onActivityInvite(Pointer eventData, EDiscordActivityActionType type, DiscordUser user, DiscordActivity activity); } + public OnActivityInviteCallback OnActivityInvite; + + + + public static class ByReference extends IDiscordActivityEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordActivityEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java new file mode 100644 index 00000000..3c1f3c34 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java @@ -0,0 +1,59 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordActivity; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityJoinRequestReply; + +public class IDiscordActivityManager extends DiscordStruct { public IDiscordActivityManager() {super();} public IDiscordActivityManager(Pointer pointer) {super(pointer);} + public interface RegisterCommandCallback extends GameSDKCallback { EDiscordResult registerCommand(IDiscordActivityManager manager, String command); } + public RegisterCommandCallback RegisterCommand; + + public interface RegisterSteamCallback extends GameSDKCallback { EDiscordResult registerSteam(IDiscordActivityManager manager, UInt32 steamId); } + public RegisterSteamCallback RegisterSteam; + + public interface UpdateActivityCallback extends GameSDKCallback { void updateActivity(IDiscordActivityManager manager, DiscordActivity activity, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public UpdateActivityCallback UpdateActivity; + + public interface ClearActivityCallback extends GameSDKCallback { void clearActivity(IDiscordActivityManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public ClearActivityCallback ClearActivity; + + public interface SendRequestReplyCallback extends GameSDKCallback { void sendRequestReply(IDiscordActivityManager manager, DiscordSnowflake userId, EDiscordActivityJoinRequestReply reply, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SendRequestReplyCallback SendRequestReply; + + public interface SendInviteCallback extends GameSDKCallback { void sendInvite(IDiscordActivityManager manager, DiscordSnowflake userId, EDiscordActivityActionType type, String content, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SendInviteCallback SendInvite; + + public interface AcceptInviteCallback extends GameSDKCallback { void acceptInvite(IDiscordActivityManager manager, DiscordSnowflake userId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public AcceptInviteCallback AcceptInvite; + + + + public static class ByReference extends IDiscordActivityManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordActivityManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java new file mode 100644 index 00000000..294c2161 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java @@ -0,0 +1,56 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordOAuth2Token; + +public class IDiscordApplicationManager extends DiscordStruct { public IDiscordApplicationManager() {super();} public IDiscordApplicationManager(Pointer pointer) {super(pointer);} + public interface ValidateOrExitCallback extends GameSDKCallback { void validateOrExit(IDiscordApplicationManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public ValidateOrExitCallback ValidateOrExit; + + public interface GetCurrentLocaleCallback extends GameSDKCallback { void getCurrentLocale(IDiscordApplicationManager manager, Pointer locale); } // len 128 memory + public GetCurrentLocaleCallback GetCurrentLocale; + + public interface GetCurrentBranchCallback extends GameSDKCallback { void getCurrentBranch(IDiscordApplicationManager manager, Pointer branch); } // len 4096 mem + public GetCurrentBranchCallback GetCurrentBranch; + + public interface GetOauth2TokenCallback extends GameSDKCallback { void getOauth2Token(IDiscordApplicationManager manager, Pointer callbackData, GetOauth2TokenCallback_Callback callback); } + public interface GetOauth2TokenCallback_Callback extends GameSDKCallback { + void callback(Pointer callbackData, EDiscordResult result, DiscordOAuth2Token oauthToken); + } + + public GetOauth2TokenCallback GetOauth2Token; + + public interface GetTicketCallback extends GameSDKCallback { void getTicket(IDiscordApplicationManager manager, Pointer callbackData, GetTicketCallback_Callback callback); } + public interface GetTicketCallback_Callback extends GameSDKCallback { + void callback(Pointer callbackData, EDiscordResult result, String data); + } + public GetTicketCallback GetTicket; + + + + public static class ByReference extends IDiscordApplicationManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordApplicationManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java new file mode 100644 index 00000000..ccc4abdf --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java @@ -0,0 +1,87 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.TypeMapper; +import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLogLevel; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; + +public class IDiscordCore extends DiscordStruct { public IDiscordCore() {super();} public IDiscordCore(Pointer pointer) {super(pointer);} + + public static final TypeMapper TYPE_MAPPER = GameSDKTypeMapper.INSTANCE; + public interface DestroyCallback extends GameSDKCallback { void destroy(IDiscordCore core); } + public DestroyCallback Destroy; + + public interface RunCallbacksCallback extends GameSDKCallback { EDiscordResult runCallbacks(IDiscordCore core); } + public RunCallbacksCallback RunCallbacks; + + public interface SetLogHookCallback extends GameSDKCallback { void setLogHook(IDiscordCore core, EDiscordLogLevel minLevel, Pointer hookData, LogHook hook); } + public interface LogHook extends GameSDKCallback { + void hook(Pointer hookData, EDiscordLogLevel level, String message); + } + public SetLogHookCallback SetLogHook; + + public interface GetApplicationManagerCallback extends GameSDKCallback { IDiscordApplicationManager getApplicationManager(IDiscordCore core); } + public GetApplicationManagerCallback GetApplicationManager; + + public interface GetUserManagerCallback extends GameSDKCallback { IDiscordUserManager getUserManager(IDiscordCore core); } + public GetUserManagerCallback GetUserManager; + + public interface GetImageManagerCallback extends GameSDKCallback { IDiscordImageManager getImageManager(IDiscordCore core); } + public GetImageManagerCallback GetImageManager; + + public interface GetActivityManagerCallback extends GameSDKCallback { IDiscordActivityManager getActivityManager(IDiscordCore core); } + public GetActivityManagerCallback GetActivityManager; + + public interface GetRelationshipManagerCallback extends GameSDKCallback { IDiscordRelationshipManager getRelationshipManager(IDiscordCore core); } + public GetRelationshipManagerCallback GetRelationshipManager; + + public interface GetLobbyManagerCallback extends GameSDKCallback { IDiscordLobbyManager getLobbyManager(IDiscordCore core); } + public GetLobbyManagerCallback GetLobbyManager; + + public interface GetNetworkManagerCallback extends GameSDKCallback { IDiscordNetworkManager getNetworkManager(IDiscordCore core); } + public GetNetworkManagerCallback GetNetworkManager; + + public interface GetOverlayManagerCallback extends GameSDKCallback { IDiscordOverlayManager getOverlayManager(IDiscordCore core); } + public GetOverlayManagerCallback GetOverlayManager; + + public interface GetStorageManagerCallback extends GameSDKCallback { IDiscordStorageManager getStorageManager(IDiscordCore core); } + public GetStorageManagerCallback GetStorageManager; + + public interface GetStoreManagerCallback extends GameSDKCallback { IDiscordStoreManager getStoreManager(IDiscordCore core); } + public GetStoreManagerCallback GetStoreManager; + + public interface GetVoiceManagerCallback extends GameSDKCallback { IDiscordVoiceManager getVoiceManager(IDiscordCore core); } + public GetVoiceManagerCallback GetVoiceManager; + + public interface GetAchievementManagerCallback extends GameSDKCallback { IDiscordAchievementManager getAchievementManager(IDiscordCore core); } + public GetAchievementManagerCallback GetAchievementManager; + + + + public static class ByReference extends IDiscordCore implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);} + } + public static class ByValue extends IDiscordCore implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);} + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java new file mode 100644 index 00000000..f400724f --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java @@ -0,0 +1,48 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordImageDimensions; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordImageHandle; + +public class IDiscordImageManager extends DiscordStruct { public IDiscordImageManager() {super();} public IDiscordImageManager(Pointer pointer) {super(pointer);} + public interface FetchCallback_Callback extends GameSDKCallback { + void callback(Pointer callbackData, EDiscordResult result, DiscordImageHandle.ByValue handleResult); + } + public interface FetchCallback extends GameSDKCallback { void fetch(IDiscordImageManager manager, DiscordImageHandle.ByValue handle, boolean refresh, Pointer callbackData, FetchCallback_Callback callback); } + public FetchCallback Fetch; + + public interface GetDimensionsCallback extends GameSDKCallback { EDiscordResult getDimensions(IDiscordImageManager manager, DiscordImageHandle.ByValue handle, DiscordImageDimensions dimensions); } + public GetDimensionsCallback GetDimensions; + + public interface GetDataCallback extends GameSDKCallback { EDiscordResult getData(IDiscordImageManager manager, DiscordImageHandle.ByValue handle, ByteByReference data, UInt32 dataLength); } + public GetDataCallback GetData; + + + + public static class ByReference extends IDiscordImageManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordImageManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java new file mode 100644 index 00000000..879f89bc --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java @@ -0,0 +1,59 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; + +public class IDiscordLobbyEvents extends DiscordStruct { public IDiscordLobbyEvents() {super();} public IDiscordLobbyEvents(Pointer pointer) {super(pointer);} + public interface OnLobbyUpdateCallback extends GameSDKCallback { void onLobbyUpdate(Pointer eventData, Int64 lobbyId); } + public OnLobbyUpdateCallback OnLobbyUpdate; + + public interface OnLobbyDeleteCallback extends GameSDKCallback { void onLobbyDelete(Pointer eventData, Int64 lobbyId, UInt32 reason); } + public OnLobbyDeleteCallback OnLobbyDelete; + + public interface OnMemberConnectCallback extends GameSDKCallback { void onMemberConnect(Pointer eventData, Int64 lobbyId, Int64 userId); } + public OnMemberConnectCallback OnMemberConnect; + + public interface OnMemberUpdateCallback extends GameSDKCallback { void onMemberUpdate(Pointer eventData, Int64 lobbyId, Int64 userId); } + public OnMemberUpdateCallback OnMemberUpdate; + + public interface OnMemberDisconnectCallback extends GameSDKCallback { void onMemberDisconnect(Pointer eventData, Int64 lobbyId, Int64 userId); } + public OnMemberDisconnectCallback OnMemberDisconnect; + + public interface OnLobbyMessageCallback extends GameSDKCallback { void onLobbyMessage(Pointer eventData, Int64 lobbyId, Int64 userId, ByteByReference data, UInt32 dataLength); } + public OnLobbyMessageCallback OnLobbyMessage; + + public interface OnSpeakingCallback extends GameSDKCallback { void onSpeaking(Pointer eventData, Int64 lobbyId, Int64 userId, boolean speaking); } + public OnSpeakingCallback OnSpeaking; + + public interface OnNetworkMessageCallback extends GameSDKCallback { void onNetworkMessage(Pointer eventData, Int64 lobbyId, Int64 userId, UInt8 channelId, ByteByReference data, UInt32 dataLength); } + public OnNetworkMessageCallback OnNetworkMessage; + + + + public static class ByReference extends IDiscordLobbyEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordLobbyEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java new file mode 100644 index 00000000..cbaac01b --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java @@ -0,0 +1,144 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordLobby; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; + +public class IDiscordLobbyManager extends DiscordStruct { public IDiscordLobbyManager() {super();} public IDiscordLobbyManager(Pointer pointer) {super(pointer);} + public interface GetLobbyCreateTransactionCallback extends GameSDKCallback { EDiscordResult getLobbyCreateTransaction(IDiscordLobbyManager manager, IDiscordLobbyTransaction transaction); } + public GetLobbyCreateTransactionCallback GetLobbyCreateTransaction; + + public interface GetLobbyUpdateTransactionCallback extends GameSDKCallback { EDiscordResult getLobbyUpdateTransaction(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, IDiscordLobbyTransaction transaction); } + public GetLobbyUpdateTransactionCallback GetLobbyUpdateTransaction; + + public interface GetMemberUpdateTransactionCallback extends GameSDKCallback { EDiscordResult getMemberUpdateTransaction(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, IDiscordLobbyMemberTransaction transaction); } + public GetMemberUpdateTransactionCallback GetMemberUpdateTransaction; + + public interface DiscordLobbyManagerCallback extends GameSDKCallback { + void callback(Pointer callbackData, EDiscordResult result, DiscordLobby lobby); + } + + public interface CreateLobbyCallback extends GameSDKCallback { void createLobby(IDiscordLobbyManager manager, IDiscordLobbyTransaction transaction, Pointer callbackData,DiscordLobbyManagerCallback callback); } + public CreateLobbyCallback CreateLobby; + + public interface UpdateLobbyCallback extends GameSDKCallback { void updateLobby(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, IDiscordLobbyTransaction transaction, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public UpdateLobbyCallback UpdateLobby; + + public interface DeleteLobbyCallback extends GameSDKCallback { void deleteLobby(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public DeleteLobbyCallback DeleteLobby; + + public interface ConnectLobbyCallback extends GameSDKCallback { void connectLobby(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer secret, Pointer callbackData, DiscordLobbyManagerCallback callback); }// secret 128 byte long str + public ConnectLobbyCallback ConnectLobby; + + public interface ConnectLobbyWithActivitySecretCallback extends GameSDKCallback { void connectLobbyWithActivitySecret(IDiscordLobbyManager manager, Pointer activitySecret, Pointer callbackData, DiscordLobbyManagerCallback callback); } // secret 128 byte long str + public ConnectLobbyWithActivitySecretCallback ConnectLobbyWithActivitySecret; + + public interface DisconnectLobbyCallback extends GameSDKCallback { void disconnectLobby(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public DisconnectLobbyCallback DisconnectLobby; + + public interface GetLobbyCallback extends GameSDKCallback { EDiscordResult getLobby(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordLobby lobby); } + public GetLobbyCallback GetLobby; + + public interface GetLobbyActivitySecretCallback extends GameSDKCallback { EDiscordResult getLobbyActivitySecret(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer secret); } // pointer to char[128] + public GetLobbyActivitySecretCallback GetLobbyActivitySecret; + + public interface GetLobbyMetadataValueCallback extends GameSDKCallback { EDiscordResult getLobbyMetadataValue(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer key, Pointer value); } // key: char[256] value: pointer to char[4096] + public GetLobbyMetadataValueCallback GetLobbyMetadataValue; + + public interface GetLobbyMetadataKeyCallback extends GameSDKCallback { EDiscordResult getLobbyMetadataKey(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Int32 index, Pointer key); }// key: pointer to char[256] + public GetLobbyMetadataKeyCallback GetLobbyMetadataKey; + + public interface LobbyMetadataCountCallback extends GameSDKCallback { EDiscordResult lobbyMetadataCount(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, IntByReference count); } + public LobbyMetadataCountCallback LobbyMetadataCount; + + public interface MemberCountCallback extends GameSDKCallback { EDiscordResult memberCount(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, IntByReference count); } + public MemberCountCallback MemberCount; + + public interface GetMemberUserIdCallback extends GameSDKCallback { EDiscordResult getMemberUserId(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Int32 index, Pointer userId); } // userID: pointer to DiscordUserID + public GetMemberUserIdCallback GetMemberUserId; + + public interface GetMemberUserCallback extends GameSDKCallback { EDiscordResult getMemberUser(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, DiscordUser user); } + public GetMemberUserCallback GetMemberUser; + + public interface GetMemberMetadataValueCallback extends GameSDKCallback { EDiscordResult getMemberMetadataValue(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, Pointer key, Pointer value); }// key: char[256] value: pointer to char[4096] + public GetMemberMetadataValueCallback GetMemberMetadataValue; + + public interface GetMemberMetadataKeyCallback extends GameSDKCallback { EDiscordResult getMemberMetadataKey(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, Int32 index, Pointer key); }// key: pointer to char[256] + public GetMemberMetadataKeyCallback GetMemberMetadataKey; + + public interface MemberMetadataCountCallback extends GameSDKCallback { EDiscordResult memberMetadataCount(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, IntByReference count); } + public MemberMetadataCountCallback MemberMetadataCount; + + public interface UpdateMemberCallback extends GameSDKCallback { void updateMember(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, IDiscordLobbyMemberTransaction transaction, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public UpdateMemberCallback UpdateMember; + + public interface SendLobbyMessageCallback extends GameSDKCallback { void sendLobbyMessage(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, ByteByReference data, UInt32 dataLength, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SendLobbyMessageCallback SendLobbyMessage; + + public interface GetSearchQueryCallback extends GameSDKCallback { EDiscordResult getSearchQuery(IDiscordLobbyManager manager, IDiscordLobbySearchQuery query); } + public GetSearchQueryCallback GetSearchQuery; + + public interface SearchCallback extends GameSDKCallback { void search(IDiscordLobbyManager manager, IDiscordLobbySearchQuery query, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SearchCallback Search; + + public interface LobbyCountCallback extends GameSDKCallback { void lobbyCount(IDiscordLobbyManager manager, IntByReference count); } + public LobbyCountCallback LobbyCount; + + public interface GetLobbyIdCallback extends GameSDKCallback { EDiscordResult getLobbyId(IDiscordLobbyManager manager, Int32 index, Pointer lobbyId); } // lobbyID: Pointer to DiscordSnowflake + public GetLobbyIdCallback GetLobbyId; + + public interface ConnectVoiceCallback extends GameSDKCallback { void connectVoice(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public ConnectVoiceCallback ConnectVoice; + + public interface DisconnectVoiceCallback extends GameSDKCallback { void disconnectVoice(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public DisconnectVoiceCallback DisconnectVoice; + + public interface ConnectNetworkCallback extends GameSDKCallback { EDiscordResult connectNetwork(IDiscordLobbyManager manager, DiscordSnowflake lobbyId); } + public ConnectNetworkCallback ConnectNetwork; + + public interface DisconnectNetworkCallback extends GameSDKCallback { EDiscordResult disconnectNetwork(IDiscordLobbyManager manager, DiscordSnowflake lobbyId); } + public DisconnectNetworkCallback DisconnectNetwork; + + public interface FlushNetworkCallback extends GameSDKCallback { EDiscordResult flushNetwork(IDiscordLobbyManager manager); } + public FlushNetworkCallback FlushNetwork; + + public interface OpenNetworkChannelCallback extends GameSDKCallback { EDiscordResult openNetworkChannel(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, UInt8 channelId, boolean reliable); } + public OpenNetworkChannelCallback OpenNetworkChannel; + + public interface SendNetworkMessageCallback extends GameSDKCallback { EDiscordResult sendNetworkMessage(IDiscordLobbyManager manager, DiscordSnowflake lobbyId, DiscordSnowflake userId, UInt8 channelId, ByteByReference data, UInt32 dataLength); } + public SendNetworkMessageCallback SendNetworkMessage; + + + + public static class ByReference extends IDiscordLobbyManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordLobbyManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java new file mode 100644 index 00000000..1b79a900 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java @@ -0,0 +1,38 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; + +public class IDiscordLobbyMemberTransaction extends DiscordStruct { public IDiscordLobbyMemberTransaction() {super();} public IDiscordLobbyMemberTransaction(Pointer pointer) {super(pointer);} + public interface SetMetadataCallback extends GameSDKCallback { EDiscordResult setMetadata(IDiscordLobbyMemberTransaction lobbyMemberTransaction, Pointer key, Pointer value); } // key is 256 bytes, value is 4096 + public SetMetadataCallback SetMetadata; + + public interface DeleteMetadataCallback extends GameSDKCallback { EDiscordResult deleteMetadata(IDiscordLobbyMemberTransaction lobbyMemberTransaction, Pointer key); } // key is 256 bytes, passed by reference + public DeleteMetadataCallback DeleteMetadata; + + + + public static class ByReference extends IDiscordLobbyMemberTransaction implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordLobbyMemberTransaction implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java new file mode 100644 index 00000000..e2061b13 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java @@ -0,0 +1,48 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchComparison; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchDistance; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchCast; + +public class IDiscordLobbySearchQuery extends DiscordStruct { public IDiscordLobbySearchQuery() {super();} public IDiscordLobbySearchQuery(Pointer pointer) {super(pointer);} + public interface FilterCallback extends GameSDKCallback { EDiscordResult filter(IDiscordLobbySearchQuery lobbySearchQuery, Pointer key, EDiscordLobbySearchComparison comparison, EDiscordLobbySearchCast cast, Pointer value); } + public FilterCallback Filter; + + public interface SortCallback extends GameSDKCallback { EDiscordResult sort(IDiscordLobbySearchQuery lobbySearchQuery, Pointer key, EDiscordLobbySearchCast cast, Pointer value); } + public SortCallback Sort; + + public interface LimitCallback extends GameSDKCallback { EDiscordResult limit(IDiscordLobbySearchQuery lobbySearchQuery, UInt32 limit); } + public LimitCallback Limit; + + public interface DistanceCallback extends GameSDKCallback { EDiscordResult distance(IDiscordLobbySearchQuery lobbySearchQuery, EDiscordLobbySearchDistance distance); } + public DistanceCallback Distance; + + + + public static class ByReference extends IDiscordLobbySearchQuery implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordLobbySearchQuery implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java new file mode 100644 index 00000000..2a49e516 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java @@ -0,0 +1,53 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbyType; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +public class IDiscordLobbyTransaction extends DiscordStruct { public IDiscordLobbyTransaction() {super();} public IDiscordLobbyTransaction(Pointer pointer) {super(pointer);} + public interface SetTypeCallback extends GameSDKCallback { EDiscordResult setType(IDiscordLobbyTransaction lobbyTransaction, EDiscordLobbyType type); } + public SetTypeCallback SetType; + + public interface SetOwnerCallback extends GameSDKCallback { EDiscordResult setOwner(IDiscordLobbyTransaction lobbyTransaction, DiscordSnowflake ownerId); } + public SetOwnerCallback SetOwner; + + public interface SetCapacityCallback extends GameSDKCallback { EDiscordResult setCapacity(IDiscordLobbyTransaction lobbyTransaction, UInt32 capacity); } + public SetCapacityCallback SetCapacity; + + public interface SetMetadataCallback extends GameSDKCallback { EDiscordResult setMetadata(IDiscordLobbyTransaction lobbyTransaction, Pointer key, Pointer value); } + public SetMetadataCallback SetMetadata; + + public interface DeleteMetadataCallback extends GameSDKCallback { EDiscordResult deleteMetadata(IDiscordLobbyTransaction lobbyTransaction, Pointer key); } + public DeleteMetadataCallback DeleteMetadata; + + public interface SetLockedCallback extends GameSDKCallback { EDiscordResult setLocked(IDiscordLobbyTransaction lobbyTransaction, boolean locked); } + public SetLockedCallback SetLocked; + + + + public static class ByReference extends IDiscordLobbyTransaction implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordLobbyTransaction implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java new file mode 100644 index 00000000..b17064d1 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java @@ -0,0 +1,41 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkChannelId; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkPeerId; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class IDiscordNetworkEvents extends DiscordStruct { public IDiscordNetworkEvents() {super();} public IDiscordNetworkEvents(Pointer pointer) {super(pointer);} + public interface OnMessageCallback extends GameSDKCallback { void onMessage(Pointer eventData, DiscordNetworkPeerId peerId, DiscordNetworkChannelId channelId, ByteByReference data, UInt32 dataLength); } + public OnMessageCallback OnMessage; + + public interface OnRouteUpdateCallback extends GameSDKCallback { void onRouteUpdate(Pointer eventData, String route_data); } + public OnRouteUpdateCallback OnRouteUpdate; + + + + public static class ByReference extends IDiscordNetworkEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordNetworkEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java new file mode 100644 index 00000000..fbc2edee --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java @@ -0,0 +1,61 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import com.sun.jna.ptr.LongByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkChannelId; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkPeerId; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; + +public class IDiscordNetworkManager extends DiscordStruct { public IDiscordNetworkManager() {super();} public IDiscordNetworkManager(Pointer pointer) {super(pointer);} + public interface GetPeerIdCallback extends GameSDKCallback { void getPeerId(IDiscordNetworkManager manager, LongByReference peerId); } + public GetPeerIdCallback GetPeerId; + + public interface FlushCallback extends GameSDKCallback { EDiscordResult flush(IDiscordNetworkManager manager); } + public FlushCallback Flush; + + public interface OpenPeerCallback extends GameSDKCallback { EDiscordResult openPeer(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId, String routeData); } + public OpenPeerCallback OpenPeer; + + public interface UpdatePeerCallback extends GameSDKCallback { EDiscordResult updatePeer(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId, String routeData); } + public UpdatePeerCallback UpdatePeer; + + public interface ClosePeerCallback extends GameSDKCallback { EDiscordResult closePeer(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId); } + public ClosePeerCallback ClosePeer; + + public interface OpenChannelCallback extends GameSDKCallback { EDiscordResult openChannel(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId, DiscordNetworkChannelId channelId, boolean reliable); } + public OpenChannelCallback OpenChannel; + + public interface CloseChannelCallback extends GameSDKCallback { EDiscordResult closeChannel(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId, DiscordNetworkChannelId channelId); } + public CloseChannelCallback CloseChannel; + + public interface SendMessageCallback extends GameSDKCallback { EDiscordResult sendMessage(IDiscordNetworkManager manager, DiscordNetworkPeerId peerId, DiscordNetworkChannelId channelId, ByteByReference data, UInt32 dataLength); } + public SendMessageCallback SendMessage; + + + + public static class ByReference extends IDiscordNetworkManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordNetworkManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java new file mode 100644 index 00000000..ca1681ed --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; + +public class IDiscordOverlayEvents extends DiscordStruct { public IDiscordOverlayEvents() {super();} public IDiscordOverlayEvents(Pointer pointer) {super(pointer);} + public interface OnToggleCallback extends GameSDKCallback { void onToggle(Pointer eventData, boolean locked); } + public OnToggleCallback OnToggle; + + + + public static class ByReference extends IDiscordOverlayEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordOverlayEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java new file mode 100644 index 00000000..2207f0ff --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java @@ -0,0 +1,52 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; + +public class IDiscordOverlayManager extends DiscordStruct { public IDiscordOverlayManager() {super();} public IDiscordOverlayManager(Pointer pointer) {super(pointer);} + public interface IsEnabledCallback extends GameSDKCallback { void isEnabled(IDiscordOverlayManager manager, ByteByReference enabled); } + public IsEnabledCallback IsEnabled; + + public interface IsLockedCallback extends GameSDKCallback { void isLocked(IDiscordOverlayManager manager, ByteByReference locked); } + public IsLockedCallback IsLocked; + + public interface SetLockedCallback extends GameSDKCallback { void setLocked(IDiscordOverlayManager manager, boolean locked, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SetLockedCallback SetLocked; + + public interface OpenActivityInviteCallback extends GameSDKCallback { void openActivityInvite(IDiscordOverlayManager manager, EDiscordActivityActionType type, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public OpenActivityInviteCallback OpenActivityInvite; + + public interface OpenGuildInviteCallback extends GameSDKCallback { void openGuildInvite(IDiscordOverlayManager manager, String code, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public OpenGuildInviteCallback OpenGuildInvite; + + public interface OpenVoiceSettingsCallback extends GameSDKCallback { void openVoiceSettings(IDiscordOverlayManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public OpenVoiceSettingsCallback OpenVoiceSettings; + + + + public static class ByReference extends IDiscordOverlayManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordOverlayManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java new file mode 100644 index 00000000..50ff21f4 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java @@ -0,0 +1,38 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordRelationship; + +public class IDiscordRelationshipEvents extends DiscordStruct { public IDiscordRelationshipEvents() {super();} public IDiscordRelationshipEvents(Pointer pointer) {super(pointer);} + public interface OnRefreshCallback extends GameSDKCallback { void onRefresh(Pointer eventData); } + public OnRefreshCallback OnRefresh; + + public interface OnRelationshipUpdateCallback extends GameSDKCallback { void onRelationshipUpdate(Pointer eventData, DiscordRelationship relationship); } + public OnRelationshipUpdateCallback OnRelationshipUpdate; + + + + public static class ByReference extends IDiscordRelationshipEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordRelationshipEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java new file mode 100644 index 00000000..406978cd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java @@ -0,0 +1,49 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordRelationship; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +public class IDiscordRelationshipManager extends DiscordStruct { public IDiscordRelationshipManager() {super();} public IDiscordRelationshipManager(Pointer pointer) {super(pointer);} + public interface FilterCallback extends GameSDKCallback { void filter(IDiscordRelationshipManager manager, Pointer filterData, FilterCallback_Callback filter); } + public interface FilterCallback_Callback extends GameSDKCallback { boolean filter(Pointer filterData, Structure relationShip);} + public FilterCallback Filter; + + public interface CountCallback extends GameSDKCallback { EDiscordResult count(IDiscordRelationshipManager manager, IntByReference count); } + public CountCallback Count; + + public interface GetCallback extends GameSDKCallback { EDiscordResult get(IDiscordRelationshipManager manager, DiscordSnowflake userId, DiscordRelationship relationship); } + public GetCallback Get; + + public interface GetAtCallback extends GameSDKCallback { EDiscordResult getAt(IDiscordRelationshipManager manager, UInt32 index, DiscordRelationship relationship); } + public GetAtCallback GetAt; + + + + public static class ByReference extends IDiscordRelationshipManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordRelationshipManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java new file mode 100644 index 00000000..8e77bef2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java @@ -0,0 +1,76 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordFileStat; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; + +public class IDiscordStorageManager extends DiscordStruct { public IDiscordStorageManager() {super();} public IDiscordStorageManager(Pointer pointer) {super(pointer);} + public interface ReadCallback extends GameSDKCallback { EDiscordResult read(IDiscordStorageManager manager, String name, ByteByReference data, UInt32 dataLength, IntByReference read); } + public ReadCallback Read; + + public interface DiscordStorageManagerCallback extends GameSDKCallback { + void callback(Pointer callbackData, EDiscordResult result, ByteByReference data, IntByReference data_length); + } + + public interface ReadAsyncCallback extends GameSDKCallback { void readAsync(IDiscordStorageManager manager, String name, Pointer callbackData, DiscordStorageManagerCallback callback); } + public ReadAsyncCallback ReadAsync; + + public interface ReadAsyncPartialCallback extends GameSDKCallback { void readAsyncPartial(IDiscordStorageManager manager, String name, UInt64 offset, UInt64 length, Pointer callbackData, DiscordStorageManagerCallback callback); } + public ReadAsyncPartialCallback ReadAsyncPartial; + + public interface WriteCallback extends GameSDKCallback { EDiscordResult write(IDiscordStorageManager manager, String name, ByteByReference data, UInt32 dataLength); } + public WriteCallback Write; + + public interface WriteAsyncCallback extends GameSDKCallback { void writeAsync(IDiscordStorageManager manager, String name, ByteByReference data, UInt32 dataLength, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public WriteAsyncCallback WriteAsync; + + public interface DeleteCallback extends GameSDKCallback { EDiscordResult delete(IDiscordStorageManager manager, String name); } + public DeleteCallback Delete; + + public interface ExistsCallback extends GameSDKCallback { EDiscordResult exists(IDiscordStorageManager manager, String name, ByteByReference exists); } // exists actually boolean + public ExistsCallback Exists; + + public interface CountCallback extends GameSDKCallback { void count(IDiscordStorageManager manager, IntByReference count); } + public CountCallback Count; + + public interface StatCallback extends GameSDKCallback { EDiscordResult stat(IDiscordStorageManager manager, String name, DiscordFileStat stat); } + public StatCallback Stat; + + public interface StatAtCallback extends GameSDKCallback { EDiscordResult statAt(IDiscordStorageManager manager, Int32 index, DiscordFileStat stat); } + public StatAtCallback StatAt; + + public interface GetPathCallback extends GameSDKCallback { EDiscordResult getPath(IDiscordStorageManager manager, Pointer path); } // path str len 4096 + public GetPathCallback GetPath; + + + + public static class ByReference extends IDiscordStorageManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordStorageManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java new file mode 100644 index 00000000..55e4ed92 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java @@ -0,0 +1,38 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordEntitlement; + +public class IDiscordStoreEvents extends DiscordStruct { public IDiscordStoreEvents() {super();} public IDiscordStoreEvents(Pointer pointer) {super(pointer);} + public interface OnEntitlementCreateCallback extends GameSDKCallback { void onEntitlementCreate(Pointer eventData, DiscordEntitlement entitlement); } + public OnEntitlementCreateCallback OnEntitlementCreate; + + public interface OnEntitlementDeleteCallback extends GameSDKCallback { void onEntitlementDelete(Pointer eventData, DiscordEntitlement entitlement); } + public OnEntitlementDeleteCallback OnEntitlementDelete; + + + + public static class ByReference extends IDiscordStoreEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordStoreEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java new file mode 100644 index 00000000..b951ef9a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java @@ -0,0 +1,69 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordSku; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordEntitlement; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +public class IDiscordStoreManager extends DiscordStruct { public IDiscordStoreManager() {super();} public IDiscordStoreManager(Pointer pointer) {super(pointer);} + public interface FetchSkusCallback extends GameSDKCallback { void fetchSkus(IDiscordStoreManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public FetchSkusCallback FetchSkus; + + public interface CountSkusCallback extends GameSDKCallback { void countSkus(IDiscordStoreManager manager, IntByReference count); } + public CountSkusCallback CountSkus; + + public interface GetSkuCallback extends GameSDKCallback { EDiscordResult getSku(IDiscordStoreManager manager, DiscordSnowflake skuId, DiscordSku sku); } + public GetSkuCallback GetSku; + + public interface GetSkuAtCallback extends GameSDKCallback { EDiscordResult getSkuAt(IDiscordStoreManager manager, Int32 index, DiscordSku sku); } + public GetSkuAtCallback GetSkuAt; + + public interface FetchEntitlementsCallback extends GameSDKCallback { void fetchEntitlements(IDiscordStoreManager manager, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public FetchEntitlementsCallback FetchEntitlements; + + public interface CountEntitlementsCallback extends GameSDKCallback { void countEntitlements(IDiscordStoreManager manager, IntByReference count); } + public CountEntitlementsCallback CountEntitlements; + + public interface GetEntitlementCallback extends GameSDKCallback { EDiscordResult getEntitlement(IDiscordStoreManager manager, DiscordSnowflake entitlementId, DiscordEntitlement entitlement); } + public GetEntitlementCallback GetEntitlement; + + public interface GetEntitlementAtCallback extends GameSDKCallback { EDiscordResult getEntitlementAt(IDiscordStoreManager manager, Int32 index, DiscordEntitlement entitlement); } + public GetEntitlementAtCallback GetEntitlementAt; + + public interface HasSkuEntitlementCallback extends GameSDKCallback { EDiscordResult hasSkuEntitlement(IDiscordStoreManager manager, DiscordSnowflake skuId, ByteByReference hasEntitlement); } // hasEntitlement bool ptr + public HasSkuEntitlementCallback HasSkuEntitlement; + + public interface StartPurchaseCallback extends GameSDKCallback { void startPurchase(IDiscordStoreManager manager, DiscordSnowflake skuId, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public StartPurchaseCallback StartPurchase; + + + + public static class ByReference extends IDiscordStoreManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordStoreManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java new file mode 100644 index 00000000..66b6379f --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; + +public class IDiscordUserEvents extends DiscordStruct { public IDiscordUserEvents() {super();} public IDiscordUserEvents(Pointer pointer) {super(pointer);} + public interface OnCurrentUserUpdateCallback extends GameSDKCallback { void onCurrentUserUpdate(Pointer eventData); } + public OnCurrentUserUpdateCallback OnCurrentUserUpdate; + + + + public static class ByReference extends IDiscordUserEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordUserEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java new file mode 100644 index 00000000..e7e04029 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java @@ -0,0 +1,50 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import com.sun.jna.ptr.IntByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordUserFlag; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; + +public class IDiscordUserManager extends DiscordStruct { public IDiscordUserManager() {super();} public IDiscordUserManager(Pointer pointer) {super(pointer);} + public interface GetCurrentUserCallback extends GameSDKCallback { EDiscordResult getCurrentUser(IDiscordUserManager manager, DiscordUser currentUser); } + public GetCurrentUserCallback GetCurrentUser; + + public interface GetUserCallback extends GameSDKCallback { void getUser(IDiscordUserManager manager, DiscordSnowflake userId, Pointer callbackData, GetUserCallback_Callback callback); } + public interface GetUserCallback_Callback extends GameSDKCallback { void callback(Pointer callbackData, EDiscordResult result, DiscordUser user);} + public GetUserCallback GetUser; + + public interface GetCurrentUserPremiumTypeCallback extends GameSDKCallback { EDiscordResult getCurrentUserPremiumType(IDiscordUserManager manager, IntByReference premiumType); } // EDiscordPremiumType ptr + public GetCurrentUserPremiumTypeCallback GetCurrentUserPremiumType; + + public interface CurrentUserHasFlagCallback extends GameSDKCallback { EDiscordResult currentUserHasFlag(IDiscordUserManager manager, EDiscordUserFlag flag, ByteByReference hasFlag); } // hasFlag bool ptr + public CurrentUserHasFlagCallback CurrentUserHasFlag; + + + + public static class ByReference extends IDiscordUserManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordUserManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java new file mode 100644 index 00000000..59fedd08 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java @@ -0,0 +1,34 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; + +public class IDiscordVoiceEvents extends DiscordStruct { public IDiscordVoiceEvents() {super();} public IDiscordVoiceEvents(Pointer pointer) {super(pointer);} + public interface OnSettingsUpdateCallback extends GameSDKCallback { void onSettingsUpdate(Pointer eventData); } + public OnSettingsUpdateCallback OnSettingsUpdate; + + + + public static class ByReference extends IDiscordVoiceEvents implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordVoiceEvents implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java new file mode 100644 index 00000000..b9239707 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java @@ -0,0 +1,67 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; + +import com.sun.jna.Callback; +import com.sun.jna.Structure; +import com.sun.jna.ptr.ByteByReference; +import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import com.sun.jna.Pointer; +import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordInputMode; +import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; + +public class IDiscordVoiceManager extends DiscordStruct { public IDiscordVoiceManager() {super();} public IDiscordVoiceManager(Pointer pointer) {super(pointer);} + public interface GetInputModeCallback extends GameSDKCallback { EDiscordResult getInputMode(IDiscordVoiceManager manager, DiscordInputMode inputMode); } + public GetInputModeCallback GetInputMode; + + public interface SetInputModeCallback extends GameSDKCallback { void setInputMode(IDiscordVoiceManager manager, DiscordInputMode.ByValue inputMode, Pointer callbackData, NativeGameSDK.DiscordCallback callback); } + public SetInputModeCallback SetInputMode; + + public interface IsSelfMuteCallback extends GameSDKCallback { EDiscordResult isSelfMute(IDiscordVoiceManager manager, ByteByReference mute); } + public IsSelfMuteCallback IsSelfMute; + + public interface SetSelfMuteCallback extends GameSDKCallback { EDiscordResult setSelfMute(IDiscordVoiceManager manager, boolean mute); } + public SetSelfMuteCallback SetSelfMute; + + public interface IsSelfDeafCallback extends GameSDKCallback { EDiscordResult isSelfDeaf(IDiscordVoiceManager manager, ByteByReference deaf); } + public IsSelfDeafCallback IsSelfDeaf; + + public interface SetSelfDeafCallback extends GameSDKCallback { EDiscordResult setSelfDeaf(IDiscordVoiceManager manager, boolean deaf); } + public SetSelfDeafCallback SetSelfDeaf; + + public interface IsLocalMuteCallback extends GameSDKCallback { EDiscordResult isLocalMute(IDiscordVoiceManager manager, DiscordSnowflake userId, ByteByReference mute); } + public IsLocalMuteCallback IsLocalMute; + + public interface SetLocalMuteCallback extends GameSDKCallback { EDiscordResult setLocalMute(IDiscordVoiceManager manager, DiscordSnowflake userId, boolean mute); } + public SetLocalMuteCallback SetLocalMute; + + public interface GetLocalVolumeCallback extends GameSDKCallback { EDiscordResult getLocalVolume(IDiscordVoiceManager manager, DiscordSnowflake userId, ByteByReference volume); } + public GetLocalVolumeCallback GetLocalVolume; + + public interface SetLocalVolumeCallback extends GameSDKCallback { EDiscordResult setLocalVolume(IDiscordVoiceManager manager, DiscordSnowflake userId, UInt8 volume); } + public SetLocalVolumeCallback SetLocalVolume; + + + + public static class ByReference extends IDiscordVoiceManager implements Structure.ByReference { public ByReference() {super();} public ByReference(Pointer pointer) {super(pointer);}} + public static class ByValue extends IDiscordVoiceManager implements Structure.ByValue { public ByValue() {super();} public ByValue(Pointer pointer) {super(pointer);}} +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java new file mode 100644 index 00000000..df6c4628 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordClientID extends Int64 { + public DiscordClientID() { + this(0); + } + public DiscordClientID(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java new file mode 100644 index 00000000..82b34ee7 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordNetworkChannelId extends UInt8 { + public DiscordNetworkChannelId() { + this(0); + } + public DiscordNetworkChannelId(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java new file mode 100644 index 00000000..49d73e3f --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordNetworkPeerId extends UInt64 { + public DiscordNetworkPeerId() { + this(0); + } + public DiscordNetworkPeerId(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java new file mode 100644 index 00000000..3a86f73d --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordSnowflake extends Int64 { + public DiscordSnowflake() { + this(0); + } + public DiscordSnowflake(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java new file mode 100644 index 00000000..c8f73da5 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordTimestamp extends Int64 { + public DiscordTimestamp() { + this(0); + } + public DiscordTimestamp(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java new file mode 100644 index 00000000..ed5fda42 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java @@ -0,0 +1,30 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class DiscordVersion extends Int32 { + public DiscordVersion() { + this(0); + } + public DiscordVersion(long value) { + super(value); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java new file mode 100644 index 00000000..581aed96 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java @@ -0,0 +1,31 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class Int32 extends IntegerType { + public static final int SIZE = 4; + public Int32() { + this(0); + } + public Int32(long value) { + super(SIZE, value, false); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java new file mode 100644 index 00000000..a8dff873 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java @@ -0,0 +1,31 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class Int64 extends IntegerType { + public static final int SIZE = 8; + public Int64() { + this(0); + } + public Int64(long value) { + super(SIZE, value, false); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java new file mode 100644 index 00000000..98a903c6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java @@ -0,0 +1,31 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class UInt32 extends IntegerType { + public static final int SIZE = 4; + public UInt32() { + this(0); + } + public UInt32(long value) { + super(SIZE, value, true); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java new file mode 100644 index 00000000..a0265b34 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java @@ -0,0 +1,31 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class UInt64 extends IntegerType { + public static final int SIZE = 8; + public UInt64() { + this(0); + } + public UInt64(long value) { + super(SIZE, value, true); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java new file mode 100644 index 00000000..1b10c5a2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java @@ -0,0 +1,31 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; + +import com.sun.jna.IntegerType; + +public class UInt8 extends IntegerType { + public static final int SIZE = 1; + public UInt8() { + this(0); + } + public UInt8(long value) { + super(SIZE, value, true); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java index 2e8c8702..a045ea22 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java @@ -20,7 +20,6 @@ package kr.syeyoung.dungeonsguide.party; import kr.syeyoung.dungeonsguide.DungeonsGuide; import kr.syeyoung.dungeonsguide.utils.TextUtils; -import net.arikia.dev.drpc.DiscordRPC; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -77,7 +76,7 @@ public class PartyInviteViewer { partyJoinRequestList.add(joinRequest); } } else if (!isOnHypixel){ - DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.NO); +// DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.NO); partyJoinRequestList.add(joinRequest); } else if (joinRequest.getExpire() < System.currentTimeMillis()) { partyJoinRequestList.add(joinRequest); @@ -107,21 +106,21 @@ public class PartyInviteViewer { if (joinRequest.getAcceptRect().contains(mouseX, mouseY)) { joinRequest.setReply(PartyJoinRequest.Reply.ACCEPT); joinRequest.setTtl(60); - DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.YES); +// DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.YES); return; } if (joinRequest.getDenyRect().contains(mouseX, mouseY)) { joinRequest.setReply(PartyJoinRequest.Reply.DENY); joinRequest.setTtl(60); - DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.NO); +// DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.NO); return; } if (joinRequest.getIgnoreRect().contains(mouseX, mouseY)) { joinRequest.setReply(PartyJoinRequest.Reply.IGNORE); joinRequest.setTtl(60); - DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.IGNORE); +// DiscordRPC.discordRespond(joinRequest.getDiscordUser().userId, DiscordRPC.DiscordReply.IGNORE); return; } @@ -195,7 +194,7 @@ public class PartyInviteViewer { Gui.drawRect(0, 0,width,height, 0xFF23272a); Gui.drawRect(2, 2, width-2, height-2, 0XFF2c2f33); { - String avatar = "https://cdn.discordapp.com/avatars/"+partyJoinRequest.getDiscordUser().userId+"/"+partyJoinRequest.getDiscordUser().avatar+".png"; + String avatar = "https://cdn.discordapp.com/avatars/"+partyJoinRequest.getDiscordUser().id.longValue()+"/"+partyJoinRequest.getDiscordUser().avatar+".png"; Future<LoadedImage> loadedImageFuture = loadImage(avatar); LoadedImage loadedImage = null; if (loadedImageFuture.isDone()) { @@ -237,11 +236,11 @@ public class PartyInviteViewer { GlStateManager.pushMatrix(); GlStateManager.scale(3.0,3.0,1.0); - fr.drawString(partyJoinRequest.getDiscordUser().username, 0,0, 0xFFFFFFFF, true); + fr.drawString(partyJoinRequest.getDiscordUser().username+"", 0,0, 0xFFFFFFFF, true); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); - GlStateManager.translate(fr.getStringWidth(partyJoinRequest.getDiscordUser().username) * 3 + 1, (int)(fr.FONT_HEIGHT*1.5), 0); + GlStateManager.translate(fr.getStringWidth(partyJoinRequest.getDiscordUser().username+"") * 3 + 1, (int)(fr.FONT_HEIGHT*1.5), 0); fr.drawString("#"+partyJoinRequest.getDiscordUser().discriminator, 0,0,0xFFaaaaaa, true); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyJoinRequest.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyJoinRequest.java index eb7e8f57..06b04e20 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyJoinRequest.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyJoinRequest.java @@ -18,14 +18,12 @@ package kr.syeyoung.dungeonsguide.party; +import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; -import net.arikia.dev.drpc.DiscordRPC; -import net.arikia.dev.drpc.DiscordUser; import java.awt.*; -import java.time.Instant; @Data public class PartyJoinRequest { diff --git a/src/main/java/net/arikia/dev/drpc/DiscordEventHandlers.java b/src/main/java/net/arikia/dev/drpc/DiscordEventHandlers.java deleted file mode 100644 index ab2ae8aa..00000000 --- a/src/main/java/net/arikia/dev/drpc/DiscordEventHandlers.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc; - -import com.sun.jna.Structure; -import net.arikia.dev.drpc.callbacks.*; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Object containing references to all event handlers registered. No callbacks are necessary, - * every event handler is optional. Non-assigned handlers are being ignored. - */ -public class DiscordEventHandlers extends Structure { - - /** - * Callback called when Discord-RPC was initialized successfully. - */ - public ReadyCallback ready; - /** - * Callback called when the Discord connection was disconnected. - */ - public DisconnectedCallback disconnected; - /** - * Callback called when a Discord error occurred. - */ - public ErroredCallback errored; - /** - * Callback called when the player joins the game. - */ - public JoinGameCallback joinGame; - /** - * Callback called when the player spectates a game. - */ - public SpectateGameCallback spectateGame; - /** - * Callback called when a join request is received. - */ - public JoinRequestCallback joinRequest; - - @Override - public List<String> getFieldOrder() { - return Arrays.asList("ready", "disconnected", "errored", "joinGame", "spectateGame", "joinRequest"); - } - - public static class Builder { - - DiscordEventHandlers h; - - public Builder() { - h = new DiscordEventHandlers(); - } - - public Builder setReadyEventHandler(ReadyCallback r) { - h.ready = r; - return this; - } - - public Builder setDisconnectedEventHandler(DisconnectedCallback d) { - h.disconnected = d; - return this; - } - - public Builder setErroredEventHandler(ErroredCallback e) { - h.errored = e; - return this; - } - - public Builder setJoinGameEventHandler(JoinGameCallback j) { - h.joinGame = j; - return this; - } - - public Builder setSpectateGameEventHandler(SpectateGameCallback s) { - h.spectateGame = s; - return this; - } - - public Builder setJoinRequestEventHandler(JoinRequestCallback j) { - h.joinRequest = j; - return this; - } - - public DiscordEventHandlers build() { - return h; - } - } -} diff --git a/src/main/java/net/arikia/dev/drpc/DiscordRPC.java b/src/main/java/net/arikia/dev/drpc/DiscordRPC.java deleted file mode 100644 index 8424edd8..00000000 --- a/src/main/java/net/arikia/dev/drpc/DiscordRPC.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc; - -import com.sun.jna.Library; -import com.sun.jna.Native; - -import java.io.*; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Java Wrapper of the Discord-RPC Library for Discord Rich Presence. - */ -public final class DiscordRPC { - - //DLL-Version for Update Check (soon). - private static final String DLL_VERSION = "3.4.0"; - private static final String LIB_VERSION = "1.6.2"; - - static { - loadDLL(); - } - - /** - * Method to initialize the Discord-RPC. - * - * @param applicationId ApplicationID/ClientID - * @param handlers EventHandlers - * @param autoRegister AutoRegister - */ - public static void discordInitialize(String applicationId, DiscordEventHandlers handlers, boolean autoRegister) { - DLL.INSTANCE.Discord_Initialize(applicationId, handlers, autoRegister ? 1 : 0, null); - } - - /** - * Method to register the executable of the application/game. - * Only applicable when autoRegister in discordInitialize is false. - * - * @param applicationId ApplicationID/ClientID - * @param command Launch Command of the application/game. - */ - public static void discordRegister(String applicationId, String command) { - DLL.INSTANCE.Discord_Register(applicationId, command); - } - - /** - * Method to initialize the Discord-RPC within a Steam Application. - * - * @param applicationId ApplicationID/ClientID - * @param handlers EventHandlers - * @param autoRegister AutoRegister - * @param steamId SteamAppID - * @see DiscordEventHandlers - */ - public static void discordInitialize(String applicationId, DiscordEventHandlers handlers, boolean autoRegister, String steamId) { - DLL.INSTANCE.Discord_Initialize(applicationId, handlers, autoRegister ? 1 : 0, steamId); - } - - /** - * Method to register the Steam-Executable of the application/game. - * Only applicable when autoRegister in discordInitializeSteam is false. - * - * @param applicationId ApplicationID/ClientID - * @param steamId SteamID of the application/game. - */ - public static void discordRegisterSteam(String applicationId, String steamId) { - DLL.INSTANCE.Discord_RegisterSteamGame(applicationId, steamId); - } - - /** - * Method to update the registered EventHandlers, after the initialization was - * already called. - * - * @param handlers DiscordEventHandler object with updated callbacks. - */ - public static void discordUpdateEventHandlers(DiscordEventHandlers handlers) { - DLL.INSTANCE.Discord_UpdateHandlers(handlers); - } - - /** - * Method to shutdown the Discord-RPC from within the application. - */ - public static void discordShutdown() { - DLL.INSTANCE.Discord_Shutdown(); - } - - /** - * Method to call Callbacks from within the library. - * Must be called periodically. - */ - public static void discordRunCallbacks() { - DLL.INSTANCE.Discord_RunCallbacks(); - } - - /** - * Method to update the DiscordRichPresence of the client. - * - * @param presence Instance of DiscordRichPresence - * @see DiscordRichPresence - */ - public static void discordUpdatePresence(DiscordRichPresence presence) { - DLL.INSTANCE.Discord_UpdatePresence(presence); - } - - /** - * Method to clear(and therefor hide) the DiscordRichPresence until a new - * presence is applied. - */ - public static void discordClearPresence() { - DLL.INSTANCE.Discord_ClearPresence(); - } - - /** - * Method to respond to Join/Spectate Callback. - * - * @param userId UserID of the user to respond to. - * @param reply DiscordReply to request. - * @see DiscordReply - */ - public static void discordRespond(String userId, DiscordReply reply) { - DLL.INSTANCE.Discord_Respond(userId, reply.reply); - } - - //Load DLL depending on the user's architecture. - private static void loadDLL() { - String name = System.mapLibraryName("discord-rpc"); - OSUtil osUtil = new OSUtil(); - String finalPath; - String dir; - - if (osUtil.isMac()) { - dir = "darwin"; - } else if (osUtil.isWindows()) { - boolean is64bit = System.getProperty("sun.arch.data.model").equals("64"); - dir = (is64bit ? "win-x64" : "win-x86"); - } else { - dir = "linux"; - } - - finalPath = "/" + dir + "/" + name; - - try { - File f = new File(name); - - try (InputStream in = DiscordRPC.class.getResourceAsStream(finalPath); OutputStream out = openOutputStream(f)) { - copyFile(in, out); - f.deleteOnExit(); - } catch (IOException e) { - e.printStackTrace(); - } - - System.load(f.getAbsolutePath()); - } catch(Exception e) { - e.printStackTrace(); - } - } - - private static void copyFile(final InputStream input, final OutputStream output) throws IOException { - byte[] buffer = new byte[1024 * 4]; - int n; - while (-1 != (n = input.read(buffer))) { - output.write(buffer, 0, n); - } - } - - private static FileOutputStream openOutputStream(final File file) throws IOException { - if (file.exists()) { - if (file.isDirectory()) { - throw new IOException("File '" + file + "' exists but is a directory"); - } - if (!file.canWrite()) { - throw new IOException("File '" + file + "' cannot be written to"); - } - } else { - final File parent = file.getParentFile(); - if (parent != null) { - if (!parent.mkdirs() && !parent.isDirectory()) { - throw new IOException("Directory '" + parent + "' could not be created"); - } - } - } - return new FileOutputStream(file); - } - - //------------------------ Taken from apache commons ------------------------------// - - /** - * Enum containing reply codes for join request events. - * - * @see net.arikia.dev.drpc.callbacks.JoinRequestCallback - */ - public enum DiscordReply { - /** - * Denies the join request immediately. - * Currently behaving the same way like DiscordReply.IGNORE. - */ - NO(0), - /** - * Accepts the join request, requesting player received a JoinGameCallback. - * - * @see net.arikia.dev.drpc.callbacks.JoinGameCallback - */ - YES(1), - /** - * Denies the join request by letting it time out(10s). - */ - IGNORE(2); - - /** - * Integer reply code send to Discord. - */ - public final int reply; - - DiscordReply(int reply) { - this.reply = reply; - } - } - - //JNA Interface - private interface DLL extends Library { - //DLL INSTANCE = Native.load("discord-rpc", DLL.class); - DLL INSTANCE = (DLL) Native.loadLibrary("discord-rpc", DLL.class); - - void Discord_Initialize(String applicationId, DiscordEventHandlers handlers, int autoRegister, String optionalSteamId); - void Discord_Register(String applicationId, String command); - void Discord_RegisterSteamGame(String applicationId, String steamId); - void Discord_UpdateHandlers(DiscordEventHandlers handlers); - void Discord_Shutdown(); - void Discord_RunCallbacks(); - void Discord_UpdatePresence(DiscordRichPresence presence); - void Discord_ClearPresence(); - void Discord_Respond(String userId, int reply); - } -} diff --git a/src/main/java/net/arikia/dev/drpc/DiscordRichPresence.java b/src/main/java/net/arikia/dev/drpc/DiscordRichPresence.java deleted file mode 100644 index 64a89f7c..00000000 --- a/src/main/java/net/arikia/dev/drpc/DiscordRichPresence.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc; - -import com.sun.jna.Structure; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - */ -public class DiscordRichPresence extends Structure { - - /** - * State of the player's current party. - */ - public String state; - /** - * Details to the current game-session of the player. - */ - public String details; - /** - * Unix timestamp for the start of the game - */ - public long startTimestamp; - /** - * Unix timestamp for when the game will end - */ - public long endTimestamp; - /** - * Name of the uploaded image for the large profile artwork. - */ - public String largeImageKey; - /** - * Tooltip for the largeImageKey - */ - public String largeImageText; - /** - * Name of the uploaded image for the small profile artwork. - */ - public String smallImageKey; - /** - * Tooltip for the smallImageKey - */ - public String smallImageText; - /** - * Id of the player's party, lobby, or group. - */ - public String partyId; - /** - * Current size of the player's party, lobby, or group. - */ - public int partySize; - /** - * Maximum size of the player's party, lobby, or group. - */ - public int partyMax; - /** - * Unique hashed string for Spectate button. - */ - public String spectateSecret; - /** - * Unique hashed string for chat invitations and Ask to Join. - */ - public String joinSecret; - /** - * Unused. - */ - @Deprecated - public int instance; - - @Override - public List<String> getFieldOrder() { - return Arrays.asList("state", "details", "startTimestamp", "endTimestamp", "largeImageKey", "largeImageText", "smallImageKey", "smallImageText", "partyId", "partySize", "partyMax", "spectateSecret", "joinSecret","instance"); - } - - /*+ - * Builder object provided to easily assemble DiscordRichPresence objects without having to add a huge assignment Block. - * No method is essential, not called methods/unassigned fields are simply ignored and not applied in the final DiscordRichPresence - * seen inside the Discord client. - */ - public static class Builder { - - private final DiscordRichPresence p; - - /** - * Initiates a new instance of the Presence builder. - * - * @param state String representing the player's current state. - * @see DiscordRichPresence - */ - public Builder(String state) { - p = new DiscordRichPresence(); - p.state = state; - } - - /** - * Sets the details field of the DiscordRichPresence object. - * - * @param details String representing details to the player's current state. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setDetails(String details) { - p.details = details; - return this; - } - - /** - * Sets the starting timestamps of the DiscordRichPresence object, to activate the timer display. - * - * @param start Long Unix Timestamp representing the starting point of the timer. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setStartTimestamps(long start) { - p.startTimestamp = start; - return this; - } - - /** - * Sets the ending timestamps of the DiscordRichPresence object, to activate the timer display. - * - * @param end Long Unix Timestamp representing the ending point of the timer. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setEndTimestamp(long end) { - p.endTimestamp = end; - return this; - } - - /** - * Sets the large image fields of the DiscordRichPresence object. key cannot be null when text is not null. - * - * @param key String key assigned to the image asset inside of the Discord Application. - * @param text String text shown as hover text when hovering over the image of the presence. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setBigImage(String key, String text) { - if ((text != null && !text.equalsIgnoreCase("")) && key == null) - throw new IllegalArgumentException("Image key must not be null when assigning a hover text."); - - p.largeImageKey = key; - p.largeImageText = text; - return this; - } - - /** - * Sets the small image fields of the DiscordRichPresence object. key cannot be null when text is not null. - * - * @param key String key assigned to the image asset inside of the Discord Application. - * @param text String text shown as hover text when hovering over the image of the presence. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setSmallImage(String key, String text) { - if ((text != null && !text.equalsIgnoreCase("")) && key == null) - throw new IllegalArgumentException("Image key must not be null when assigning a hover text."); - - p.smallImageKey = key; - p.smallImageText = text; - return this; - } - - /** - * Sets the party information for the "Party" section of the user's presence. - * - * @param party Unique String given to the party as identifier. - * @param size Integer representing the current size of the user's party. - * @param max Integer representing the maximal size of the user's party. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setParty(String party, int size, int max) { - p.partyId = party; - p.partySize = size; - p.partyMax = max; - return this; - } - - /** - * Unused. - */ - @Deprecated - public Builder setSecrets(String match, String join, String spectate) { - p.joinSecret = join; - p.spectateSecret = spectate; - return this; - } - - /** - * Sets the secret fields of the DiscordRichPresence object. - * - * @param join Unique String containing necessary information passed to the joining player. - * @param spectate Unique String containing necessary information passed to the spectating player. - * @return Current Builder object. - * @see DiscordRichPresence - */ - public Builder setSecrets(String join, String spectate) { - p.joinSecret = join; - p.spectateSecret = spectate; - return this; - } - - /** - * Unused. - */ - @Deprecated - public Builder setInstance(boolean i) { - p.instance = i ? 1 : 0; - return this; - } - - /** - * Returns the fully finished DiscordRichPresence object. Non-assigned fields are being ignored. - * - * @return The build DiscordRichPresence object. - * @see DiscordRichPresence - */ - public DiscordRichPresence build() { - return p; - } - } -} diff --git a/src/main/java/net/arikia/dev/drpc/DiscordUser.java b/src/main/java/net/arikia/dev/drpc/DiscordUser.java deleted file mode 100644 index 3693a3d7..00000000 --- a/src/main/java/net/arikia/dev/drpc/DiscordUser.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc; - -import com.sun.jna.Structure; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Object containing information about a Discord user. - */ -public class DiscordUser extends Structure { - - /** - * The userId of the player asking to join. - */ - public String userId; - /** - * The username of the player asking to join. - */ - public String username; - /** - * The discriminator of the player asking to join. - */ - public String discriminator; - /** - * The avatar hash of the player asking to join. - * - * @see <a href="https://discordapp.com/developers/docs/reference#image-formatting">Image Formatting</a> - */ - public String avatar; - - @Override - public List<String> getFieldOrder() { - return Arrays.asList("userId", "username", "discriminator", "avatar"); - } -}
\ No newline at end of file diff --git a/src/main/java/net/arikia/dev/drpc/OSUtil.java b/src/main/java/net/arikia/dev/drpc/OSUtil.java deleted file mode 100644 index de3d9e4b..00000000 --- a/src/main/java/net/arikia/dev/drpc/OSUtil.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc; - -/** - * @author DeJay - * @version 1.6.1 - * <p> - * Class containing utils for detecting the user's OS. - */ -public final class OSUtil { - - public boolean isMac() { - return getOS().toLowerCase() - .startsWith("mac"); - } - - public boolean isWindows() { - return getOS().toLowerCase() - .startsWith("win"); - } - - public String getOS() { - return System.getProperty("os.name").toLowerCase(); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java deleted file mode 100644 index 367e1878..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "DisconnectedCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface DisconnectedCallback extends Callback { - - /** - * Method called when disconnected. - * - * @param errorCode Error code returned on disconnection. - * @param message Message containing details about the disconnection. - */ - void apply(int errorCode, String message); -} diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java deleted file mode 100644 index 8cf3d387..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "ErroredCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface ErroredCallback extends Callback { - - /** - * Method called when a error occurs. - * - * @param errorCode Error code returned. - * @param message Message containing details about the error. - */ - void apply(int errorCode, String message); -} diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java deleted file mode 100644 index 42b944e8..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "JoinGameCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface JoinGameCallback extends Callback { - - /** - * Method called when joining a game. - * - * @param joinSecret Unique String containing information needed to let the player join. - */ - void apply(String joinSecret); -} diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java deleted file mode 100644 index 01ec5a7d..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; -import net.arikia.dev.drpc.DiscordUser; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "JoinRequestCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface JoinRequestCallback extends Callback { - - /** - * Method called when another player requests to join a game. - * - * @param request Object containing all required information about the user requesting to join. - * @see DiscordUser - */ - void apply(DiscordUser request); -} diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java deleted file mode 100644 index be54c8d7..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; -import net.arikia.dev.drpc.DiscordUser; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "ReadyCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface ReadyCallback extends Callback { - - /** - * Method called when the connection to Discord has been established. - * - * @param user Object containing all required information about the user executing the app. - * @see DiscordUser - **/ - void apply(DiscordUser user); -} - diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java deleted file mode 100644 index a3f8d23b..00000000 --- a/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package net.arikia.dev.drpc.callbacks; - -import com.sun.jna.Callback; - -/** - * @author Nicolas "Vatuu" Adamoglou - * @version 1.5.1 - * <p> - * Interface to be implemented in classes that will be registered as "SpectateGameCallback" Event Handler. - * @see net.arikia.dev.drpc.DiscordEventHandlers - **/ -public interface SpectateGameCallback extends Callback { - - /** - * Method called when joining a game. - * - * @param spectateSecret Unique String containing information needed to let the player spectate. - */ - void apply(String spectateSecret); -} diff --git a/src/main/resources/darwin/libdiscord-rpc.dylib b/src/main/resources/darwin/libdiscord-rpc.dylib Binary files differdeleted file mode 100644 index f01acd67..00000000 --- a/src/main/resources/darwin/libdiscord-rpc.dylib +++ /dev/null diff --git a/src/main/resources/gamesdk/darwin/libdiscord_game_sdk.dylib b/src/main/resources/gamesdk/darwin/libdiscord_game_sdk.dylib Binary files differnew file mode 100644 index 00000000..24045f79 --- /dev/null +++ b/src/main/resources/gamesdk/darwin/libdiscord_game_sdk.dylib diff --git a/src/main/resources/gamesdk/linux/libdiscord_game_sdk.so b/src/main/resources/gamesdk/linux/libdiscord_game_sdk.so Binary files differnew file mode 100644 index 00000000..e4657606 --- /dev/null +++ b/src/main/resources/gamesdk/linux/libdiscord_game_sdk.so diff --git a/src/main/resources/gamesdk/win-x64/discord_game_sdk.dll b/src/main/resources/gamesdk/win-x64/discord_game_sdk.dll Binary files differnew file mode 100644 index 00000000..10a8928f --- /dev/null +++ b/src/main/resources/gamesdk/win-x64/discord_game_sdk.dll diff --git a/src/main/resources/gamesdk/win-x86/discord_game_sdk.dll b/src/main/resources/gamesdk/win-x86/discord_game_sdk.dll Binary files differnew file mode 100644 index 00000000..8f1ee0a6 --- /dev/null +++ b/src/main/resources/gamesdk/win-x86/discord_game_sdk.dll diff --git a/src/main/resources/linux/libdiscord-rpc.so b/src/main/resources/linux/libdiscord-rpc.so Binary files differdeleted file mode 100644 index 188d4e84..00000000 --- a/src/main/resources/linux/libdiscord-rpc.so +++ /dev/null diff --git a/src/main/resources/win-x64/discord-rpc.dll b/src/main/resources/win-x64/discord-rpc.dll Binary files differdeleted file mode 100644 index 8493c549..00000000 --- a/src/main/resources/win-x64/discord-rpc.dll +++ /dev/null diff --git a/src/main/resources/win-x86/discord-rpc.dll b/src/main/resources/win-x86/discord-rpc.dll Binary files differdeleted file mode 100644 index 88c7d0ce..00000000 --- a/src/main/resources/win-x86/discord-rpc.dll +++ /dev/null |