本文整理汇总了C++中NetConnection::SaveInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ NetConnection::SaveInfo方法的具体用法?C++ NetConnection::SaveInfo怎么用?C++ NetConnection::SaveInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetConnection
的用法示例。
在下文中一共展示了NetConnection::SaveInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
#ifdef WIN32
#ifdef WIN32_WORLD_SERVERONLY
if(!EQC::Common::IsRunningOnWindowsServer())
{
cout << "EQC Zone Server requires to be running on a Server Platform." << endl;
exit(0);
}
#endif
#endif
#ifdef _DEBUG
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
if (argc != 5)
{
cerr << "Usage: zone zone_name address port worldaddress" << endl;
exit(0);
}
char* zone_name = argv[1];
char* address = argv[2];
int32 port = atoi(argv[3]);
char* worldaddress = argv[4];
if (strlen(address) <= 0)
{
cerr << "Invalid address" << endl;
exit(0);
}
if (port <= 0)
{
cerr << "Bad port specified" << endl;
exit(0);
}
if (strlen(worldaddress) <= 0)
{
cerr << "Invalid worldaddress" << endl;
exit(0);
}
if (signal(SIGINT, CatchSignal) == SIG_ERR)
{
cerr << "Could not set signal handler" << endl;
return 0;
}
net.SaveInfo(address, port, worldaddress);
#ifdef EQC_SHAREDMEMORY
// -Cofruben: Load Shared Memory
EQC::Common::PrintF(CP_SHAREDMEMORY, "Loading Shared Memory Core...");
SharedMemory::Load();
EQC::Common::PrintF(CP_GENERIC, "Done.\n");
#else
EQC::Common::PrintF(CP_ZONESERVER, "Loading items...\n");
Database::Instance()->LoadItems();
#endif
EQC::Common::PrintF(CP_SPELL, "Loading SP DAT...\n");
spells_handler.LoadSpells(SPDat_Location);
EQC::Common::PrintF(CP_ZONESERVER, "Loading guild and guild ranks...\n");
zgm.LoadGuilds();
EQC::Common::PrintF(CP_ZONESERVER, "Loading faction data...\n");
Database::Instance()->LoadFactionData();
EQC::Common::PrintF(CP_ZONESERVER, "Loading faction lists...\n");
Database::Instance()->LoadNPCFactionLists();
EQC::Common::PrintF(CP_ZONESERVER, "Loading Corpse decay Timers...\n");
Database::Instance()->GetDecayTimes(npcCorpseDecayTimes);
if (!worldserver.Init()) {
cerr << "InitWorldServer failed" << endl;
}
//Yeahlight: Static zone support
if(strcmp(zone_name, ".") == 0)
{
EQC::Common::PrintF(CP_ZONESERVER, "Entering sleep mode.\n");
}
else if(!Zone::Bootup(zone_name))
{
EQC::Common::PrintF(CP_ZONESERVER, "%s boot FAILED!\n", zone_name);
}
else
{
EQC::Common::PrintF(CP_ZONESERVER, "%s boot was successful.\n", zone_name);
}
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
net.StartProcessLoop();
MNetLoop.lock();
while(RunLoops)
{
Timer::SetCurrentTime();
//.........这里部分代码省略.........
示例2: main
int main(int argc, char** argv) {
#ifdef _DEBUG
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
// _crtBreakAlloc = 2025;
#endif
srand(time(NULL));
for (int logs = 0; logs < EQEMuLog::MaxLogID; logs++) {
LogFile->write((EQEMuLog::LogIDs)logs, "CURRENT_ZONE_VERSION: %s", CURRENT_ZONE_VERSION);
}
if (argc != 5)
{
cerr << "Usage: zone zone_name address port worldaddress" << endl;
exit(0);
}
char* filename = argv[0];
char* zone_name = argv[1];
char* address = argv[2];
int32 port = atoi(argv[3]);
char* worldaddress = argv[4];
if (strlen(address) <= 0) {
cerr << "Invalid address" << endl;
exit(0);
}
if (port <= 0) {
cerr << "Bad port specified" << endl;
exit(0);
}
if (strlen(worldaddress) <= 0) {
cerr << "Invalid worldaddress" << endl;
exit(0);
}
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
cerr << "Could not set signal handler" << endl;
return 0;
}
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
cerr << "Could not set signal handler" << endl;
return 0;
}
#endif
net.SaveInfo(address, port, worldaddress,filename);
LogFile->write(EQEMuLog::Status, "Loading Variables");
database.LoadVariables();
LogFile->write(EQEMuLog::Status, "Loading zone names");
database.LoadZoneNames();
LogFile->write(EQEMuLog::Status, "Loading items");
if (!database.LoadItems()) {
LogFile->write(EQEMuLog::Error, "Loading items FAILED!");
cout << "Failed. But ignoring error and going on..." << endl;
}
LogFile->write(EQEMuLog::Status, "Loading npcs");
if (!database.LoadNPCTypes()) {
LogFile->write(EQEMuLog::Error, "Loading npcs FAILED!");
CheckEQEMuErrorAndPause();
return 0;
}
#ifdef SHAREMEM
LogFile->write(EQEMuLog::Status, "Loading npc faction lists");
if (!database.LoadNPCFactionLists()) {
LogFile->write(EQEMuLog::Error, "Loading npcs faction lists FAILED!");
CheckEQEMuErrorAndPause();
return 0;
}
#endif
LogFile->write(EQEMuLog::Status, "Loading loot tables");
if (!database.LoadLoot()) {
LogFile->write(EQEMuLog::Error, "Loading loot FAILED!");
CheckEQEMuErrorAndPause();
return 0;
}
#ifdef SHAREMEM
LogFile->write(EQEMuLog::Status, "Loading doors");
database.LoadDoors();
#endif
LoadSPDat();
#ifdef GUILDWARS
LogFile->write(EQEMuLog::Status, "Loading guild alliances");
//database.LoadGuildAlliances();
#endif
// New Load function. keeping it commented till I figure out why its not working correctly in linux. Trump.
// NewLoadSPDat();
LogFile->write(EQEMuLog::Status, "Loading guilds");
database.LoadGuilds(guilds);
LogFile->write(EQEMuLog::Status, "Loading factions");
database.LoadFactionData();
LogFile->write(EQEMuLog::Status, "Loading corpse timers");
database.GetDecayTimes(npcCorpseDecayTimes);
LogFile->write(EQEMuLog::Status, "Loading what ever is left");
database.ExtraOptions();
AutoDelete<Parser> ADparse(&parse, new Parser);
#ifdef ADDONCMD
LogFile->write(EQEMuLog::Status, "Looding addon commands from dll");
//.........这里部分代码省略.........