kylemcshea / homestead-vorp

Dream-VORP is a community-driven project enhancing the original VORP Core software. We focus on performance optimizations, code readability, and bug fixes. Our aim is to build upon VORP Core's foundation while acknowledging their invaluable work. Join us in refining this software!
GNU General Public License v3.0
3 stars 0 forks source link

Set up discord logs through a cfg variable so that we can put api links without pushing it into github for all to see #7

Open kylemcshea opened 1 year ago

kylemcshea commented 1 year ago
  1. Send to Discord
  2. Send to Splunk

Make some sort of reusable server function that we call so we don't have disgusting code everywhere

megasmidge commented 1 year ago

I made a "webhook" resource in the new [LOG] directory (like [VORP] or [SYN]). In server.lua we have an exported "send_to_splunk" function available to rest of the LUA environment. This does what it sounds like, and sends to splunk taking 2 parameters. The first parameter is the raw data itself (string, json, whatver), and the second parameter is a string basically labeling what kind of data it is.

for instance, it would be helpful to send bank type logs with: exports.webhook:send_to_splunk(data, "bank")

and then lets say inventory logs same thing: exports.webhook:send_to_splunk(data, "inventory")

that second parameter makes it MUCH easier to sort/search/filter data in splunk. I have not really messed with sending to discord yet but it's on my radar. Watched a good video on it this morning data is sending to splunk btw

Image

megasmidge commented 1 year ago

removed actual splunk link and splunk token from git

megasmidge commented 1 year ago

Done with: "vorp_bank:depositcash" "vorp_bank:withcash" "vorp_bank:depositgold" "vorp_bank:withgold" "mailbox:sendBroadcast" chatMessage

Still looking into these triggered server events: "vorp_bank:UpgradeSafeBox" "mailbox:sendMessage" "vorp:removeMoney" "vorpcharacter:deleteCharacter" vorp_inventoryApi()AddItem subItem can i harnass discord from vorp fishing: 'vorp_fishing:discord' event vorp:setjob "vorp_hunting:giveReward" "vorp_hunting:finalizeReward" "vorp_hunting:getJob" "vorpCore:subItem" "vorp_hunting:findJob" 'vorp_lumberjack:addItem' 'vorp_bossmanager:givelicense' 'vorp_bossmanager:revokelicense' 'vorp_bossmanager:givejob' 'vorp_bossmanager:revokejob' "vorpMed:deleteHorse" "vorpMed:HealPatient" "vorpMed:giveBack" "vorpMed:resurrectPlayer" "vorp:resurrectPlayer" "vorp:AddRecipes" "vorp:RemoveRecipes" "vorpMed:BecomeHerbalist" "vorpMed:saveHorse" "vorpMed:findHorse" "vorpMed:horseFound" "vorpMed:healOuter" "vorpMed:healInner" 'vorp_mining:addItem' "wcrp:deleteVehicle" "vorp_ml_policejob:cuffplayer" "vorp_ml_policejob:metervehiculo" "vorp_ml_policejob:uncuffplayer" "vorp_ml_policejob:lassoplayer" "enter:pd" "vorp_ml_policejob:drag" 'vorp_ml_policejob:sacar' 'vorp_ml_policejob:meter' 'vorp_ml_policejob:hogtie' "vorp_outlaws:remove" "vorp_outlaws:check" "vorp_outlaws:remove" "vorp_outlaws:canstart" "vorp_stores:sell" "vorp_stores:buy" "chat:addMessage" playerDropped playerJoining playerSpawned vorp:addMoney vorp:addXp vorp:removeXp vorp:removeMoney vorp:ImDead "vorpcharacter:reloadafterdeath" vorp:PlayerForceRespawn