Announcement

Collapse
No announcement yet.

motd.txt and host.txt for Left 4 Dead 2 Game Server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • motd.txt and host.txt for Left 4 Dead 2 Game Server

    If your host or motd files need updating for L4D2 servers because they are broken, you've certainly come to the right place. Do allow me to inform you that there may be actually nothing wrong with your files, but an issue with the game engine itself. Several years ago, the world wide web made it required that all websites be encrypted with SSL (https URL) so they do not display errors across all web browsers. This has caused the Valve MOTD and web browser windows to go a bit haywire. The simple fix would be to make sure that the domain (or preferably sub domain) you are hosting the files on is not secured by SSL.

    Click image for larger version

Name:	Screenshot (560).png
Views:	7
Size:	874.1 KB
ID:	247




    This may not apply for all games, but certainly applies for most Source/Orangebox games, including but not limited to Left 4 Dead and Left 4 Dead 2.
    Personally, if you're running game servers and need web hosting, I highly recommend NFOServers.com. They're truly the best in the business when it comes to game servers, and practically the last man standing when it comes to standalone Game Servers for individuals, clans and communities. They offer unbeatable performance at phenomenal prices. If you have a game server with them, your web hosting is free. Otherwise for a basic web hosting package, it's a mere $2.99 per month.

    If you have web hosting through NFOServers, the easiest way to do this is to uncheck the box on your Domains page in Control Panel that says "Redirect http to https for this vhost". As you may tell, I have this set to be a separate folder in the main folder of the hosting account with an applicable subdomain. For me, that ends up being ussl.playocl.com. It is accessible by both https and http, but in this instance, http is allowed. In all other cases, https is forced. See below:


    Click image for larger version

Name:	https.png
Views:	8
Size:	49.5 KB
ID:	246





    The folder should be something totally different from your main folder.

    As for the MOTD and Host files themselves, my end result is this:

    Host image (690x90)
    https://ussl.playocl.com/host.png

    HTML file for host image:

    Host.txt Contents:
    http://ussl.playocl.com/host.html



    ​

    HTML code for your use below. You may want to tinker with the settings to get it just right to fit for all screen sizes, but the general rule of thumb is to keep the dimensions between 400px by 52px through 690px by 90px. Remember that it may squish, and it may stretch for some resolutions. The below code causes it to be responsive across all screens:
    HTML Code:
    <html>
    <head><title>OverclockedLAN L4D2 host.txt Server Banner</title>
    <style>
    .responsiveimg {
      width: 100%;
      max-width: 400px;
      max-height: 52px;
    }
    </style>
    </head>
    
    <body style="margin:0px;padding:1px;background:#000000;">
    <center>
    <img src="http://ussl.playocl.com/host.png" class="responsiveimg" />
    </center>
    </body>
    
    </html>
    \
    ​



    Similar applies to the MOTD file. The motd.txt should ideally relate to an .html file so that you are not constantly going back and forth in the game to verify if it works or if it breaks. The engine will do the best it can to display the .html page, but if all the coding is within the motd.txt file itself, it is liable to break or go haywire.

    MOTD (motd.txt file) Contents:
    Welcome to OverclockedLAN. Home of high performance game servers for DAB, CSS, KF/KF2 and more. FPS Boosted Servers with 100% 24/7 Uptime. Connect today.

    That's all that should be in your motd.txt - a URL to a non-SSL (http) html file.

    Below is the code that I have in the html file that you are welcome to tinker with. You will certainly want to, but this is a great start, and gives you plenty available to modify to your liking (or add more!) I have redacted our information, but left you with information on what to do:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>XXXXXX</title>
    <!-- Required -->
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1; charset=UTF-8;" />
    <meta charset="UTF-8">
    <!-- The below not required, but necessary for search results -->
    <meta name="description" content="XXXXXX" />
    <meta name="keywords" content="XXXXXX,YYYYYY,ZZZZZZ" />
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
    <!-- Modify these color codes to your liking, if necessary -->
    <style>
    a:link {
      color: #006699;
      background-color: transparent;
      text-decoration: none;
    }
    
    a:visited {
      color: #006699;
      background-color: transparent;
      text-decoration: none;
    }
    
    a:hover {
      color: cyan;
      background-color: transparent;
      text-decoration: underline;
    }
    
    a:active {
      color: #006699;
      background-color: transparent;
      text-decoration: underline;
    }
    body {
      background-color: #090909;
      color: white;
      font-family: Tahoma;
    }
    </style>
    </head>
    <body>
    <!-- The Content of your MOTD window goes between the center tags below. -->
    <!-- You may remove the center tags or alter it to your liking. -->
    <center>XXXXXX</center>
    </body>
    </html>​



    ​If you're editing HTML or other web based files on Windows, I highly recommend Notepad++. It formats everything in an easy to understand way so that you know your coding is valid before you save and submit it.


    Easier said than done for some, but if you followed these steps correctly, everything should be working just fine.
    If you need further assistance you are more than welcome to submit any questions or comments


    Attached Files

Contributions

Collapse

Working...
X