Page 1 of 1

MOTDPlayer v2

Posted: Mon Apr 10, 2017 6:23 pm
by iPlayer
MOTDPlayer v2 Package
by Kirill "iPlayer" Mysnik

GitHub: KirillMysnik/SP-MOTDPlayer2

What's this?
MOTDPlayer is a software for Source-powered games that allows plugin creators to send interactive Message of The Day screens to their players.

MOTDPlayer consists of:
  • Source.Python custom package
  • Flask web-application
  • JavaScript library

MOTDPlayer automatically authorizes the user behind the scenes, so your MoTD web-page will know which of your players exactly is viewing it. All auth details are secured with a SHA-512 hash, so it's impossible to view the page as another player.

MOTDPlayer provides an interface that lets the MoTD page send data to the game server and get something in return.

Just to make sure you realize how powerful MOTDPlayer is, I give you a link to ArcRPG inventory/stats demo video. That one was actually implemented with MOTDPlayer v1. Version 2 is way more powerful and allows the usage of WebSocket protocol.

Example applications can be found in MOTDPlayer repo.

Here's the topic which includes a video tutorial.

How to use it in your plugin
API docs can also be found in MOTDPlayer repo here.

Re: MOTDPlayer v2

Posted: Mon Apr 10, 2017 10:40 pm
by Predz
Does anybody know of a way to sensibly immitate uWSGI on a windows machine? If not looks like I am going to have to work with Ubuntu again :P

Re: MOTDPlayer v2

Posted: Mon Apr 10, 2017 10:53 pm
by iPlayer
I did it. Sensibly. In a VMWare Workstation Player :)

Well, besides immitating uWSGI on Windows, there're other options:
  • If you don't need WebSocket support, you can use any Windows web-server or even run Flask development server (just run
  • If you don't need MOTDPlayer *right now*, you can wait til I implement more broad WebSocket support through Flask libraries that support all kinds of WebSocket protocol suppliers. Then we won't be bound to uWSGI. But, as you might guess, that's not my highest priority as I'm working on Source.Python Admin now.

Re: MOTDPlayer v2

Posted: Mon Apr 10, 2017 11:04 pm
by iPlayer
Quoting a question from another thread,
Kill wrote:Edit: is it possible to use this with say, JS server-side or PHP instead of Flask?

MOTDPlayer consists of three parts: SP custom package, Flask application and JS library.

If you drop Flask application and tend to use PHP/NodeJS, you'll have to supply your own replacement for it.

What Flask application basically does:
  • Auth. You should create something that will not only do the auth process basing on URL data, but also connect to SRCDS and tell it the new user-salt;
  • Data delivery from SRCDS to the web-page;
  • Filtered data delivery from the web-page to SRCDS. "Filtered" means that a malicious 1GB of data should be stopped by your web-application, not carefully sent to SRCDS on its Custom Communication Port.

To answer unasked question: No, I don't think I will do it. I mean, of course I'm interested in somebody doing it because that will broaden MOTDPlayer usage, but I run Flask web-servers, I love Python, and I don't like PHP nor JS.

EDIT: Also I'd like to denote that a usual PHP shared hosting won't suffice anyways. Your web-server needs to be in the same network with the SRCDS (for security reasons it's not recommended to expose Custom Communication Port to the internet). So you'll need to rent a VDS anyways, and if that's the case, there's absolutely no reason not to install Flask.

Re: MOTDPlayer v2

Posted: Tue Apr 11, 2017 4:46 pm
by Doldol
Predz wrote:Does anybody know of a way to sensibly immitate uWSGI on a windows machine? If not looks like I am going to have to work with Ubuntu again :P

Well uWSGI can run with Cygwin :3

Or you could try using django-channels instead, but it will require you to rewrite the Flask application into a django project. (I use this setup myself to connect with gameservers and webclients and it works great!)

Channels provides and async server that supports both HTTP and WebSockets and is written in Python.

Re: MOTDPlayer v2

Posted: Sun Jul 23, 2017 11:18 pm
by iPlayer
Apparently one of the CS:GO updates broke MoTD screens in that game.

More info:

I'd appreciate if anybody who's seen the features of the MOTDPlayer package would do the following:
  1. Login to GitHub;
  2. Go to the issue "MoTD: URL gets stuck" at ValveSoftware repo;
  3. Add a Thumbs Up reaction to the issue:
According to Valve, this will help prioritizing the issue.