Пример #1
0
        static void Main()
        {
            Console.Title = Assembly.GetExecutingAssembly().GetName().Name;

            SilverConsole.Welcome();

            Logs.LoadLogs();

            if (Config.LoadConfig() && Database.DbManager.TestConnectivityToRealmDb())
            {
                Network.Realm.RealmClient.GameServers = Database.GameServerRepository.GetAll();

                var com = new Network.ToGame.ToGameServer();
                com.Run();

                var server = new Network.Realm.RealmServer();
                server.Run();
            }

            Console.Read();
        }
Пример #2
0
        static void Main()
        {
            Console.Title = Assembly.GetExecutingAssembly().GetName().Name;

            SilverConsole.Welcome();

            Logs.LoadLogs();

            if (Config.LoadConfig() && Database.DbManager.TestConnectivityToRealmDb())
            {
                Network.Realm.RealmClient.GameServers = Database.GameServerRepository.GetAll();

                var com = new Network.ToGame.ToGameServer();
                com.Run();

                var server = new Network.Realm.RealmServer();
                server.Run();
            }

            Console.Read();
        }
Пример #3
0
        private void CheckAccount(string packet)
        {
            var username = packet.Split('#')[0];
            var password = packet.Split('#')[1];

            Account = Database.AccountRepository.GetAccount(Constant.UsernameColumnName, username);

            if (Account == null || Hash.Encrypt(Account.Password, _key) != password)
            {
                SendPackets(Packet.WrongDofusAccount);
                RemoveMeOnList();
            }
            else if (RealmServer.Clients.Count(x => x.Account.Username.Equals(username, StringComparison.OrdinalIgnoreCase)) > 1 || Account.Connected)
            {
                SendPackets(Packet.AlredyConnected);

                RealmServer.Disconnect(Account.Id);

                ToGameClient.SendPacket(string.Format("{0}{1}", Packet.DisconnectMe, Account.Id));

                RemoveMeOnList();
            }
            else if (Account.BannedUntil != null && Account.BannedUntil > DateTime.Now)
            {
                SendPackets(Packet.BannedAccount);
                RemoveMeOnList();
            }
            else
            {
                SendPackets(string.Format("{0}{1}", Packet.DofusPseudo, Account.Pseudo));
                SendPackets(string.Format("{0}{1}", Packet.Community, 0)); // 0 : communauté fr

                RefreshServerList();

                SendPackets(string.Format("{0}{1}", Packet.IsAdmin, Account.GmLevel > 0 ? 1 : 0));
                SendPackets(string.Format("{0}{1}", Packet.SecretQuestion, Account.Question.Replace(" ", "+")));

                _stateConnxion = StateConnecion.CheckingServer;
            }
        }