Exemple #1
0
  public static void Error(int code, String fmt, Vargs vargs) throws LongJmpException {
    // va_list argptr;
    // static char msg[MAXPRINTMSG];

    if (recursive) {
      Sys.Error("recursive error after: " + msg);
    }
    recursive = true;

    msg = sprintf(fmt, vargs);

    if (code == Constants.ERR_DISCONNECT) {
      Client.drop();
      recursive = false;
      throw new LongJmpException();
    } else if (code == Constants.ERR_DROP) {
      Com.Printf("********************\nERROR: " + msg + "\n********************\n");
      ServerMain.SV_Shutdown("Server crashed: " + msg + "\n", false);
      Client.drop();
      recursive = false;
      throw new LongJmpException();
    } else {
      ServerMain.SV_Shutdown("Server fatal crashed: %s" + msg + "\n", false);
      Client.shutdown();
    }

    Sys.Error(msg);
  }
Exemple #2
0
  public static void Quit() {
    ServerMain.SV_Shutdown("Server quit\n", false);
    Client.shutdown();

    if (Globals.logfile != null) {
      try {
        Globals.logfile.close();
      } catch (IOException e) {
      }
      Globals.logfile = null;
    }

    Sys.Quit();
  }