DayZ
Ei tarpeeksi arvosteluja
Holding2Discord
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Type: Mod
Tiedostokoko
Julkaistu
Päivitetty
36.304 KB
12.1.2022 klo 17.48
9.9.2023 klo 23.32
9 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Holding2Discord

Kuvaus
Description
This mod sends the class name of the item the player is holding in the hands to a Discord channel, using webhooks, by pressing "Left shift + H" on the keyboard. The key mapping can be changed in the games options menu if you feel like it.

I use it myself as an easy way for players to notify me about items missing from the trader. Just copy the class name from Discord and paste it into the trader config file. Heck, I even used it the other day when deciding what loot to include in the Airdrop mod. I went on a shopping spree with one brazillion dollars in my pocket and filled my 1000 slot admin jacket with nice stuff. I mean, sometimes you need to see a picture behind a class name. Especially with all the nice SNAFU guns and the such. I don't know what they look like or do, so I just go by the description in the trader.

Anyways! Then I put each item in my hands and sent it to Discord. Threw it away and on with the next one. Boom! Instant list of class names to include in the Airdrop config. After a little trimming in Notepad++ that is.

The nickname, SteamID and BohemiaID of the player is also shown along with the name of the item in the message sent to Discord. This makes it easy to copy the SteamID and paste it into the Blacklist.txt for immediate denial of usage if the player for some reason abuses the mod. No need to restart the server.

There is ofcourse a setting for a minimum amount of seconds that has to pass between messages to prevent flooding.

You can't use the BohemiaID in the black/whitelist. I just sent it along because why not.

The mod "CF" is required for this mod to work.

The source code is included in the "SourceCode" folder within the mod.

Note: If you want to build this mod yourself you have to add *.xml to "List of files to copy directly" in the Addon Builder's options or the key mapping won't work.

Permission is granted to do whatever you want with the mod and source code.


Features
In the config file you can:
• Define the Discord webhook URL.

• Define the nick the message should appear to come from on Discord.
Important: Don't include the word "Discord" in the nick, or the message won't be posted since Discord doesn't allow nicks with the word "Discord" in them.

• Define how many seconds have to pass before a player can send another message to Discord. This is to limit flood abuse.

• Enable/disable a whitelist containing the SteamID:s of the players you want to allow using the mod.

• Enable/disable a blacklist containing the SteamID:s of the players you don't want to use the mod. This list takes precedence over the whitelist in case a player is on both lists for some reason.

• Enable/disable notifying the player if sending to Discord was denied (due to the white/blacklist restrictions).

• Customize the message being sent to the player if access was denied.

• Enable/disable logging. The mod logs date and time (yyyy-MM-dd HH:mm:ss), nickname, SteamID, BohemiaID and coordinates (XXXX/ZZZZ) for when a player successfully or unsuccessfully send a message to Discord.


Change Notes
v5
2023-09-10
• The mod only worked with webhook URLs starting with discord.com. Turns out there are also webhook URLs starting with discordapp.com. This should be fixed now so it works with both.

v4
2023-02-09
• Changed the default nick of the bot from "Holding2Discord" to "HoldingBot", since it seems Discord doesn't allow the word "Discord" in nicks anymore. This probably happened a while ago, but I don't use this mod anymore and didn't know about this change. Thanks ZonemaN for bringing it to my attention.


Installation
• Copy @Holding2Discord to your servers root directory

• Copy the mods keyfile, "Holding2Discord.bikey", to the servers "Keys" directory.

• Edit the bat file used to start the server and add the mod to the -mod parameter, like:
"-mod=@Holding2Discord;@OtherMod1;@OtherMod2" etc.

• Install the mod "CF" according to its instructions.


Configuration
When the server is started for the first time a folder called "Holding2Discord" is created inside the server's profile folder. Inside this folder several files are created. Below is a description of what they do.

Filename: Config.json
{
"discordWebhookURL": "Put your complete Discord webhook URL here",
"discordBotNick": "HoldingBot",
"secondsBetweenSends": 60,
"enableWhitelist": 0,
"enableBlacklist": 0,
"notifyOnDeny": 1,
"whitelistDenyMessage": "Only whitelisted players are allowed to send to Discord on this server, and you are not.",
"blacklistDenyMessage": "You are blacklisted from sending to Discord on this server.",
"enableLogging": 0
}

This is the default content of the configuration file.

discordWebhookURL - The entire Discord webhook URL.

discordBotNick - The nick the message should appear to come from on Discord. Important: Don't include the word "Discord" in the nick, or the message won't be posted since Discord doesn't allow nicks with the word "Discord" in them.

secondsBetweenSends - The number of seconds a player has to wait before another name of an item can be sent to Discord. This is to limit flood abuse.

enableWhitelist - If set to 1 the content of the file "Whitelist.txt" in the same directory will be read. This file should contain the SteamID:s of the players you want to be able to use the mod. Anyone not on the list won't be able to use the mod.

enableBlacklist - If set to 1 the content of the file "Blacklist.txt" in the same directory will be read. This file should contain the SteamID:s of the players you don't want to be able to use the mod. This list takes precedence over the whitelist in case a player is on both lists for some reason.

notifyOnDeny - If set to 1 the player will be notified why access was denied. If set to 0 the player will just be silently ignored.

whitelistDenyMessage - The default message being sent if the player is not on the whitelist.

blacklistDenyMessage - The default message being sent if the player is on the blacklist.

enableLogging - If set to 1 a folder called "Logs" will be created (the first time a loggable event happens) in the same directory as this config file is located. Inside the "Log" folder another folder will be created named after the current year and month, like "2022-01". Inside this last folder the final logfile will be created, named efter todays date, like "2022-01-13.log" in which all todays activities will be recorded. That way you get the logfiles organized monthly. The mod logs date, time, SteamID, BohemiaID, the name of the item in hands and coordinates (XXXX/ZZZZ) for when a player successfully or unsuccessfully sent a message to Discord.

Filename: Blacklist.txt
This file should contain the SteamID:s of the players you don't want to be able to use the mod in case the blacklist is activated. One SteamID per line. Only the first word is read, which should be the SteamID, so you can add a comment after without breaking the mod. Probably a good idea so you know who the SteamID:s belongs to.

Filename: Whitelist.txt
Same goes for this file, except it contains all the players you want to be able to use the mod in case the whitelist is enabled.

Note: The config file as well as the other list files are reloaded every time a player tries to send a message to Discord, so no need to restart the server if you do any changes to them. They will become active immediately.
14 kommenttia
Martin  [tekijä] 19.12.2024 klo 20.13 
@Hooligan_s I'm afraid I don't have the time or energy to do that.
Hooligan_s 19.12.2024 klo 12.49 
@Martin
Help please, I tried to translate into Russian all the notifications to the player in the game, but for something that stopped working your mod, could you translate and post PBO in G-hub.
Thanks in advance
Martin  [tekijä] 19.12.2024 klo 8.22 
@Hooligan_s It has to be installed both on the server and on the client unfortunatelly. The client part listens for key presses by the player so it can send it to the server, so there has to be a client part as well.
Hooligan_s 18.12.2024 klo 13.44 
Please tell me - is it a server mod (pbo) or for the client also need?
Martin  [tekijä] 4.11.2024 klo 8.49 
@MaccaNZ I don't know. Not from my mod (you can easely check the source code). I suggest you change the webhook to a new one. Seems like someone got hold of it.
MaccaNZ 3.11.2024 klo 19.26 
why am I getting this from the webhook?

@here hello we found your webhook in our database. the grabber support server got termed. here is the new invite: https://discord.gg/2Vr9RjDmJa . here is our telegram for backups: https://t.me/infograbber
.strelok 27.3.2024 klo 2.54 
@PsiXDisPanCeR how had u managed to fix it??
Martin  [tekijä] 8.9.2023 klo 8.02 
@PsiXDisPanCeR Alright, glad to hear it. It sounded complicated to fix :D
PsiXDisPanCeR 8.9.2023 klo 5.55 
Your mod is working. It was me who made the mistake
PsiXDisPanCeR 8.9.2023 klo 3.24 
Hi, Martin. The mod conflicts with the BaseBuildingPlus mod. When installing Holding2Discord, the server crashes with the error:

BaseBuildingPlus/scripts/4_World/bbp_building\bbp_triangle_floor\bbp_bfloor\bbp_bfloor_hologram.c(4): Unknown type 'PluginLogicPDA'
Can this be fixed?