HTML not rendered in MOTD
1 Attachment(s)
Hi, I want to use HTML in a MOTD to display things nicely, and finally display a webpage with meta refresh when I have the webpage done and some more database things implemented.
I need help with the MOTD, because it's not rendering any HTML. I'm guessing it should at least just display the text inside it with some formating like any basic web browser, but here it just leaves the HTML tags and everything, as plain text. I created a tiny plugin to reproduce this. In the attached screenshot it can be seen the MOTD that pops up when saying /mymotdhtml. The other 2 commands show the an equal MOTD, no HTML rendered. PHP Code:
Is it the plugin wrong? is there anything in those clients that prevent HTML from being rendered? because I've seen plugins in CS 1.6 render HTML in MOTD windows :| am I missing anything else? Thanks for your attention! |
Re: HTML not rendered in MOTD
pretty sure half life has only text based motd
|
Re: HTML not rendered in MOTD
Since the MOTD is implemented by the game client, you can't change what the MOTD is capable of rendering. Like jimaway said, Half-Life (the original game) doesn't support HTML-based MOTDs. Counter-Strike 1.6 and Day of Defeat (and some HL1 mods) have a basic web browser in the MOTD window which allows them to render basic HTML, use CSS, and execute Javascript.
|
Re: HTML not rendered in MOTD
Thank you very much for your answers.
Then I think there's still some hope :) Approximately 1/3 of the players use an open source client to play the mod (Adrenaline Gamer). I have zero experience in C++ and how a project of that kind is organized, but I think this is the implementation of the MOTD in the client: OpenAG MOTD Maybe this is out of the scope of the thread/forum, but doing a fork of that repo to modify the MOTD implementation and adding for example a basic HTML or even something simpler as Markdown renderer would be enough for this to work? Maybe I would also have to include a client cvar that the server checks to see if the client can render the MOTD, and else fall to a default plain text MOTD for clients that don't have that cvar (ie. closed source client). Also, could I change the 1536 char limit for the MOTD? there's a MAX_MOTD_LENGTH constant in the same repo in the hud.h and multiplay_gamerules.cpp, but I think the reHLDS server only allows up to 2048? I'm a bit confused about all these different places, would I also have to do a fork of reHLDS to edit that limit so the server can send more than 2048? would all of this be VAC-safe, or a client with these modifications could be VAC-banned? Sorry if this is out of scope and thank you again! |
Re: HTML not rendered in MOTD
You can add your MotD html file on your server / Web Hosting
And provide the location of it ( on web server ) to your motd.txt ( server's ) In that way you can easily gain all functionality of HTML on your MOTD :) |
Re: HTML not rendered in MOTD
I already tried that with an iframe and with a meta refresh, but none works as the client thinks those HTML tags are plain text as I understand from the other answers. Or were you proposing a different idea and I misunderstood you?
|
Re: HTML not rendered in MOTD
Yes u misunderstood ...
I meant this : Suppose u got a site : example.com Post your HTML ( Motd) there .. ex : - example.com/motd.html Now add this to motd.txt ( server side ) HTML Code:
<html> |
Re: HTML not rendered in MOTD
The code in there is exactly the same as one I tried yesterday, replacing the URL with my website's, and yea, like I said in the previous comment what the player sees is just the same as the code you posted. Take the screenshot attached to the first post, that's what the player sees, and it's almost the simplest HTML you can get. Adding a meta refresh or iframe doesn't change anything if it doesn't even parse the <html> tag. :cry:
|
Re: HTML not rendered in MOTD
Quote:
Quote:
|
Re: HTML not rendered in MOTD
I will face the risk. Not now though, I'll probably come back to this issue in 2 months and answer my other questions when I get everything done, so other people with this problem can hopefully solve it reading this thread.
I'm marking this as solved since the initial questions have been answered. If the others can be answered in the meanwhile then perfect. Thank you! |
All times are GMT -4. The time now is 19:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.