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

Dynamic MOTD 3.0


Post New Thread Reply   
 
Thread Tools Display Modes
psychonic

BAFFLED
Join Date: May 2008
Old 11-27-2011 , 03:30   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #81

Posted version 2.1.0.

Major code cleanup in a few areas (150+ less lines and more comments).

Also, the large/big-style MOTD windows on TF2 (dynamicmotd_big) now behave like the normal MOTD, rather than delaying MOTD until after team selection.

Last edited by psychonic; 11-27-2011 at 03:30.
psychonic is offline
Mooash
Junior Member
Join Date: Dec 2011
Old 12-11-2011 , 06:50   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #82

I cannot get this to work for the life of me and I've looked through this entire thread to try and resolve the issue.

I've got SteamTools installed so I used the "Get Plugin" option to download the plugin for my server but I've also tried it without and uninstalled SteamTools.

The server is a windows server, hosted by Hypernia and its running CS:S with SourceMod version 1.4.1 and MetaMod:Source version 1.8.8-dev. Its running the latest version of CS:S and in my server.cfg file I've got

Code:
dynamicmotd_url "http://servers.mooash.com/motd/motd.php?server_name={SERVER_NAME}&name={NAME}&steamid={STEAM_ID}&map={CURRENT_MAP}&next_map={NEXT_MAP}"
and also in my motd.txt I've got the same URL.

Yet when I load motd it still just loads as if it was sending that URL straight to the server thats hosting the PHP script. That link works, its just one I quickly made up, since I've tested it replacing those values so I'm guessing its something I haven't done right server side?

I've got the following plugins installed:

Code:
[SM] Listing 21 plugins:
           01 "Admin File Reader" (1.4.1) by AlliedModders LLC
           02 "Admin Help" (1.4.1) by AlliedModders LLC
           03 "Admin Menu" (1.4.1) by AlliedModders LLC
           04 "Anti-Flood" (1.4.1) by AlliedModders LLC
           05 "Basic Chat" (1.4.1) by AlliedModders LLC
           06 "Basic Comm Control" (1.4.1) by AlliedModders LLC
           07 "Basic Commands" (1.4.1) by AlliedModders LLC
           08 "Basic Info Triggers" (1.4.1) by AlliedModders LLC
           09 "Basic Votes" (1.4.1) by AlliedModders LLC
           10 "Client Preferences" (1.4.1) by AlliedModders LLC
           11 "Dynamic MOTD Replacer" (2.1.0) by psychonic
           12 "Fun Commands" (1.4.1) by AlliedModders LLC
           13 "Fun Votes" (1.4.1) by AlliedModders LLC
           14 "HLstatsX CE Ingame Plugin" (1.6.15) by psychonic
           15 "Nextmap" (1.4.1) by AlliedModders LLC
           16 "Player Commands" (1.4.1) by AlliedModders LLC
           17 "Reserved Slots" (1.4.1) by AlliedModders LLC
           18 "Sourcebans Checker" (1.0.0) by psychonic & Ca$h Munny
           19 "Sound Commands" (1.4.1) by AlliedModders LLC
           20 "SourceBans" (1.4.9) by SourceBans Development Team
           21 "SuperLogs: CSS" (1.2.4) by psychonic


I've tried to include all the information I can think of so if you can help me I'll be very greatful!

Thanks in advance.

UPDATE: I've got a text file of my MOTD since it could be my PHP here

Last edited by Mooash; 12-11-2011 at 07:02. Reason: Update
Mooash is offline
Velsk
Member
Join Date: Sep 2011
Old 12-12-2011 , 12:36   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #83

Quote:
Originally Posted by Mooash View Post
I cannot get this to work for the life of me and I've looked through this entire thread to try and resolve the issue.
I'm no PHP wizard but it looks like you're printing out your variable names as string literals. Try this:
Code:
<?php
$player_name = $_GET['name'];
$server_name = $_GET['server_name'];
$steamid = $_GET['steamid'];
$map = $_GET['map'];
$admins = "Mooash, Dot and Gooaska";

printf("<html><head><title>%s</title></head>", $server_name);
printf("<body><h1>Hi %s, you're currently playing on %s</h1><p>Your current map is %s</p>", htmlspecialchars($player_name), $server_name, $map);
printf("<p>Play safe and don't abuse the admins who are %s<br/>PS: Your steam ID is %s and we use this to track or ban you so play nice.</p></body></html>", $admins, $steamid);
?>
Velsk is offline
Velsk
Member
Join Date: Sep 2011
Old 12-12-2011 , 13:07   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #84

