internal void initializeCar(RoomMainF.RoomMain roomMain) { this._Car = new Car() { ability = new AbilityAndState(), targetFpIndex = -1, }; var notifyMsg = new List <string>(); this._Car.SendStateAndPurpose = RoomMainF.RoomMain.SendStateOfCar; this._Car.setState(this, ref notifyMsg, Car.CarState.waitAtBaseStation); this._Car.SendPurposeOfCar = RoomMainF.RoomMain.SendPurposeOfCar; this._Car.setState(this, ref notifyMsg, Car.CarState.waitAtBaseStation); // this._Car.SendPurposeOfCar = RoomMainF.RoomMain.SendPurposeOfCar; this._Car.setPurpose(this, ref notifyMsg, Car.Purpose.@null); this._Car.SetAnimateChanged = roomMain.SetAnimateChanged; this._Car.setAnimateData(this, ref notifyMsg, null); this._Car.ability.MileChanged = RoomMainF.RoomMain.AbilityChanged2_0; this._Car.ability.BusinessChanged = RoomMainF.RoomMain.AbilityChanged2_0; this._Car.ability.VolumeChanged = RoomMainF.RoomMain.AbilityChanged2_0; this._Car.ability.SpeedChanged = RoomMainF.RoomMain.AbilityChanged2_0; // car.ability.SubsidizeChanged = RoomMain.SubsidizeChanged; this._Car.ability.DiamondInCarChanged = RoomMainF.RoomMain.DiamondInCarChanged; this._Money = intializedMoney; // this.Money = intializedMoney; this.SupportToPlay = null; }
static void Main(string[] args) { var version = "2.0.0"; Console.WriteLine("Hello World!"); Console.WriteLine($"版本号:{version}"); Program.startTime = DateTime.Now; Program.boundary = new Geometry.Boundary(); boundary.load(); Program.dt = new Data(); Program.dt.LoadRoad(); Program.rm = new RoomMainF.RoomMain(); { var ip = "127.0.0.1"; int tcpPort = 11100; Console.WriteLine($"输入ip,如“{ip}”"); var inputIp = Console.ReadLine(); if (string.IsNullOrEmpty(inputIp)) { } else { ip = inputIp; } Console.WriteLine($"输入端口≠15000,如“{tcpPort}”"); var inputWebsocketPort = Console.ReadLine(); if (string.IsNullOrEmpty(inputWebsocketPort)) { } else { int num; if (int.TryParse(inputWebsocketPort, out num)) { tcpPort = num; } } Data.SetRootPath(); Thread startTcpServer = new Thread(() => Listen.IpAndPort(ip, tcpPort)); startTcpServer.Start(); Thread startMonitorTcpServer = new Thread(() => Listen.IpAndPortMonitor(ip, 30000 - tcpPort)); startMonitorTcpServer.Start(); Thread th = new Thread(() => PlayersSysOperate()); th.Start(); //int tcpServerPort = 30000 - websocketPort; //ConnectInfo.HostIP = ip; //ConnectInfo.webSocketPort = websocketPort; //ConnectInfo.tcpServerPort = tcpServerPort; } while (true) { if (Console.ReadLine().ToLower() == "exit") { break; } } // Console.ReadLine(); }