Openkore.com

OpenKore Forums
It is currently 24 Sep 2018, 13:05

All times are UTC - 5 hours [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: [FIX] - Freeze for OpenKore when Poisedon Server gets Frozen
PostPosted: 09 Oct 2011, 20:28 
Offline
Developers
Developers

Joined: 05 Oct 2011, 09:21
Posts: 60
Location: Brazil
Hello,

I am writing and contributing with my first fix for openkore, it will add a timeout for the Game Guard connection state (it doesn't exists on last svn) so the bot gets frozen forever until restart.

Here is how to fix it :

For : DirectConnection.pm do the following changes :

Find :
Code:
# GameGuard support
if ($self->serverAlive && $config{gameGuard} == 2) {
   my $msg = pack("C*", 0x58, 0x02);
   $net->serverSend($msg);
   message T("Requesting permission to logon on account server...\n");
   $conState = 1.2;
   return;
}


And change to :
Code:
# GameGuard support
if ($self->serverAlive && $config{gameGuard} == 2) {
   my $msg = pack("C*", 0x58, 0x02);
   $net->serverSend($msg);
   message T("Requesting permission to logon on account server...\n");
   $conState = 1.2;
   $self->{gstimeout} = time;
   return;
}


Still in DirectConnection.pm find :
Code:
   $timeout{'master'}{'time'} = time;
# we skipped some required connection operations while waiting for the server to allow as to login,
# after we have successfully sent in the reply to the game guard challenge (using the poseidon server)
# this conState will allow us to continue from where we left off.
} elsif ($self->getState() == 1.3) {


And change to :
Code:
} elsif ($self->getState() == 1.2) {
# Checking if we succesful received the Game Guard Confirmation (Should Happen Sooner)
   if ( time - $self->{gstimeout} > 10 )
   {
      message T("The Game Guard Authorization Request\n");
      message T("has timed out, please check your poseidon server !!\n");
      $self->serverDisconnect;
      $self->setState(Network::NOT_CONNECTED);         
   }
# we skipped some required connection operations while waiting for the server to allow as to login,
# after we have successfully sent in the reply to the game guard challenge (using the poseidon server)
# this conState will allow us to continue from where we left off.
} elsif ($self->getState() == 1.3) {


Then for our last change go to : Client.pm and find this :
Code:
   $self->{privateOnly} = defined($args{privateOnly}) ? $args{privateOnly} : 0;

   # A queue containing messages to be sent next time we're
   # connected to the bus.


And change it to :
Code:
   $self->{privateOnly} = defined($args{privateOnly}) ? $args{privateOnly} : 0;
   $self->{gstimeout} = 0;

   # A queue containing messages to be sent next time we're
   # connected to the bus.


The result of this patch will be now that poseidon server gonna have 10 seconds to reply the bot, if not it will retry the connection again !


Top
 Profile  
 
 Post subject: Re: [FIX] - Freeze for OpenKore when Poisedon Server gets Frozen
PostPosted: 11 Oct 2011, 20:51 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1301
Fr3DBr
Nice to see you!

Thank's for your Fix. It will be commited Soon.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group