Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-plugins/TeamsLogger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1
Choose a base ref
...
head repository: rust-plugins/TeamsLogger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 351 additions and 241 deletions.
  1. +4 −1 Examples/config/TeamsLogger.json
  2. +49 −29 README.md
  3. +298 −211 TeamsLogger.cs
5 changes: 4 additions & 1 deletion Examples/config/TeamsLogger.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"Print logs to console": true,
"Print logs to file": true
"Print logs to Discord": false,
"Print logs to file": true,

"Discord hook url": null
}
78 changes: 49 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@
Simple logger for teams provides additional logging. It can be configured to log into files or/and console output.
Simple plugin to provide additional logging of teams events. It can be configured to log into files, console output, Discord channel.

# Installation
To use this plugin with your Rust server, just copy `TeamsLogger.cs` into `\oxide\plugins` folder.
It will create default language files and default configuration.
## Configuration

After plugin will be loaded, you can change configuration file.
Then restart plugin using command in server console `oxide.reload TeamsLogger`

# Configuration
```JSON
{
"Print logs to console": true,
"Print logs to file": true
"CONSOLE SETTINGS": {
"Anti-Spam Measure (Seconds)": 3.0,
"Log to Console": true,
"On Logged Colors (1 - Red, 2 - Yellow, 3 - White)": 3
},
"DISCORD SETTINGS": {
"Anti-Spam Measure (Seconds)": 3.0,
"Discord Rate Limit": 360,
"Log to Discord": false,
"Webhook URL": "---DISCORD WEBHOOK HERE---"
},
"FILE SETTINGS": {
"Anti-Spam Measure (Seconds)": 3.0,
"Log to Files": false
}
}
```
# Localization

### Discord

To send logs via Discord, you'll need to configure [Discord WebHook url](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks).

## Localization

```JSON
{
"OnTeamCreated": "Created {0} | Player: '{1}' ({2}) created new team",
"OnTeamDisbanded": "Disband {0} | Team leader: '{1}' ({2})",
"OnTeamLeave": "Leave {0} | Player: '{1}' ({2}, is leader: {3})",
"OnTeamInvite": "Invite {0} | Player '{1}' ({2}) sent invite to '{3}' (4)",
"OnTeamRejectInvite": "Reject {0} | Player: '{1}' ({2}) rejected invite",
"OnTeamPromote": "Promote {0} | Player: '{1}' ({2}) now is new leader",
"OnTeamKick": "Kick {0} | Player: '{1}' ({2}) was kicked",
"OnTeamAcceptInvite": "Accept {0} | Player: '{1}' ({2}) accepted invite",
"CurrentTeam": "History {0} | Previously created team with members: {1}"

"OnTeamCreated": "OnTeamCreated | Team ID: {0} | Player: '{1}' ({2}) created a new team.",
"OnTeamDisbanded": "OnTeamDisbanded | Team ID: {0} | Team Leader: '{1}' ({2}).",
"OnTeamLeave": "OnTeamLeave | Team ID: {0} | Player: '{1}' ({2}, is leader: {3}).",
"OnTeamInvite": "OnTeamInvite | Team ID: {0} | Player '{1}' ({2}) sent invite to {3} ({4}).",
"OnTeamRejectInvite": "OnTeamRejectInvite | Team ID: {0} | Player: '{1}' ({2}) rejected invite from {3}.",
"OnTeamPromote": "OnTeamPromote | Team ID: {0} | Player: '{1}' ({2}) is the new leader.",
"OnTeamKick": "OnTeamKick | Team ID: {0} | {1} was kicked. | Team Leader: {2}",
"OnTeamAcceptInvite": "OnTeamAcceptInvite | Team ID: {0} | Player: '{1}' ({2}) accepted invite from {3}.",
"CurrentTeam": "CurrentTeams: {0} | Previously created team with members: {1}"
}
```
# Log file example
Path to logs `\oxide\logs\TeamsLogger\teamslogger_common-####-##-##.txt`

## Log Example

To file `oxide/logs/TeamsLogger\/eamslogger_common-####-##-##.txt`
```
17:36:22 Created 96 | Player: 'xan' (76561198051734570) created new team
17:36:23 Leave 96 | Player: 'xan' (76561198051734570, is leader: True)
17:36:23 Disband 96 | Team leader: 'xan' (76561198051734570)
17:36:25 Created 97 | Player: 'xan' (76561198051734570) created new team
17:36:26 Leave 97 | Player: 'xan' (76561198051734570, is leader: True)
17:36:26 Disband 97 | Team leader: 'xan' (76561198051734570)
08:51:22 | OnTeamCreated | Team ID: 12 | Player: 'Ujiou' (765611) created a new team.
08:51:24 | OnTeamLeave | Team ID: 12 | Player: 'Ujiou' (765611, is leader: True).
08:51:25 | OnTeamCreated | Team ID: 13 | Player: 'Ujiou' (765611) created a new team.
08:51:27 | OnTeamLeave | Team ID: 13 | Player: 'Ujiou' (765611, is leader: True).
08:51:28 | OnTeamCreated | Team ID: 14 | Player: 'Ujiou' (765611) created a new team.
08:51:33 | OnTeamLeave | Team ID: 14 | Player: 'Ujiou' (765611, is leader: True).
```

## Credits
* **[0x89A](https://umod.org/user/0x89A)**, helped with slight issues occuring.
* **[Ujiou](https://umod.org/user/Ujiou)**, current maintainer of this plugin.
* **[NickRimmer](https://umod.org/user/NickRimmer)**, the original owner of this plugin.
Loading