mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-06 05:28:02 +03:00
docs and configs update
This commit is contained in:
parent
3f163abb7c
commit
978fe2265e
32
README.md
32
README.md
@ -34,17 +34,20 @@ cargo build --release # build release (target/release/bRAC)
|
||||
cargo run # run (builds and runs bRAC itself)
|
||||
```
|
||||
|
||||
## config
|
||||
## default config
|
||||
|
||||
```yml
|
||||
host: meex.lol:11234 # server host
|
||||
name: null # user name
|
||||
name: null # user name (null - ask every time)
|
||||
message_format: 리㹰<{name}> {text} # message format
|
||||
update_time: 50 # update chat interval
|
||||
max_messages: 100 # chat messages limit
|
||||
max_messages: 200 # chat messages limit
|
||||
enable_ip_viewing: false # enable users' ip viewing
|
||||
disable_ip_hiding: false # disable your ip hiding
|
||||
enable_auth: false # enable auth-mode
|
||||
```
|
||||
|
||||
## command args
|
||||
## command-line options
|
||||
|
||||
```
|
||||
-p, --config-path Print config path
|
||||
@ -58,23 +61,30 @@ max_messages: 100 # chat messages limit
|
||||
-i, --disable-ip-hiding Disable ip hiding
|
||||
-v, --enable-users-ip-viewing Enable users IP viewing
|
||||
-C, --configure Configure client
|
||||
-a, --disable-auth Disable authentication
|
||||
-a, --enable-auth Enable authentication
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
```
|
||||
|
||||
## commands
|
||||
## cheat commands
|
||||
|
||||
`/help` - show help message \
|
||||
`/clear` - clear chat \
|
||||
`/spam *args` - spam with text \
|
||||
`/ping` - get server ping (send + read)
|
||||
commands are any messages that start with a slash `/` \
|
||||
messages starting with a slash are sent to chat only if the `--disable-commands` option is specified
|
||||
|
||||
- `/help` - show help message \
|
||||
- `/clear` - clear chat \
|
||||
- `/spam *args` - spam with text \
|
||||
- `/ping` - get server ping (send + read)
|
||||
|
||||
## docs
|
||||
|
||||
- [Message formats](https://github.com/MeexReay/bRAC/blob/main/docs/message_formats.md)
|
||||
- [Authenticated mode](https://github.com/MeexReay/bRAC/blob/main/docs/auth_mode.md)
|
||||
|
||||
## see also
|
||||
|
||||
- [RAC protocol (v2.0)](https://gitea.bedohswe.eu.org/pixtaded/crab#rac-protocol)
|
||||
- [CRAB - client & server for RAC](https://gitea.bedohswe.eu.org/pixtaded/crab)
|
||||
- [Mefidroniy - client for RAC](https://github.com/OctoBanon-Main/mefedroniy-client)
|
||||
- [Colored usernames](https://github.com/MeexReay/bRAC/blob/main/docs/colored_usernames.md)
|
||||
- [AlmatyD - server for RACv1.0](https://gitea.bedohswe.eu.org/bedohswe/almatyd)
|
||||
- [RAC protocol (v1.0)](https://bedohswe.eu.org/text/rac/protocol.md.html)
|
||||
|
8
docs/auth_mode.md
Normal file
8
docs/auth_mode.md
Normal file
@ -0,0 +1,8 @@
|
||||
# auth mode
|
||||
|
||||
## differences from the unauthorized mode
|
||||
|
||||
### message format
|
||||
|
||||
- there is must to be "> " after name ({name}> {text})
|
||||
- if there is magic key (like 리㹰) then you must add "<" sign after it (not always)
|
@ -1,25 +0,0 @@
|
||||
# colored usernames
|
||||
|
||||
## bRAC
|
||||
|
||||
regex - `\uB9AC\u3E70<(.*?)> (.*)` \
|
||||
color - green \
|
||||
example - `리㹰<nick> text`
|
||||
|
||||
## CRAB
|
||||
|
||||
regex - `\u2550\u2550\u2550<(.*?)> (.*)` \
|
||||
color - light red \
|
||||
example - `═══<nick> text`
|
||||
|
||||
## Mefedroniy
|
||||
|
||||
regex - `(.*?): (.*)` \
|
||||
color - light magenta \
|
||||
example - `nick: text`
|
||||
|
||||
## clRAC
|
||||
|
||||
regex - `<(.*?)> (.*)` \
|
||||
color - cyan \
|
||||
example - `<nick> text`
|
47
docs/message_formats.md
Normal file
47
docs/message_formats.md
Normal file
@ -0,0 +1,47 @@
|
||||
# message formats
|
||||
|
||||
## types
|
||||
|
||||
### bRAC
|
||||
|
||||
this client
|
||||
|
||||
```yml
|
||||
format: "리㹰<{name}> {text}"
|
||||
regex: "\uB9AC\u3E70<(.*?)> (.*)"
|
||||
color: "green"
|
||||
```
|
||||
|
||||
### CRAB
|
||||
|
||||
[CRAB - client & server for RAC written in java](https://gitea.bedohswe.eu.org/pixtaded/crab)
|
||||
|
||||
```yml
|
||||
format: "═══<{name}> {text}"
|
||||
regex: "\u2550\u2550\u2550<(.*?)> (.*)"
|
||||
color: "light red"
|
||||
```
|
||||
|
||||
### Mefedroniy
|
||||
|
||||
[Mefidroniy - client for RAC written in rust](https://github.com/OctoBanon-Main/mefedroniy-client)
|
||||
|
||||
```yml
|
||||
format: "°ʘ<{name}> {text}"
|
||||
regex: "\u00B0\u0298<(.*?)> (.*)"
|
||||
color: "light magenta"
|
||||
```
|
||||
|
||||
### clRAC
|
||||
|
||||
official client
|
||||
|
||||
```yml
|
||||
format: "<{name}> {text}"
|
||||
regex: "<(.*?)> (.*)"
|
||||
color: "cyan"
|
||||
```
|
||||
|
||||
## developer notes
|
||||
|
||||
in auth-mode, there is must to be `> ` after name (`{name}> {text}`)
|
@ -39,7 +39,7 @@ fn default_host() -> String { "meex.lol:11234".to_string() }
|
||||
fn default_message_format() -> String { MESSAGE_FORMAT.to_string() }
|
||||
|
||||
fn ask_usize(name: impl ToString, default: usize) -> usize {
|
||||
get_input(format!("{} (default: {}) > ", name.to_string(), default).bright_yellow())
|
||||
get_input(format!("{} (default: {}) {} ", name.to_string().bold(), default, ">".bold()).bright_yellow())
|
||||
.and_then(|o| o.parse().ok()).unwrap_or(default)
|
||||
}
|
||||
|
||||
@ -49,11 +49,11 @@ fn ask_string(name: impl ToString, default: impl ToString + Clone) -> String {
|
||||
|
||||
fn ask_string_option(name: impl ToString, default: impl ToString) -> Option<String> {
|
||||
let default = default.to_string();
|
||||
get_input(format!("{} (default: {}) > ", name.to_string(), default).bright_yellow())
|
||||
get_input(format!("{} (default: {}) {} ", name.to_string().bold(), default, ">".bold()).bright_yellow())
|
||||
}
|
||||
|
||||
fn ask_bool(name: impl ToString, default: bool) -> bool {
|
||||
get_input(format!("{} (Y/N, default: {}) > ", name.to_string(), if default { "Y" } else { "N" }).bright_yellow())
|
||||
get_input(format!("{} (Y/N, default: {}) {} ", name.to_string().bold(), if default { "Y" } else { "N" }, ">".bold()).bright_yellow())
|
||||
.map(|o| o.to_lowercase() != "n")
|
||||
.unwrap_or(default)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{error::Error, io::{Read, Write}, net::{Shutdown, TcpStream}};
|
||||
use std::{error::Error, io::{Read, Write}, net::TcpStream};
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user