AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Allow player to talk to the server via MOTD? (MOTD Commands) (https://forums.alliedmods.net/showthread.php?t=343060)

Zorutan 06-11-2023 18:13

[TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
 
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)

reBane 06-12-2023 14:45

Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
 
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

Zorutan 06-15-2023 16:07

Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
 
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"

reBane 06-15-2023 16:47

Re: [TF2] Allow player to talk to the server via MOTD? (MOTD Commands)
 
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.


All times are GMT -4. The time now is 17:14.

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