Author Topic: Admin Reports / Admin notify  (Read 11670 times)

0 Members and 1 Guest are viewing this topic.

Offline azarus

  • Newbie
  • *
  • Posts: 10
  • Karma: 9
  • NC Gaming
    • NC Gaming
Admin Reports / Admin notify
« on: April 09, 2015, 08:40:56 AM »
Admin Reports (Call Admin)


Description:
It is my first release post here so please bear with me!  :) ::)
This admin reports addon sends notification messages on steam to all friends using a third party steam bot.

Youtube Video:
http://www.youtube.com/embed/1Gj760CRHyM





Requirements:

  • A linux/windows server or vps with nodejs(min required version: v0.12.2)
  • A steam account. (Just make one, it takes 1 min.)
  • ULX
  • Some skill :P

How to set up?
https://github.com/azarus/AdminReports - Download

This addon has 2 parts: a game server addon and a steambot.
The steambot can run on any machine linux or windows, but it requires nodejs(v0.12.2).
I recomend using linux.

Addon:
Just upload the adminreport folder to your addons folder.

Server cvars:
Code: [Select]
ulx adminreport_remotehost "http://mysteambot:8000/" // This is used by the game server to send out notifications to the steambot. Server ip and port (Not the game server's ip!)
ulx adminreport_remotepassword "password" // This is the password we set in the steambot's file
ulx adminreport_delay 60 // Delay between 2 reports (Anti spam purposes)
Note that you need the http:// in the adminreport_remotehost cvar!

Steam Bot
I am going to make a short tutorial video on how to setup the steambot because it might be complicate for non-expert users.

If you don't have a server, i recommend digital ocean it is cheap and reliable.

For digital ocean sign up here!  ($5 / month. + $10 credit for free! If you use this link!)

If you don't have spare $5 dollars then you can use your own computer but it requires port forwarding and i will not describe it here sorry.

So i assume you already have a VPS setup and running and you're logged in.
(Root access needed!)


Linux

First create a directory and enter
Code: [Select]
mkdir steambot
cd steambot

Install NodeJS and its dependencies:
CentOS:
Code: [Select]
yum update
curl -sL [url]https://rpm.nodesource.com/setup[/url] | bash -
yum install -y nodejs
yum install wget

