Raised This Month: $51 Target: $400
 12% 

[TF2] Allow player to talk to the server via MOTD? (MOTD Commands)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zorutan
Junior Member
Join Date: Aug 2016
Old 06-11-2023 , 18:13   [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
Reply With Quote #1

I was wondering if there's a way to allow MOTDs to send commands to the server or basically just communicate with the server.
I looked around a lot and saw cool stuff like Dynamic MOTD, Advanced ShowMOTDPanel, etc. but frankly, I have no idea what to do with them.

This plugin seems to prove it's possible to make MOTD actually do things.

To be entirely specific, I don't really have a url hosted, so ideally I'd want to use my github page. Having the site be directly coded in the motd file is not enough since the file size limit is super small.

Really the goal is just to be able to have nice buttons and images as a MOTD that can ask the server to do stuff.

I'm specifically trying to make a cooler menu for my Uber Upgrades server. I've got the big motd working via Dynamic MOTD, and it works with the github page site, but I don't really know where to go from there to actually make it so pressing a button in the MOTD does something (I'm assuming I could make a button via html stuff and somehow link it up with source plugins or console commands or just anything)
Zorutan is offline
reBane
Senior Member
Join Date: May 2020
Old 06-12-2023 , 14:45   Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
Reply With Quote #2

The way MotdMenu works is by pumping the menu items into a database for a packed to render into the Motd. Clicking a link or closing the menu goes back through the backend and, from there, rcons into the server with some client information, invoking the correct menu callbacks.
You wont be able to make actions happen from a Motd unless you use rcon.
Spoiler
__________________
Plugins & LibrariesListingGitHubDosMikeTools ▶ ToDo
reBane is offline
Zorutan
Junior Member
Join Date: Aug 2016
Old 06-15-2023 , 16:07   Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
Reply With Quote #3

That part about "goes back through the backend and, from there, rcons into the server",
I'm more than likely misunderstanding but wouldn't it be possible to execute any command there, not just rcon?

Because if so, then I could just make the server react to something like "/buy 1 1 1 20" when written in chat, that the player would say by replacing the rcon with a "say /buy 1 1 1 20"
Zorutan is offline
reBane
Senior Member
Join Date: May 2020
Old 06-15-2023 , 16:47   Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
Reply With Quote #4

Your plugins are on the game-server, the Motd is on the client, the Motd can not execute (chat)commands, the Motd should not rcon, the web-server (backend) renders into the Motd, the web-server is a controlled 3rd point that cant validate the user input (Motd), the web-server can safely rcon into the game-server.
Thinking about it, if you're an absolute mad man, you could write an http web-server implementation as plugin using socket ext and open the web port on your game server (requires access to port config and that there is no other web server like apache, nginx or anything); then your web-server and game-server would be in the same application, and could cross talk better. Delivering web assets from the game-server might tank performance on the game thread tho.
__________________
Plugins & LibrariesListingGitHubDosMikeTools ▶ ToDo
reBane is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode