Beispiel #1
0
 /// <summary>
 /// Start server.
 /// </summary>
 public void Run()
 {
     Logger.Log("War World Infinity Server Version {0}", Version);
     Settings    = new AppSettings(_directory + "Settings.ini");
     _taskQueue  = new TaskQueue();
     CommandExec = new CommandExecuter();
     //SocketPolicyServer.LoadAll();
     SockServ     = new WebSockServer(AppSettings.ServerPort);
     _netCommands = new NetworkCommands();
     DB           = new DataBase(AppSettings.DbServer, AppSettings.Database);
     DB.Connect(AppSettings.DbUsername, AppSettings.DbPassword);
     Worlds            = new WorldManager(this);
     Structures        = new StructureControl();
     Chat              = new ChatProcessor();
     Users             = new UserManager();
     autoSaver         = new AutoSave();
     FCounter          = new FrameCounter();
     Alliances         = new AllianceManager();
     Squads            = new SquadController();
     Noise2D.RunAsync += TaskQueue.QeueAsync;
     _tickThread       = new Thread(CommandExec.StartCommandLoop);
     _tickThread.Start();
     GameLoop();
 }
Beispiel #2
0
        public Client()
        {
            InitializeComponent();

            this.NetworkCommands = new NetworkCommands();
        }
Beispiel #3
0
 public void TestTrace()
 {
     Console.WriteLine(NetworkCommands.Tracert("192.168.1.99"));
 }
Beispiel #4
0
 internal Message(NetworkCommands command)
 {
     this.command = command;
 }
 void Awake()
 {
     instance = this;
 }
Beispiel #6
0
 public Data(NetworkCommands _command, int _x, int _y)
 {
     command = _command; x = _x; y = _y;
 }
Beispiel #7
0
 public CommandMessage(byte[] commandBytes)
 {
     this.CommandType = (NetworkCommands)BitConverter.ToInt32(commandBytes, 0);
     this.firstParam  = BitConverter.ToInt32(commandBytes, 4);
     this.secondParam = BitConverter.ToInt32(commandBytes, 8);
 }
Beispiel #8
0
 public CommandMessage(NetworkCommands _command, int _x = 0, int _y = 0)
 {
     CommandType = _command;
     firstParam  = _x;
     secondParam = _y;
 }
Beispiel #9
0
 void SendCommand(Socket s, NetworkCommands comand)
 {
     byte[] b = BitConverter.GetBytes((int)comand);
     s.Send(b, sizeof(Int32), SocketFlags.None);
 }