vector-game

A Simple WebSocket API for Bukkit

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.github.patrick-mc
ArtifactId

ArtifactId

websocket-client-api
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

vector-game
A Simple WebSocket API for Bukkit
Project URL

Project URL

https://github.com/patrick-mc/websocket-client-api
Source Code Management

Source Code Management

https://github.com/patrick-mc/websocket-client-api

Download websocket-client-api

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

WebSocket Client API (for Bukkit)

A Simple WebSocket API for Bukkit

Sample Plugin: websocket-client


(en-us)

Introduction

This API provides easy access to websocket client from Bukkit.

Features

  • Simple WebSocketClient connect / disconnect
  • WebSocket Event for Bukkit
  • Works as a Bukkit Plugin (put this into the 'plugins' folder)
  • Requires Kotlin Plugin

How to Use

Gradle (Groovy DSL)

allprojects {
    repositories {
        mavenCentral() // or maven { url 'https://repo.maven.apache.org/maven2/' }
    }
}
dependencies {
    implementation 'com.github.patrick-mc:websocket-client-api:1.0.4'
}

Gradle (Kotlin DSL)

allprojects {
    repositories {
        mavenCentral() // or maven("https://repo.maven.apache.org/maven2/")
    }
}
dependencies {
    implementation("com.github.patrick-mc:websocket-client-api:1.0.4")
}

(ko-kr)

프로젝트 설명

이 API는 WebSocket을 Bukkit에서 쉽게 사용하기 위해 만들어졌습니다.

특징

  • 간단한 WebSocket 연결 / 해제
  • Bukkit을 위한 WebSocket Event
  • Bukkit 플러그인으로 사용 ('plugins' 폴더에 넣어주세요.)
  • Kotlin Plugin 필요

사용 방법

Gradle (Groovy DSL)

allprojects {
    repositories {
        mavenCentral() // 또는 maven { url 'https://repo.maven.apache.org/maven2/' }
    }
}
dependencies {
    implementation 'com.github.patrick-mc:websocket-client-api:1.0.4'
}

Gradle (Kotlin DSL)

allprojects {
    repositories {
        mavenCentral() // 또는 maven("https://repo.maven.apache.org/maven2/")
    }
}
dependencies {
    implementation("com.github.patrick-mc:websocket-client-api:1.0.4")
}

Sample Code / 샘플 코드

Kotlin

val client = WebSocketAPI.createWebSocket("wss://URL_HERE", tls = true, suppress = false)
if (client != null && client.connect()) {
    // Something when successful
} else {
    // Something when failure
}

// implements Listener
fun onWebSocketConnect(event: WebSocketConnectedEvent) {
    if (event.socket == client?.socket) {
        // Something to do
    }
}

client?.disconnect()

Versions

Version
1.0.4
1.0.3
1.0.2
1.0.1
1.0