Comments (2)
Hi. Sorry for late answer (and maybe its not in my business). Can answer only to last request, about reconnecting. You can tune time and nubmer of tries manually in some way. It tries to connect every 1 sec for 5 times. You can adjust it, if you can recompile MBCon in VS.
You need to edit MBCon -> Classes -> core.cs. Integer for number of tries is _maxtries = 5;
, on line 38. Change it to 300, as example, if you want it to wait for 5 mins (it will try to connect for 5 mins).
Another way to change the time between reconnect tries. You need to adjust Thread.Sleep(1000)
on the line 123 (same file). As example, you can set _maxtries = 10
and Thread.Sleep(30000)
so it will try to connect 10 times with wait before reconnect of 30 sec, resulting 5 minutes.
Another, more complex (and maybe buggy) way is to replace throw new CoreException("Failed to connect to server.");
on line 128 with something like Thread.Sleep(300000); goto mark;
(mark:
for goto before for
cycle in public void Connect()
), so it will sleep for 5 minutes and then try to reconnect again. But it may cause infinity loop if it is not connected to a server, so be careful.
All of these require at least Visual Studio to recompile project.
Hope that it will help you or any other looking for this. And hope Maca134 will insert smth to configure at least number of tries in config file :)
from mbcon.
Another way, i set it to try 25 times to connect, then wait for minute and try to connect again (it will try to connect 3 times, each time 25 tries and 60 seconds between each 25 tries, then shutdown).
You can copy code below and paste it replacing yours in VS or i can send you compilated .exe
public void Connect() { for (var ia = 1; ia <= 3; ia++) { for (var tries = 1; tries <= _maxtries; tries++) { try { _beclient.Connect(); if (!_beclient.Connected) throw new CoreException(); break; } catch { AppConsole.Log(String.Format("Failed to connect to server. Attempt {0}/{1}", tries, _maxtries), ConsoleColor.Red); } Thread.Sleep(1000); } Thread.Sleep(60000); } if (!_beclient.Connected) { throw new CoreException("Failed to connect to server."); } _connected = true; }
Code isnt good looking in github, dunno why.
from mbcon.
Related Issues (12)
- Can't read rcon password HOT 5
- How does the PlayerChek http whitelist works? HOT 1
- beserver_x64 compatibility? HOT 1
- Issues while trying to connect HOT 4
- Global bans HOT 4
- Execute a Batch File from Scheduler HOT 5
- Unable to connect HOT 3
- Dont see mbcon.exe in the folder! HOT 3
- Issue with using #shutdown as a scheduled task HOT 2
- BE config ? Where to point for remote Linux Server ?
- Instruction Ambiguity HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbcon.