1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using MySql.Data.MySqlClient;
- using StackExchange.Redis;
-
- public class Config
- {
- public const bool GameOnline = false;
- public ConfigurationOptions redis;
- public MySqlConnectionStringBuilder mysql;
- /// <summary>
- /// 结束倒计时
- /// </summary>
- public int CountDownTimes => GameOnline ? 10 * 60 : 2 * 60;
- /// <summary>
- /// 结算地址
- /// </summary>
- public string SettleUrl
- {
- get
- {
- var host = "192.168.10.86";
- if (GameOnline)
- {
- host = "115.159.121.129";
- }
- return $"http://{host}/ylsj2019/Gameserver/Amfphp/service_call/InquireApi/WorldBosSettle.php";
- }
- }
- private Config() { }
- static private Config _ins;
- public static Config Ins
- {
- get
- {
- if (null == _ins)
- {
- if (GameOnline)
- {
- var host = "127.0.0.1";
- var port = 6379;
- var pwd = "wanggang1985";
- _ins = new Config()
- {
- redis = ConfigurationOptions.Parse($"{host}:{port},password={pwd},connectTimeout=2000"),
- mysql = new MySqlConnectionStringBuilder
- {
- Server = "127.0.0.1",
- UserID = "gwang",
- Password = "wanggang1985",
- Port = 3306,
- Database = "ylsj2019_pay"
- }
- };
- }
- else
- {
- var host = "192.168.10.16";
- var port = 6004;
- var pwd = "wanggang1985";
- _ins = new Config()
- {
- redis = ConfigurationOptions.Parse($"{host}:{port},password={pwd},connectTimeout=2000"),
- mysql = new MySqlConnectionStringBuilder
- {
- Server = "192.168.10.16",
- UserID = "gwang",
- Password = "wanggang1985",
- Port = 3306,
- Database = "ylsj2019_pay"
- }
- };
- }
- }
- return _ins;
- }
- }
- }
-
|