AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Dynamic MOTD 3.0 (https://forums.alliedmods.net/showthread.php?t=147193)

psychonic 01-06-2011 10:31

Dynamic MOTD 3.0
 
2 Attachment(s)
Dynamic MOTD

As noted in the description, this plugin allows sending of player/server info via GET vars to the MOTD url for easy customization of MOTD per player/server.

It will replace the MOTD already sent by the game via usermessage with a new one.


Cvars:
  • dynamicmotd_url - Url to use, including info tokens. "" for default.
  • dynamicmotd_title - Title to use for motd window (on supported games), including info tokens. "" for default.
  • dynamicmotd_big - If enabled, uses a larger MOTD window on supported games. 0 - Disabled (default), 1 - Enabled. If this is enabled, MOTD is delayed until first team selection.
  • dynamicmotd_custom - The value here will be used when replacing the {SERVER_CUSTOM} token.

Info Tokens:
  • {STEAM_ID} (in same format shown on "status" command for the game)
  • {USER_ID}
  • {FRIEND_ID} ('community id', a.k.a. 64-bit steam id)
  • {NAME}
  • {IP}
  • {LANGUAGE} (value of client's cl_language var)
  • {RATE} (value of client's rate var)
  • {SERVER_IP}
  • {SERVER_PORT}
  • {SERVER_NAME} (server hostname)
  • {SERVER_CUSTOM} (value of dynamicmotd_custom)
  • {L4D_GAMEMODE} (current game mode string on l4d and l4d2)
  • {CURRENT_MAP}
  • {NEXT_MAP}
  • {GAMEDIR}
  • {CURPLAYERS}
  • {MAXPLAYERS}
  • {BOTPLAYERS}
  • {STEAM2_ID} (explicit Steam2 format, ex. STEAM_0:1:4153990 or STEAM_1:1:4153990)
  • {STEAM3_ID} (explicit Steam3 format, ex. [U:1:8307981])
  • {STEAM_ACCTID} (Steam account id, ex. 8307981)
  • {SERVER_STEAM_ID} (server 64-bit Steam ID)
  • {SERVER_STEAM3_ID} (server Steam3-formatted id, ex. [A:1:3293500416:8019] or [G:1:123])
  • {SERVER_STEAM_ACCT_ID} (server Steam account id)

And for those with SteamWorks or SteamTools installed:
  • {VAC_STATUS} (0/1)
  • {SERVER_PUB_IP} (the server's public ip)
  • {STEAM_CONNSTATUS} (0/1)

Example Url: http://example.com/motd.php?communityid={FRIEND_ID}&name={NAME}

I've only personally tested this on TF2 and CS:S, but it should work on all games that support a regular MOTD.

Note: Due to limitations in the engine, the expanded url has a max length of 255 characters.

The Get Plugin link will not work due to the SteamWorks and SteamTools includes being required at compile-time.

Monkeys 01-06-2011 10:43

Re: Dynamic MOTD
 
This is quite awesome, and it isn't hard to add even more substitutes. :up:

psychonic 01-06-2011 11:18

Re: Dynamic MOTD
 
Quote:

Originally Posted by Monkeys (Post 1387393)
This is quite awesome, and it isn't hard to add even more substitutes. :up:

If you have any suggestions for more, I'd be happy to hear them.

Leonardo 01-06-2011 11:35

Re: Dynamic MOTD
 
finally can show in motd user-specific information.

psychonic 01-06-2011 21:05

Re: Dynamic MOTD
 
Uploaded version 1.1.0 which adds more shiz to ensure compatibility with more games as well as proper url encoding of the vars.

Ex.
Code:

http://example.com/test.php?name={NAME}&steam={STEAM_ID}
with name "[SMACK] BP{N}" and steamid "STEAM_0:1:4153990"
becomes
Code:

http://example.com/test.php?name=%5bSMACK%5d%20%20BP%7bN%7d&steam=STEAM_0%3a1%3a4153990
to guarantee proper interpretation by the web server.

Also added {SERVER_NAME} token to resolve to current server hostname.

Samantha 01-06-2011 21:11

Re: Dynamic MOTD
 
Very useful

psychonic 01-06-2011 22:04

Re: Dynamic MOTD
 
Yet another minor update, 1.1.1, adding more functionality.

New {SERVER_CUSTOM} tag will resolve to whatever the new cvar, dynamicmotd_custom, is set to.

This is useful for people who number their servers. (1, 2, 3, etc.)

Munra 01-07-2011 11:43

Re: Dynamic MOTD
 
Can I get

UR Bad ass

Thraka 01-07-2011 14:20

Re: Dynamic MOTD
 
Very awesome!

This little snippet will add the l4d game mode as a parameter. Just insert it into the DoReplacements method

Code:

        new Handle:cvarHGameMode = FindConVar("mp_gamemode");
        if (cvarHGameMode != INVALID_HANDLE)
        {
                decl String:gameMode[16];
                GetConVarString(cvarHGameMode, gameMode, sizeof(gameMode));
                ReplaceString(motdtitle, sizeof(motdtitle), "{L4D_GAMEMODE}", gameMode);
                ReplaceString(motdurl, sizeof(motdurl), "{L4D_GAMEMODE}", gameMode);
        }

Now you can easily determine for your web page if the game is versus, coop, etc..

psychonic 01-07-2011 14:25

Re: Dynamic MOTD
 
Quote:

Originally Posted by Thraka (Post 1388230)
Very awesome!

This little snippet will add the l4d game mode as a parameter. Just insert it into the DoReplacements method

Code:

        new Handle:cvarHGameMode = FindConVar("mp_gamemode");
        if (cvarHGameMode != INVALID_HANDLE)
        {
                decl String:gameMode[16];
                GetConVarString(cvarHGameMode, gameMode, sizeof(gameMode));
                ReplaceString(motdtitle, sizeof(motdtitle), "{L4D_GAMEMODE}", gameMode);
                ReplaceString(motdurl, sizeof(motdurl), "{L4D_GAMEMODE}", gameMode);
        }

Now you can easily determine for your web page if the game is versus, coop, etc..

Is this for L4D, L4D2, or both? I know that (at least at one point) setting game mode was different for each, but can mp_gamemode be read to get it on both?


All times are GMT -4. The time now is 03:56.

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