Skip to content

Commit

Permalink
Tools/Contrib : Add ServerRelay to contrib folder. Please read the RE…
Browse files Browse the repository at this point in the history
…ADME.md for clarification how to use it. (#65)
  • Loading branch information
devil1234 authored and Traesh committed Aug 9, 2018
1 parent e0090ce commit 4a94f52
Show file tree
Hide file tree
Showing 9 changed files with 3,137 additions and 0 deletions.
1 change: 1 addition & 0 deletions contrib/ServerRelay/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules*/
82 changes: 82 additions & 0 deletions contrib/ServerRelay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ServerRelay

Server Relay between world of warcraft world channel(AshamaneCore) and Discord.

### CREDITS
* Made by : __DEVIL1234__
* E-mail : __[email protected]__.
* Credits for helping me : __Traesh__ from AshamaneProject
* Credits to guys with exceptional packages that simplified the process of making this project to happen

### Installation

To install this ServerRelay on your server(is more securely to run in same host with worldserver or internal on lan) you need to install Node.JS package and have setup a discord server and bot for it. Is already many tutorials how to setup this already on internet (google it bro). Tip : set the discordapp on developer mode, for id's right-click on channel's and select copy id.

SPECIAL REQUIREMENT : compile the worldserver with -DCPR=1 argument on cmake. ( will take a longer time to configure)

Recommended version of Node.JS : __v8.11.3__. Upper version is your risk to use.
1. Commands:
```javascript
//That will install all packages needed from package.json and will be ready to use
npm install
```
2. Configure the config.json file with your channels id and token from bot. The rest is preferable to not edit exception is the prefix for send command. Like this :
```javascript
{
"token": "BOT-TOKEN",
"channel_id": "RELAY-CHAT-ID",
"staff_channel_ID" : "STAFF-CHANNEL-ID",
"post_url_server_message_world": "http://127.0.0.1:8082/sendChannelMessage/",
"post_url_server_message_alliance" : "http://127.0.0.1:8082/sendChannelMessage/0",
"post_url_server_message_horde" : "http://127.0.0.1:8082/sendChannelMessage/1",
"post_url_server_command": "http://127.0.0.1:8082/command",
"post_port": "8082",
"post_token": "TOKEN FROM WORLDSERVER.CONF ON WorldREST.AuthToken, THIS ONE NEED TO MATCH HERE",
"channel_horde" : "world_h", // I RECOMMEND TO NOT CHANGE IT
"channel_alliance": "world_a", // I RECOMMEND TO NOT CHANGE IT
"allow_interactions" : "0", // IF YOU SET TO 1, YOU NEED TO ENABLE IN WORLDSERVER.CONF THIS ONE : AllowTwoSide.Interaction.Channel.
"channel_world" : "world", // I RECOMMEND TO NOT CHANGE IT
"command_prefix" : "." // IS USED ON staff channel for purge command(delete the message on channels) and send command for ingame commands(is same one from console)
}
```
3. Configure the roles:
```javascript
Open the server.js file with txt editor and read the comments line numbers : 13 -> 16
```
4. Running the server :
* Windows :
<br /> WARNING: WILL RUN WITHOUT CMD PROMPT TO BE SHOWN
```javascript
Run the file windows.vbs
```
* Linux :
```javascript
chmod +x run.sh
./linux.sh &
// OPTIONALY CAND SET A CRONTAB WITH run.sh. THE SERVER IF IS WILL CRASH, THE NODEMON WILL TAKE OF SERVER.JS. IF YOU WANT TO SETUP CRONTAB ON THE END NOT SPECIFY `</dev/null>` BECAUSE IS ALREADY SPECIFIED ON linux.sh
```

### Commands accessible on this discord bot
* Send
```javascript
(prefix)send argument(commands accessible on worldserver console)
```
* EXAMPLE :
```javascript
.send help // will return all commands available
```

* Purge
```javascript
(prefix)purge <1-100> (will delete the message on channel(can be used on any channel)
```
* EXAMPLE
* EXAMPLE :
```javascript
.purge 10 // delete 10 messages from channel
```

### Support
If you need support for this relay contact me on discord server Ashamane under the username : __devil1234__.
If you want to support with donations contact me same like up but on direct message/private message.
15 changes: 15 additions & 0 deletions contrib/ServerRelay/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"token": "",
"channel_id": "",
"staff_channel_ID" : "",
"post_url_server_message_world": "http://127.0.0.1:8082/sendChannelMessage/",
"post_url_server_message_alliance" : "http://127.0.0.1:8082/sendChannelMessage/0",
"post_url_server_message_horde" : "http://127.0.0.1:8082/sendChannelMessage/1",
"post_url_server_command": "http://127.0.0.1:8082/command",
"post_token": "",
"channel_horde" : "world_h",
"channel_alliance": "world_a",
"allow_interactions" : "0",
"channel_world" : "world",
"command_prefix" : "."
}
1 change: 1 addition & 0 deletions contrib/ServerRelay/linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodemon > /dev/null
Loading

0 comments on commit 4a94f52

Please sign in to comment.