Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 08:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#] Clientless reconnect.

Discussion on [C#] Clientless reconnect. within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
[C#] Clientless reconnect.

hey guys , im recently learning into the Clientless with the help of many released src but there is one thing i couldn't figure out is how to reconnect after Dc or something like it
in erine bot it reconnects after dc but some times gets stuck im trying to improve the reconnect method any one could help ? any hints thx all !
B13. is offline  
Old 05/10/2016, 15:52   #2
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,845
Received Thanks: 4,675
Save the packets the user is sending when he is connecting.
On the Disconnect Packet, rerun the client (clientless or not) and sending the same packet you saved.
So the User do not need to enter his account credentials in your form.

And what did you mean with improve ? Less errors or stucks ?
Devsome is offline  
Thanks
1 User
Old 05/10/2016, 16:11   #3
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
im doing an event tool working so good so far but i dont need to check it every 2 hours to see if it is connected or no .
just for me no other users
improve i mean no stuck at all
B13. is offline  
Old 05/10/2016, 16:25   #4
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,845
Received Thanks: 4,675
Quote:
Originally Posted by B13. View Post
im doing an event tool working so good so far but i dont need to check it every 2 hours to see if it is connected or no .
just for me no other users
improve i mean no stuck at all
You don't need to check it very 2 hours.
Just work with the Disconnect Packet then, after any client_crash, disconnect or maybe some other stuff reconnecting.

https://en.wikipedia.org/wiki/Test-driven_development
Devsome is offline  
Thanks
1 User
Old 05/10/2016, 16:54   #5
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
thx mate, one more thing.
could some one. explain this
PHP Code:
        private void CleanClient(int Where)
        {
            try
            {
                
Remote false;
                
CharSpawned false;
                
Console.WriteLine("Disconnected Agent. (" Where.ToString() + ")");
                
Client.Close();
                
GC.SuppressFinalize(this);
            }
            catch
            {
                
GC.SuppressFinalize(this);
            } 
B13. is offline  
Old 05/10/2016, 19:14   #6

 
AceSpace's Avatar
 
elite*gold: 21
Join Date: Mar 2011
Posts: 1,613
Received Thanks: 1,122
Quote:
Originally Posted by B13. View Post
thx mate, one more thing.
could some one. explain this
PHP Code:
        private void CleanClient(int Where)
        {
            try
            {
                
Remote false;
                
CharSpawned false;
                
Console.WriteLine("Disconnected Agent. (" Where.ToString() + ")");
                
Client.Close();
                
GC.SuppressFinalize(this);
            }
            catch
            {
                
GC.SuppressFinalize(this);
            } 
GC.SuppressFinalize notifies the Garbage Collector that this "item" is done aka leave it alone. Why are u calling such a thing without even calling Dispose before?
AceSpace is offline  
Thanks
1 User
Old 05/10/2016, 19:53   #7
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
thx skipper.
im not calling it i didn't write it , i found it in one of the src i got & just wanted to know what does it mean
thx again for the explanation
B13. is offline  
Old 05/11/2016, 10:23   #8


 
tschulian's Avatar
 
elite*gold: 294
Join Date: Sep 2013
Posts: 1,410
Received Thanks: 635
I got a Clientless PM bot which reconnects instant after getting kicked, dced or smth different.
I could provide you the function if you may need it.
tschulian is offline  
Old 05/11/2016, 23:20   #9
 
B13.'s Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 239
Received Thanks: 26
Quote:
Originally Posted by tschulian View Post
I got a Clientless PM bot which reconnects instant after getting kicked, dced or smth different.
I could provide you the function if you may need it.
yes please that would be nice!
thx in advance.
B13. is offline  
Old 05/21/2016, 20:32   #10

 
AceSpace's Avatar
 
elite*gold: 21
Join Date: Mar 2011
Posts: 1,613
Received Thanks: 1,122
Just check keepalive/ping packet aka 0x2002, if it hasn't been sent for like 10 seconds then re-connect.
AceSpace is offline  
Thanks
2 Users
Old 05/28/2016, 17:05   #11
 
elite*gold: 0
Join Date: Feb 2009
Posts: 46
Received Thanks: 5
i do something like that before so i will give u the steps :-

first u need method to detect the disconnected connection as

Code:
Agent_buffer.Size = Agent_socket.Receive(Agent_buffer.Buffer, 0, Agent_buffer.Buffer.Length, SocketFlags.None, out err);

if (Agent_buffer.Size == 0)
                        {
                            Reconnect();
                        }
second u need to pause the main thread while reconnecting ,that rly depend on your code ,
u can use ManualResetEvent for that just google for it

last u need to try establish a new connection and resume the main thread after the character login in the world map .

BTW :- dont forget to dipose the disconnected socket .
theking200051 is offline  
Thanks
1 User
Old 12/27/2016, 15:28   #12
 
~kau~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 634
Received Thanks: 794
schon gesehen?
~kau~ is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
DVbot Clientless botting made easy High performance clientless bot. About: Blitzbo
04/24/2015 - League of Legends Trading - 88 Replies
Sales closed!



All times are GMT +1. The time now is 08:25.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.