Skip to content

Commit

Permalink
Merge pull request #8 from faketunaPrivateCamp/full-refactor
Browse files Browse the repository at this point in the history
Full refactoring and New syntax
  • Loading branch information
faketuna committed Dec 28, 2023
2 parents 3ee1ed5 + e530599 commit 8c54fbf
Show file tree
Hide file tree
Showing 102 changed files with 2,181 additions and 3,398 deletions.
35 changes: 16 additions & 19 deletions README.MD
@@ -1,16 +1,9 @@
# SkriptWebAPI - SKeb

[日本語のREADMEあります](/README_JA.MD)

# Notice

## This addon is abandoned by addon author due to low motivation to Minecraft / Java.

## In the future, I maybe release full rewrite version of this addon. But not decided yet.

[English] [[日本語]](/README_JA.MD)
# Disclaimer

I will not responsible for loss, trouble etc. caused by using this plugin. Please use at your own risk.
I will not be responsible for loss, trouble etc. caused by using this plugin. Please use at your own risk.

## Index

Expand All @@ -27,20 +20,20 @@ I will not responsible for loss, trouble etc. caused by using this plugin. Pleas

## About

Allow to use API server feature, Web Request feature easily on Minecraft servers with Skript.
Simple HTTP Server and Web request feature in Skript easily.

## Features

- Allow to build HTTP API Server
- Can send Web Request
- HTTP Server
- Web Request

## Install

Might not be work in spigot server. Please use Paper server or Paper fork server.
This plugin requires paper server or paper based server.

Now only work with 1.19.3 server. Older version is supporting soon.
This plugin able to load in 1.13 or higher with Skript 2.7.3 or higher. but only 1.20.2 or higher is officially supported.

1. Download `SkriptWebAPI-<Version>.jar` from [here](https://github.com/faketunaPrivateCamp/SkriptWebAPI/releases). Lager number mean recent.
1. Download `SkriptWebAPI-<Version>.jar` from [here](https://github.com/faketunaPrivateCamp/SkriptWebAPI/releases).
2. Put your downloaded jar to server plugins folder
3. Run and ready to use

Expand All @@ -52,14 +45,18 @@ Example and syntax has provided in Skript Hub

### Important

If you use reply effect in if statement, you need `exit` after reply for avoid error
If you use reply effect not in end of event you need `exit` after reply for avoid error
```sk
if (something):
reply %httpexchange% with %string% and response code 200
exit
if (something2):
reply %httpexchange% with %string% and response code 202
exit
```

Also you need `reply %httpexchange% as not found` in last line of event
You should respond the HTTP request otherwise HTTP clients keep waiting for your response.
```sk
on receive get request:
set {_request} to event-request
Expand All @@ -68,11 +65,11 @@ on receive get request:
reply {_request} with %string% and response code 200
exit
reply {_request} as not found
reply {_request} with %string% and response code 500
```

If someone know forcing this syntax above please open issue.

## Todo

- Test and allow to load in 1.12.2 ~ 1.19.2
- None
31 changes: 15 additions & 16 deletions README_JA.MD
@@ -1,16 +1,10 @@
# SkriptWebAPI - SKeb

[English readme available](/README.MD)

# Notice

## アドオン作者のMinecraft/Javaに対するモチベーションが限りなく低いためこのアドオンはメンテナンスされません。

## 決まったわけではありませんが、将来的にはコードを1から書き直したバージョンを作成する可能性があります。
[[English]](/README.MD) [日本語]

# 免責事項

このアドオンを使用した結果発生したいかなる損害にも責任は一切負いません。
このアドオンを使用した結果発生したいかなる損害にも責任は一切負いません。全て自己責任でご利用ください。

## 目次

Expand All @@ -27,17 +21,18 @@

## 概要

Skriptを使用してMinecraftサーバーにAPIサーバー設置したりとかWeb Request送れるようにします。
Skriptを使用してMinecraftサーバーにHTTPサーバー設置したりとかWeb Request送れるようにします。

## 機能

- HTTPのAPIサーバー建てられます
- HTTPのサーバー建てられます
- Web request送れます

## インストール

Spigotサーバーではおそらく動作しません。 Paperサーバーまたはその派生サーバーをご利用ください
Paperサーバーかその派生サーバーでのみ動作します

現在は1.19.3でのみ動作します。今後古いバージョンもサポートする予定です
Minecraftのバージョン1.13以降のSkript 2.7.3以降でロードできるようにしていますが、1.20.2以降がサポート対象です

1. [ここ](https://github.com/faketunaPrivateCamp/SkriptWebAPI/releases) から `SkriptWebAPI-<バージョン>.jar` をダウンロードしてください。 数字が大きい方が新しいです。
2. ダウンロードしたjarファイルをサーバーのpluginsフォルダに入れてください
Expand All @@ -52,14 +47,18 @@ Spigotサーバーではおそらく動作しません。 Paperサーバーま

### 重要

IF文の中にreplyが含まれている場合その処理の後のバグを回避するために `exit` を入れてください。
イベントの処理の最後ではなく、途中でreplyを使う場合はバグを回避するために `exit` を入れてください。
```sk
if (something):
reply %httpexchange% with %string% and response code 200
exit
if (something2):
reply %httpexchange% with %string% and response code 202
exit
```

また `reply %httpexchange% as not found` をイベントの最後の行に入れてください
また、どの様な理由があれ必ずレスポンスを送信してください。 でなければ、クライアントがサーバーからのレスポンスを待ち続けることになります
```sk
on receive get request:
set {_request} to event-request
Expand All @@ -68,9 +67,9 @@ on receive get request:
reply {_request} with %string% and response code 200
exit
reply {_request} as not found
reply {_request} with %string% and response code 500
```

## やることリスト

- 1.12.2 ~ 1.19.2での動作を確認しそれらのバージョンで動作できるようにする
- 無し
68 changes: 0 additions & 68 deletions bin/main/jp/faketuna/addon/skriptwebapi/SkriptWebAPI.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions bin/main/jp/faketuna/addon/skriptwebapi/api/server/objects/Body.kt

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8c54fbf

Please sign in to comment.