Hey psychonic, I just upgraded to the new version and it looks like the plugin isn't displaying the dynamic motd when users type motd in chat in TF2. It's just displaying the url in motd.txt instead.
Velsk is offline
Mooash
Junior Member
Join Date: Dec 2011
Old 12-12-2011 , 21:20   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #85

Quote:
Originally Posted by Velsk View Post
I'm no PHP wizard but it looks like you're printing out your variable names as string literals. Try this:
Code:
<?php
$player_name = $_GET['name'];
$server_name = $_GET['server_name'];
$steamid = $_GET['steamid'];
$map = $_GET['map'];
$admins = "Mooash, Dot and Gooaska";

printf("<html><head><title>%s</title></head>", $server_name);
printf("<body><h1>Hi %s, you're currently playing on %s</h1><p>Your current map is %s</p>", htmlspecialchars($player_name), $server_name, $map);
printf("<p>Play safe and don't abuse the admins who are %s<br/>PS: Your steam ID is %s and we use this to track or ban you so play nice.</p></body></html>", $admins, $steamid);
?>

Hi Velsk, I tried replacing my MOTD with that but it didn't work either.

I think its something wrong server side since the variables are being replaced in the PHP script but aren't being replaced by vaiables by the MOTD script on the game server, like {NAME}, but are instead staying as {NAME} on the PHP script.

I hope that makes sense haha
Mooash is offline
Velsk
Member
Join Date: Sep 2011
Old 12-13-2011 , 07:18   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #86

I reread your original post and noticed you put the dynamic url in your motd.txt file. As far as I know, this plugin doesn't use the url in that file and only looks at the dynamicmotd_url parameter.

Does the dynamic motd work when you initially join the server?

As I mentioned a few posts up it seems there is a bug in the new version that doesn't catch players typing 'motd' in chat. The default srcds behavior of looking at the motd.txt file occurs in this case. This would cause the exact url you have in your motd.txt to be queried without replacing any of the variable placeholders, which would explain why you see the variable names on your php page.
Velsk is offline
Mooash
Junior Member
Join Date: Dec 2011
Old 12-13-2011 , 07:20   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #87

Ahhh I see.

No, the dynamic motd doesn't load when someone initially joins the server, nothing displays. And yeah you're right, when someone types motd into chat I don't get the dynamic motd.

So does that mean I don't have the plugin setup right server side?
Mooash is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-13-2011 , 07:21   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #88

Quote:
Originally Posted by Velsk View Post
I reread your original post and noticed you put the dynamic url in your motd.txt file. As far as I know, this plugin doesn't use the url in that file and only looks at the dynamicmotd_url parameter.
That is correct. The url in the motd.txt is sent to the client in the stringtable on join and cannot easily be modified per client. The dynamicmotd_url cvar should be used.

Quote:
Originally Posted by Velsk View Post
Does the dynamic motd work when you initially join the server?

As I mentioned a few posts up it seems there is a bug in the new version that doesn't catch players typing 'motd' in chat. The default srcds behavior of looking at the motd.txt file occurs in this case. This would cause the exact url you have in your motd.txt to be queried without replacing any of the variable placeholders, which would explain why you see the variable names on your php page.
It should work both on join and when doing !motd (or any other time the stock motd would normally be shown, rather than a custom url). The note about it not work with !motd was prior to the current version.
psychonic is offline
Velsk
Member
Join Date: Sep 2011
Old 12-13-2011 , 07:28   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #89

Quote:
Originally Posted by Mooash View Post
Ahhh I see.

No, the dynamic motd doesn't load when someone initially joins the server, nothing displays. And yeah you're right, when someone types motd into chat I don't get the dynamic motd.

So does that mean I don't have the plugin setup right server side?
I just joined your server and the dynamic motd loaded fine when I joined. Typing motd in chat doesn't work though.
Velsk is offline
Mooash
Junior Member
Join Date: Dec 2011
Old 12-13-2011 , 07:30   Re: Dynamic MOTD (updated 2011-11-27)
Reply With Quote #90

Quote:
Originally Posted by Velsk View Post
I just joined your server and the dynamic motd loaded fine when I joined. Typing motd in chat doesn't work though.
Yeah I saw you join just then, thats so weird. I can't get it to come up at all now. I just deleted motd.txt so that could've made a difference?
Mooash 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 18:31.


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