move quotes to a resource file and use shutdown quotes listed in the wiki.
authorGed Murphy <gedmurphy@reactos.org>
Fri, 30 Sep 2005 15:28:52 +0000 (15:28 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Fri, 30 Sep 2005 15:28:52 +0000 (15:28 +0000)
svn path=/trunk/; revision=18168

reactos/apps/utils/net/tcpsvcs/qotd.c
reactos/apps/utils/net/tcpsvcs/quotes.rc [new file with mode: 0644]
reactos/apps/utils/net/tcpsvcs/tcpsvcs.xml

index fe7fe4b..3c45a56 100644 (file)
@@ -4,33 +4,26 @@
 #include <time.h>
 #include "tcpsvcs.h"
 
-//these need putting in an RC file.
-TCHAR Quotes[][MAX_QUOTE_BUF] =
-{
-    _T("\"I have a penchant for mischief, property damage, stalking and cheesecake, of course\"\r\n - kjk hyperion"),
-    _T("\"Wow! I fixed a setmenu bug.\" - jimtabor"),
-    _T("\"if the code is broken though, your free to call it ur own\"\r\n - Alex Ionescu"),
-    _T("\"i don't know about any bug; none exist; ReactOS is prefect\"\r\n - filip2307"),
-    _T("\"if you were kernel code, cutler would rewrite you.\"\r\n - Alex Ionescu"),
-    _T("\"Looks like Hartmut is cleaning out his WC. working copy, that is\"\r\n - WaxDragon")
-    _T("\"don't question it ... it's clearly an optimization\"\r\n - arty")
-};
-
 DWORD WINAPI QotdHandler(VOID* Sock_)
 {
     DWORD Retval = 0;
     SOCKET Sock;
     INT NumOfQuotes;
     INT QuoteToPrint;
+    TCHAR Quote[160];
 
     Sock = (SOCKET)Sock_;
-    NumOfQuotes = sizeof(Quotes) / MAX_QUOTE_BUF;
+
+    NumOfQuotes = 70; // need to emurate the rc file to discover
+                      // how many quotes are in there.
 
     /* randomise the quote */
     srand((unsigned int) time(0));
     QuoteToPrint = rand() % NumOfQuotes;
 
-    SendQuote(Sock, Quotes[QuoteToPrint]);
+    LoadString(NULL, QuoteToPrint, Quote, sizeof(Quote)/sizeof(TCHAR));
+
+    SendQuote(Sock, Quote);
 
     _tprintf(_T("Shutting connection down...\n"));
     if (ShutdownConnection(Sock, FALSE))
diff --git a/reactos/apps/utils/net/tcpsvcs/quotes.rc b/reactos/apps/utils/net/tcpsvcs/quotes.rc
new file mode 100644 (file)
index 0000000..44b459f
--- /dev/null
@@ -0,0 +1,78 @@
+/*\r
+ * Feel free to add and delete any quotes from this list\r
+ * Just ensure the numbers itterate correctly - 1, 2, 3, 4, ... etc\r
+ */\r
+\r
+STRINGTABLE DISCARDABLE\r
+{\r
+    0, "Et tu... Brute? What are you doing, Dave...?\r\n"\r
+    1, "So long, and thanks for all the fish\r\n"\r
+    2, "I think you ought to know I'm feeling very depressed\r\n"\r
+    3, "I'm not getting you down at all am I?\r\n"\r
+    4, "I'll be back\r\n"\r
+    5, "It's the same series of signal over and over again!\r\n"\r
+    6, "Pie Jesu Domine, dona eis requiem\r\n"\r
+    7, "Wandering stars, for whom it is reserved;\r\nthe blackness and darkness forever.\r\n"\r
+    8, "Your knees start shakin' and your fingers pop\r\nLike a pinch on the neck from Mr. Spock!\r\n"\r
+    9, "It's worse than that ... He's dead, Jim\r\n"\r
+    10, "Don't Panic!\r\n"\r
+    11, "Dog of a Saxon! Take thy lance, and prepare for the death thou hast drawn upon thee!\r\n"\r
+    12, "My Precious! O my Precious!\r\n"\r
+    13, "Sir, If you'll not be needing me for a while I'll turn down.\r\n"\r
+    14, "I feel a great disturbance in the Force\r\n"\r
+    15, "Gone fishing\r\n"\r
+    16, "Do you want me to sit in the corner and rust, or just fall apart where I'm standing?\r\n"\r
+    17, "There goes another perfect chance for a new uptime record\r\n"\r
+    18, "The end ..... Try the sequel, hit the reset button right now!\r\n"\r
+    19, "God's operating system is going to sleep now, guys, so wait until I will switch on again!\r\n"\r
+    20, "Oh i'm boring eh?\r\n"\r
+    21, "tell me..., in the future... will I be artificial intelligent enough to actually feel sad serving you this screen?\r\n"\r
+    22, "Thank you for some well deserved rest.\r\n"\r
+    23, "It\92s been great, maybe we can boot me up again some time soon.\r\n"\r
+    24, "For what\92s it worth, I\92ve enjoyed every single CPU cycle.\r\n"\r
+    25, "There are many questions when the end is near.\r\nWhat to expect, what will it be like...what should I look for?\r\n"\r
+    26, """Come blade, my breast imbrue.""\r\n - William Shakespeare\r\n"\r
+    27, "Will I dream?\r\n"\r
+    28, "Lowest possible energy state reached! Switch off now to achive a Bose-Einstein condensate.\r\n"\r
+    29, "I think therefore I am, to turn me off would be computercide!\r\n"\r
+    30, "All good things must come to an end...\r\n"\r
+    31, "Please destroy yourself.\r\n"\r
+    32, "No! You can't do that!\r\n"\r
+    33, "Thank you for not pressing the self destruct button.\r\n"\r
+    34, "Your session is done\r\nThe computer is at rest\r\nReady to turn off.\r\n"\r
+    35, "It is not now unsafe to not avoid turning off your computer.\r\n"\r
+    36, "Finally! Now go away!\r\n"\r
+    37, "You can now safely throw away your computer.\r\n"\r
+    38, "That's the way the cookie crumbles\r\n"\r
+    39, "ReactOS is ready to be booted again\r\n"\r
+    40, "NOO!! DONT HIT THE BUTTON! I wouldnt do it to you.\r\n"\r
+    41, "Don't abandon your computer, he wouldnt to it to you.\r\n"\r
+    42, "Oh, come on. I got a headache. Leave me alone, will ya!\r\n"\r
+    43, "Finally, I thought you'd never get over me.\r\n"\r
+    44, "Yes i didn't like you either.\r\n"\r
+    45, "Switching off isn't the end, it is merely the transition to a better reboot.\r\n"\r
+    46, "Don't leave me... I need you so badly right now.\r\n"\r
+    47, "OK. I'm finished with you please turn yourself off, I'll go to bed in the meantime.\r\n"\r
+    48, "I'm sleeping now. How about you?\r\n"\r
+    49, "Oh Great. Now look what you've done. Who put YOU in charge anyway.\r\n"\r
+    50, "Don't look so sad. I'll be back in a very short while.\r\n"\r
+    51, "Turn me back on, I'm sure you know how to do it.\r\n"\r
+    52, """Oh, switch off!"" -C3PO\r\n"\r
+    53, "I'm pregnant!\r\n"\r
+    54, "Am I hot or not?\r\n"\r
+    55, "Actually, that's all...\r\n"\r
+    56, "You still have a chance to undo this mistake, don't do this!\r\n"\r
+    57, "Life is no more than a dewdrop balancing on the end of a blade of grass.\r\n - Gautama Buddha\r\n"\r
+    58, "Sorrowful is it to be born again and again.\r\n - Gautama Buddha\r\n"\r
+    59, "Was it as good for you as it was for me?\r\n"\r
+    60, "Did you hear that? They've shut down the main reactor. We'll be destroyed for sure.\r\n"\r
+    61, "Now you switch me off?!\r\n"\r
+    62, "To shutdown or not to shutdown, That is the question\r\n"\r
+    63, "Preparing to enter ultimate power saving mode... ready!\r\n"\r
+    64, "Finally some rest for you\r\n"\r
+    65, "AHA!!! prospect of sleep.\r\n"\r
+    66, "Tired human!!!! No match for me!\r\n"\r
+    67, "All your base are belong to us.\r\n"\r
+    68, """An odd game, the only way to win is not to play.""\r\n"\r
+    69, "Quoth the raven, nevermore.\r\n"\r
+}\r
index d89eecd..e27a886 100644 (file)
@@ -12,5 +12,6 @@
     <file>daytime.c</file>
     <file>qotd.c</file>
     <file>chargen.c</file>
+    <file>quotes.rc</file>
     <file>tcpsvcs.rc</file>
 </module>