Grab NodeJs: (Note that we need v0.12.2 thats why we're not using the package manager!)
Code: [Select]
wget http://nodejs.org/dist/v0.12.2/node-v0.12.2-linux-x64.tar.gz
Extract and copy required files:
Code: [Select]
tar xzf node-v0.12.2-linux-x64.tar.gz
cp ./node-v0.12.2-linux-x64/bin/node node

Install dependencies (using npm):
Code: [Select]
npm install steam
npm install underscore
npm install winston
npm install express
npm install body-parser

Download the Bot:
Code: [Select]
wget [url]https://raw.githubusercontent.com/azarus/AdminReports/master/steambot/Release/app.js[/url]
Open app.js and edit the following lines:
Code: [Select]
var USERNAME = "test1"; // Steam Username
var PASSWORD = "test2"; // Steam Password
var STEAMNAME = "Chat Bot"; // The display name on steam
var SRVPW = "password"; // Remote Password This is used by the Cvar(adminreport_remotepassword)
var SRVPORT = 8000; // Remove listen port this is used by the cvar (adminreport_remotehost)

Start the bot:
Code: [Select]
./node ./app.js
To make it running in the background you need to install screen
Code: [Select]
yum install screen
apt-get install screen

Depends on what Os you have installed.
Code: [Select]
screen -mdS steambot ./node ./app.js
Windows:

Just download node and start it from the command line.
https://nodejs.org/download/
Code: [Select]
node app.js

Downloads:
GitHub Page:
https://github.com/azarus/AdminReports
Just press the download-zip button.

Questions?

If you have any questions feel free to add me on steam.
http://steamcommunity.com/id/azarusx/

« Last Edit: May 15, 2015, 02:26:29 PM by azarus »

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Admin Reports / Admin notify
« Reply #1 on: April 09, 2015, 09:43:48 AM »
That's really neat.  I've always wanted to try making something like this, but never tried.  I've used one before and they're amazing if you get them working right.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Admin Reports / Admin notify
« Reply #2 on: April 14, 2015, 04:57:46 PM »
Pretty hard set up not gonna lie and not much support... (-1 karma sorry)


Update: Still don't know how to do this but the menu is good!

Offline azarus

  • Newbie
  • *
  • Posts: 10
  • Karma: 9
  • NC Gaming
    • NC Gaming
Re: Admin Reports / Admin notify
« Reply #3 on: April 14, 2015, 06:07:53 PM »
Quote
Pretty hard set up not gonna lie
I am going to make a short tutorial video on how to setup the steambot because it might be complicate for non-expert users.

Quoted from my original post.

Quote
and not much support... (-1 karma sorry)
Not much support?
I even made an exclusive video tutorial just for you:
https://www.youtube.com/watch?v=cZ3-mTYEWa0

And your Karma is -33

You're funny!

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Admin Reports / Admin notify
« Reply #4 on: April 14, 2015, 06:34:58 PM »

I even made an exclusive video tutorial just for you:
https://www.youtube.com/watch?v=cZ3-mTYEWa0


And his post is still pretty in-depth.
Once you get to know me, you'll find you'll have never met me at all.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Admin Reports / Admin notify
« Reply #5 on: April 14, 2015, 07:33:58 PM »
azarus, good job. And you're absolutely right... it's funny.

If I were one to rage ban I so would right now. (Though I can get grumpy, my team knows I'm reasonably even keeled when it comes to actual forum moderation).
A developer offers in a release to do personal support through steam, and another claims lack of support and 'complains' due to lack of their own understanding.
How sad. So sad I'm laughing hysterically. Reminds me of Facepunch mentality, and that's a bad thing.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lynx

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 15
Re: Admin Reports / Admin notify
« Reply #6 on: April 20, 2015, 12:38:47 AM »
I love the idea behind it, but one thing isn't covered anywhere: How does the steambot send the messages?

I assume the following (by taking a quick peek at the js):
- A report comes in, it gets sent by a web protocol to the node.
- The bot processes the report, then sends it to all friends. (Don't know if it does an online check.)

Since I just assume that, I also assume the following (by peeking at the js a bit more):
- Friend requests are automatically accepted.
- Messages sent to the bot will log (guessing in the actual console of the node)
- Chatroom invites are automatically accepted and joined. Once in a chatroom it sends messages to the chatroom as well. (Not sure on that second part)
- Any announcement from groups the bot is in are logged.
- It checks every 5000 seconds for life and reconnects if need be.

Did I get close? :P

Anyway, based on these assumptions, and pardon me if I am totally off, I suggest the following:
- Add in a bit of documentation on how the bot actually works
- Remove the auto-accept friend requests (or mention it since it could be an issue if you have a person add the bot randomly and they get your admin messages)
- Add information on what the bot does with messages it gets sent, chatrooms, announcements, etc.
- Decrease the keep-alive timer to 3600 (once every hour) and log if it fails.
- Disable the !report from showing up in chat.
- (If possible, this being just a feature suggestion) If a message has a certain prefix (like !g or something) it sends the message to the server (minus the prefix)
- (This also being a feature suggestion) Integrate a method for multiple servers (so if the previous gets added you can send a message to a specific server)
- (Another feature suggestion) Send the report to all logged in admins in the server (in case they don't have the bot added, or have steam notifications disabled, w/e)

That all being said and done, I'm going to test it out soon :D



Alright, after testing it a bit I see a few things:

Overall:
- The instructions (when using CentOS 6.5 64bit) are somewhat incomplete as when you use yum to install nodejs it installs the 10.x version. I just realized that you have it utilize the local copy you download, but if you wanted to do it right you would copy the new nodejs into the bin folder so that it works globally rather than having to specify ./node rather than node (because we installed node to the system and linux people will realize that)
- Relating to the above: When using npm it throws the error that node-steam must have node version 12.x and doesn't install (or maybe it does but the error seems like it doesn't.)

app.js:
- Whenever a chat is initiated or a user starts typing the console gets a message saying "Received message: " and is blank.
- Whenever a friend is added it doubles the message

Addon:
- I feel like an idiot cause I put the addon in the wrong location. More info coming soon on my thoughts on the game portion..
- (Using the screenshot and video since I haven't gotten ingame to work) The vgui seems a little... Off. The text in the report should be at the top of the box, not the middle. And not sure what the small box on the side is.
« Last Edit: April 20, 2015, 02:58:21 PM by lynx »

Offline azarus

  • Newbie
  • *
  • Posts: 10
  • Karma: 9
  • NC Gaming
    • NC Gaming
Re: Admin Reports / Admin notify
« Reply #7 on: April 22, 2015, 02:04:55 PM »
Huh! You are right and im sorry for the missing parts i had no time to cover everything. But im sure after a few minutes of tweaking you're able to get things working.
Also i tested the tutorial on a Digital Ocean VPS and i install node from yum because we need npm and npm has its own dependencies.

And thanks for the suggestions. I'll do them as  soon as i have more time! :)

Offline azarus

  • Newbie
  • *
  • Posts: 10
  • Karma: 9
  • NC Gaming
    • NC Gaming
Re: Admin Reports / Admin notify
« Reply #8 on: May 15, 2015, 02:28:38 PM »

I am about to regret making this addon :-D