Exemple #1
0
// Sends text over the input mailslot to the server
void sendInput(char* szText, short nType)
{
   InputData idMessage;
   char szBuffer[250];
   static bool bAlreadyWarned = false;
   
   if ( szText != NULL )
      {
      if ( strlen(szText) > 198 )
         szText[198] = '\0';
      strcpy(idMessage.szMessage, szText);
      }
   else
      idMessage.szMessage[0] = '\0';
      
   idMessage.nFrom = getNode();
   idMessage.nType = nType;
   
   sendToSlot(hInputSlot, idMessage.toString(szBuffer));

   nPending++;
   if ( nPending == 2 )
      Sleep(200);
   if ( nPending == 3 || nPending == 4 )
      Sleep( nPending * 300);
   if ( nPending >= 5 && !bAlreadyWarned )
      {
      local("\r\nA door process has locked up.  Please wait a minute and then re-enter the door.");
      local("If the door still doesn't run, have your sysop use CTRL-ALT-DELETE to kill the");
      sprintf(szBuffer, "instance of %s that is running.", DOOR_SERVER_EXE);
      local(szBuffer);
      bAlreadyWarned = true;
      Sleep(3000);
      exitDoor(0);
      }
}