本文整理汇总了C++中GroupLFPList::Process方法的典型用法代码示例。如果您正苦于以下问题:C++ GroupLFPList::Process方法的具体用法?C++ GroupLFPList::Process怎么用?C++ GroupLFPList::Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupLFPList
的用法示例。
在下文中一共展示了GroupLFPList::Process方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
//a.PutItem(2,d);
//_log(WORLD__INIT,"%s\n",Client62::SerializeItem(&a,30,0));
//register all the patches we have avaliable with the stream identifier.
EQStreamIdentifier stream_identifier;
RegisterAllPatches(stream_identifier);
zoneserver_list.shutdowntimer=new Timer(60000);
zoneserver_list.shutdowntimer->Disable();
zoneserver_list.reminder = new Timer(20000);
zoneserver_list.reminder->Disable();
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
InterserverTimer.Trigger();
EQStream* eqs;
EmuTCPConnection* tcpc;
EQStreamInterface *eqsi;
while(RunLoops) {
Timer::SetCurrentTime();
//check the factory for any new incoming streams.
while ((eqs = eqsf.Pop())) {
//pull the stream out of the factory and give it to the stream identifier
//which will figure out what patch they are running, and set up the dynamic
//structures and opcodes for that patch.
struct in_addr in;
in.s_addr = eqs->GetRemoteIP();
_log(WORLD__CLIENT, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
stream_identifier.AddStream(eqs); //takes the stream
}
//give the stream identifier a chance to do its work....
stream_identifier.Process();
//check the stream identifier for any now-identified streams
while((eqsi = stream_identifier.PopIdentified())) {
//now that we know what patch they are running, start up their client object
struct in_addr in;
in.s_addr = eqsi->GetRemoteIP();
if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs.
_log(WORLD__CLIENT, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table.
_log(WORLD__CLIENT, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
Client* client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
} else {
_log(WORLD__CLIENT, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream.
}
}
if (!RuleB(World, UseBannedIPsTable)){
_log(WORLD__CLIENT, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
Client* client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
}
}
client_list.Process();
while ((tcpc = tcps.NewQueuePop())) {
struct in_addr in;
in.s_addr = tcpc->GetrIP();
_log(WORLD__ZONE, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort());
示例2: main
//.........这里部分代码省略.........
_log(WORLD__INIT_ERR,"Failed to start client (UDP) listener (port 9000)");
return 1;
}
//register all the patches we have avaliable with the stream identifier.
EQStreamIdentifier stream_identifier;
RegisterAllPatches(stream_identifier);
zoneserver_list.shutdowntimer = new Timer(60000);
zoneserver_list.shutdowntimer->Disable();
zoneserver_list.reminder = new Timer(20000);
zoneserver_list.reminder->Disable();
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
InterserverTimer.Trigger();
uint8 ReconnectCounter = 100;
EQStream* eqs;
EmuTCPConnection* tcpc;
EQStreamInterface *eqsi;
while(RunLoops) {
Timer::SetCurrentTime();
//check the factory for any new incoming streams.
while ((eqs = eqsf.Pop())) {
//pull the stream out of the factory and give it to the stream identifier
//which will figure out what patch they are running, and set up the dynamic
//structures and opcodes for that patch.
struct in_addr in;
in.s_addr = eqs->GetRemoteIP();
_log(WORLD__CLIENT, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
stream_identifier.AddStream(eqs); //takes the stream
}
//give the stream identifier a chance to do its work....
stream_identifier.Process();
//check the stream identifier for any now-identified streams
while((eqsi = stream_identifier.PopIdentified())) {
//now that we know what patch they are running, start up their client object
struct in_addr in;
in.s_addr = eqsi->GetRemoteIP();
if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs.
_log(WORLD__CLIENT, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table.
_log(WORLD__CLIENT, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
Client* client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
} else {
_log(WORLD__CLIENT, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream.
}
}
if (!RuleB(World, UseBannedIPsTable)){
_log(WORLD__CLIENT, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
Client* client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
}
}
client_list.Process();
while ((tcpc = tcps.NewQueuePop())) {
struct in_addr in;
in.s_addr = tcpc->GetrIP();
_log(WORLD__ZONE, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort());
示例3: main
//.........这里部分代码省略.........
server_connection->OnConnectionRemoved("WebInterface", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
LogF(Logs::General, Logs::World_Server, "Removed WebInterface Server connection from {0}",
connection->GetUUID());
web_interface.RemoveConnection(connection);
});
EQ::Net::EQStreamManagerOptions opts(9000, false, false);
EQ::Net::EQStreamManager eqsm(opts);
//register all the patches we have avaliable with the stream identifier.
EQStreamIdentifier stream_identifier;
RegisterAllPatches(stream_identifier);
zoneserver_list.shutdowntimer = new Timer(60000);
zoneserver_list.shutdowntimer->Disable();
zoneserver_list.reminder = new Timer(20000);
zoneserver_list.reminder->Disable();
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
InterserverTimer.Trigger();
uint8 ReconnectCounter = 100;
std::shared_ptr<EQStreamInterface> eqs;
EQStreamInterface *eqsi;
eqsm.OnNewConnection([&stream_identifier](std::shared_ptr<EQ::Net::EQStream> stream) {
stream_identifier.AddStream(stream);
LogF(Logs::Detail, Logs::World_Server, "New connection from IP {0}:{1}", stream->RemoteEndpoint(), ntohs(stream->GetRemotePort()));
});
while (RunLoops) {
Timer::SetCurrentTime();
eqs = nullptr;
//give the stream identifier a chance to do its work....
stream_identifier.Process();
//check the stream identifier for any now-identified streams
while ((eqsi = stream_identifier.PopIdentified())) {
//now that we know what patch they are running, start up their client object
struct in_addr in;
in.s_addr = eqsi->GetRemoteIP();
if (RuleB(World, UseBannedIPsTable)) { //Lieka: Check to see if we have the responsibility for blocking IPs.
Log(Logs::Detail, Logs::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
if (!database.CheckBannedIPs(inet_ntoa(in))) { //Lieka: Check inbound IP against banned IP table.
Log(Logs::Detail, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
auto client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
}
else {
Log(Logs::General, Logs::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream.
}
}
if (!RuleB(World, UseBannedIPsTable)) {
Log(Logs::Detail, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
auto client = new Client(eqsi);
// @merth: client->zoneattempt=0;
client_list.Add(client);
}
}
client_list.Process();
if (PurgeInstanceTimer.Check())
{
database.PurgeExpiredInstances();