示例#1
0
bool WorldSession::ClusterTryPlayerLogin(uint32 Guid, uint32 ClientBuild, string GMPermissions, uint32 Account_Flags)
{
	DEBUG_LOG( "WorldSession"," Recvd Player Logon Message" );

	if(objmgr.GetPlayer(Guid) != NULL || m_loggingInPlayer || _player)
	{
		// A character with that name already exists 0x3E
		uint8 respons = 0x3E;
		OutPacket(SMSG_CHARACTER_LOGIN_FAILED, 1, &respons);
		return false;
	}

	Player* plr = new Player(Guid);
	ASSERT(plr);
	plr->Init();

	permissioncount = 0;//just to make sure it's 0
	SetClientBuild(ClientBuild);
	LoadSecurity(GMPermissions);
	SetAccountFlags(Account_Flags);

	plr->SetSession(this);
	m_bIsWLevelSet = false;

	DEBUG_LOG("WorldSession", "Async loading player %u", Guid);
	m_loggingInPlayer = plr;
	plr->LoadFromDB(Guid);
	return true;
}
示例#2
0
void WorldSession::SetSecurity(std::string securitystring)
{
	delete [] permissions;
	LoadSecurity(securitystring);

	// update db
	CharacterDatabase.Execute("UPDATE accounts SET gm=\"%s\" WHERE acct=%u", CharacterDatabase.EscapeString(string(permissions)).c_str(), _accountId);
}
示例#3
0
void WorldSession::SetSecurity(std::string securitystring)
{
    delete [] permissions;
    LoadSecurity(securitystring);

    // update db
    sDatabase.Execute("UPDATE accounts SET gm=\"%s\" WHERE acct=%u", permissions, _accountId);
}
示例#4
0
void WorldSession::SetSecurity(std::string securitystring)
{
    delete[]permissions;
    LoadSecurity(securitystring);
}
示例#5
0
文件: dcp.c 项目: swhobbit/UUPC
int dcpmain(int argc, char *argv[])
{

   char *logfile_name = NULL;
   KWBoolean  contacted = KWFalse;

   int option;
   int pollMode = POLL_ACTIVE;   /* Default = dial out to system     */
   time_t exitTime = LONG_MAX;

   char recvGrade = ALL_GRADES;
   KWBoolean overrideGrade = KWFalse;
   KWBoolean runUUXQT = KWFalse;

   char *hotUser = NULL;
   BPS  hotBPS = 0;
   int  hotHandle = -1;

   fwork = nil(FILE);

/*--------------------------------------------------------------------*/
/*                        Process our options                         */
/*--------------------------------------------------------------------*/

   while ((option = getopt(argc, argv, "d:g:h:m:l:r:s:tUw:x:z:n?")) != EOF)
      switch (option)
      {

      case 'd':
         exitTime = atoi( optarg );
         exitTime = time(NULL) + hhmm2sec(exitTime);
         pollMode = POLL_PASSIVE;  /* Implies passive polling       */
         break;

      case 'g':
         if (strlen(optarg) == 1 )
            recvGrade = *optarg;
         else {
            recvGrade = checktime( optarg );
                                 /* Get restriction for this hour */
            if ( ! recvGrade )   /* If no class, use the default  */
               recvGrade = ALL_GRADES;
         }
         overrideGrade = KWTrue;
         break;

      case 'h':
         hotHandle = atoi( optarg );   /* Handle opened for us       */
         pollMode = POLL_PASSIVE;  /* Implies passive polling       */
         break;

      case 'm':                     /* Override in modem name     */
         E_inmodem = optarg;
         pollMode = POLL_PASSIVE;  /* Implies passive polling       */
         break;

      case 'l':                     /* Log file name              */
         logfile_name = optarg;
         break;

      case 'n':
         callnow = KWTrue;
         break;

      case 'r':
         pollMode = atoi(optarg);
         break;

      case 's':
         Rmtname = optarg;
         break;

      case 't':
         traceEnabled = KWTrue;
         break;

      case 'U':
         runUUXQT = KWTrue;
         break;

      case 'x':
         debuglevel = atoi(optarg);
         break;

      case 'z':
         hotBPS = (BPS) atoi(optarg);
         pollMode = POLL_PASSIVE;  /* Implies passive polling       */
         break;

      case 'w':
         pollMode = POLL_PASSIVE;  /* Implies passive polling       */
         hotUser = optarg;
         break;

      case '?':
         puts("\nUsage:\tuucico\t"
         "[-s [all | any | sys]] [-r 1|0] [-d hhmm]\n"
         "\t\t[-l logfile] [-n] [-t] [-U] [-x debug]\n"
         "\t\t[-h handle] [-m modem] [-z bps]");
         return 4;
      }

/*--------------------------------------------------------------------*/
/*                Abort if any options were left over                 */
/*--------------------------------------------------------------------*/

   if (optind != argc) {
      puts("Extra parameter(s) at end.");
      return 4;
   }

/*--------------------------------------------------------------------*/
/*        Initialize logging and the name of the systems file         */
/*--------------------------------------------------------------------*/

   openlog( logfile_name );

   if (bflag[F_SYSLOG] && ! bflag[F_MULTITASK])
   {
      syslog = FOPEN(SYSLOG, "a",TEXT_MODE);
      if ((syslog == nil(FILE)) || setvbuf( syslog, NULL, _IONBF, 0))
      {
         printerr( SYSLOG );
         panic();
      }
   }

   PushDir(E_spooldir);
   atexit( PopDir );

   if ( terminate_processing )
      return 100;

/*--------------------------------------------------------------------*/
/*                        Initialize security                         */
/*--------------------------------------------------------------------*/

   if ( !LoadSecurity())
   {
      printmsg(0,"Unable to initialize security, see previous message");
      panic();
   }

   if ( terminate_processing )
      return 100;

#if defined(_Windows)
   atexit(CloseEasyWin);       /* Auto-close EasyWin window on exit   */
#endif

   atexit( shutDown );        /* Insure port is closed by panic()    */
   remote_stats.hstatus = HS_NOCALL;
                              /* Known state for automatic status
                                 update                              */

/*--------------------------------------------------------------------*/
/*                     Begin main processing loop                     */
/*--------------------------------------------------------------------*/

   if (pollMode == POLL_ACTIVE)
      contacted = master(recvGrade, overrideGrade, runUUXQT );
   else if (pollMode == POLL_PASSIVE)
      contacted = client(exitTime,
                         hotUser,
                         hotBPS,
                         hotHandle,
                         runUUXQT);
   else {
      printmsg(0,"Invalid -r flag, must be 0 or 1");
      panic();
   }

/*--------------------------------------------------------------------*/
/*                         Report our results                         */
/*--------------------------------------------------------------------*/

   if (!contacted && (pollMode == POLL_ACTIVE))
   {
      if (dialed)
         printmsg(0, "Could not connect to remote system.");
      else
         printmsg(0,
               "No work for requested system or wrong time to call.");
   }

   dcupdate();

   if (bflag[F_SYSLOG] && ! bflag[F_MULTITASK])
      fclose(syslog);

   return terminate_processing ? 100 : (contacted ? 0 : 5);

} /* dcpmain */