Ignore:
Timestamp:
01/19/12 02:02:16 (16 months ago)
Author:
literalka
Message:

idk if this works, but im starting to port a little bit of statsmeasure

Location:
trollforge/lastmeasure/server
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/server/lmkeywords.h

    r626 r627  
     1char const *titles[] = 
     2{ 
     3    "GNAA Last Measure Live!" 
     4}; 
    15 
    26char const *keywords[] = 
     
    271275    "ice warriors", "ice warriors club", "ice warriors of cp", "sieg heil", 
    272276    "nokenny", "caribbean islands", "caribbean airlines", "weretiger", 
    273     "not4chan", "no kenny", "jillian and ed till together", 
     277    "not4chan", "no kenny", "jillian and ed till together", "wingerdinger", 
    274278/* {{{ Nude Celebs */ 
    275279    "shakira nue", "rihanna nue", "vanessa demouy nue", "clara morgane nue", 
  • trollforge/lastmeasure/server/lmresource.h

    r626 r627  
    138138 
    139139    "  <head>\r\n" 
    140     "    <title>GNAA Last Measure Live!</title>\r\n" 
     140    "    <title>" << Title() << "</title>\r\n" 
    141141    "    <meta name=\"keywords\" content=\"" << Keywords(128) << "\" />\r\n" 
    142142    "    <meta name=\"description\" content=\"" << Keywords(20) << "\" />\r\n" 
     
    268268    } 
    269269 
     270    static std::string Title() 
     271    { 
     272        std::stringstream ret(""); 
     273 
     274        ret << titles[rand() % (sizeof(titles) / sizeof(*titles))]; 
     275 
     276        return ret.str(); 
     277    } 
     278 
    270279    static std::string Keywords(size_t count) 
    271280    { 
     
    322331 "    credits = \"LAST MEASURE UNIFIED X-2, by LiteralKa and sam.\\n\";\r\n" 
    323332 "    credits += \"Starring:\\n\";\r\n" 
    324  "    credits += \"Balloon Boy, Huge_Midget's \\"Pain Series\\", Kevin Klerck (spin.gif), Kirk Johnson,\\n\";\r\n" 
     333 "    credits += \"Balloon Boy, Huge_Midget's 'Pain Series', Kevin Klerck (spin.gif), Kirk Johnson,\\n\";\r\n" 
    325334 "    credits += \"Lemonparty, Loopback, Penisbird, Pillowfight, Rusty's Wife, The Harlequin Fetus,\\n\";\r\n" 
    326335 "    credits += \"The Shitfaced Lady, Tubgirl, and much, much more!\\n\";\r\n" 
    327336 "    credits += \"\\n\\n\";\r\n" 
    328  "    credits += \"Multiple \\"HEY EVERYBODY...\\" clips by abez, blackman, eska, fury, JesuitX, JiZZy,\\n\";\r\n" 
    329  "    credits += \"kirk, lolichan, \\"original\\", popeye, rkz, Rucas, sam, and trogg.\\n\";\r\n" 
     337 "    credits += \"Multiple 'HEY EVERYBODY...' clips by abez, blackman, eska, fury, JesuitX, JiZZy,\\n\";\r\n" 
     338 "    credits += \"kirk, lolichan, 'original', popeye, rkz, Rucas, sam, and trogg.\\n\";\r\n" 
    330339 "    credits += \"\\n\\n\";\r\n" 
    331340 "    credits += \"Pop-up blocker evasion technology by Armorfist, goat-see, and LiteralKa.\\n\";\r\n" 
  • trollforge/lastmeasure/server/lmutil.h

    r566 r627  
    1010#include <signal.h> /* raise() */ 
    1111#include <time.h> /* localtime_r() */ 
     12 
     13#include "md5.h" 
    1214 
    1315class Random 
     
    6466        raise(SIGTERM); 
    6567    } 
     68 
     69    /** 
     70     * Generate a unique key from the current time and an IP address. It starts 
     71     * with -time() so that newest hits are stored first in alphabetical order. 
     72     */ 
     73    static std::string GenKey(char const *host) 
     74    { 
     75        time_t t = time(NULL); 
     76        srand(t); 
     77 
     78        char buffer[16]; 
     79        char hosthash[37]; 
     80        char hash[37]; 
     81 
     82        sprintf(hosthash,"%s%d",host,rand()%32767); 
     83 
     84        md5((unsigned char*)hosthash,8,(unsigned char*)hash); 
     85 
     86        sprintf(buffer, "%08lx", (0xffffffff - t)); 
     87        strcat(buffer,hash); 
     88 
     89        return buffer; 
     90    } 
     91 
     92    /* Get back the date value from a key */ 
     93    static std::string KeyToDate(char const $key) 
     94    { 
     95        std::stringstream ret(""); 
     96        // return 0xffffffff - hexdec(substr($key, 0, 8)); 
     97        return ret.str(); 
     98    } 
     99 
    66100}; 
    67101 
Note: See TracChangeset for help on using the changeset viewer.