Exemplo n.º 1
0
        public void MakeRandomGame(Client.GameDifficulty difficulty)
        {
            String gamePass = Utils.RandomString(3);
            String gameName = Utils.RandomString(10);

            MakeGame(difficulty, gameName, gamePass);
        }
Exemplo n.º 2
0
 public McpHandler(ref McpConnection conn, String character, Client.GameDifficulty difficulty)
     : base(conn)
 {
     m_loggedIn   = false;
     m_character  = character;
     m_classByte  = 0;
     m_difficulty = difficulty;
 }
Exemplo n.º 3
0
 public McpHandler(ref McpConnection conn, String character, Client.GameDifficulty difficulty)
     : base(conn)
 {
     m_loggedIn = false;
     m_character = character;
     m_classByte = 0;
     m_difficulty = difficulty;
 }
Exemplo n.º 4
0
 public void MakeGame(Client.GameDifficulty difficulty, String gameName, String gamePass)
 {
     m_gameName = gameName;
     m_gamePass = gamePass;
     byte[] temp   = { 0x01, 0xff, 0x08 };
     byte[] packet = m_connection.BuildPacket(0x03, BitConverter.GetBytes((UInt16)2), BitConverter.GetBytes(Utils.GetDifficulty(difficulty)), temp, System.Text.Encoding.ASCII.GetBytes(m_gameName), GenericHandler.zero,
                                              System.Text.Encoding.ASCII.GetBytes(m_gamePass), GenericHandler.zero, GenericHandler.zero);
     m_connection.Write(packet);
 }
Exemplo n.º 5
0
        public void MakeRandomGame(Client.GameDifficulty difficulty)
        {
            String gamePass = Utils.RandomString(3);
            String gameName = Utils.RandomString(10);

            Logger.Write("Create Game {0} with Password {1}", gameName, gamePass);

            MakeGame(difficulty, gameName, gamePass);
        }
Exemplo n.º 6
0
 public void MakeGame(Client.GameDifficulty difficulty, String gameName, String gamePass)
 {
     _gameName = gameName;
     _gamePass = gamePass;
     byte[] temp   = { 0x01, 0xff, 0x08 };
     byte[] packet = Connection.BuildPacket(0x03, BitConverter.GetBytes((ushort)(2 * _nextGameIndex)), BitConverter.GetBytes(Utils.GetDifficulty(difficulty)), temp, Encoding.ASCII.GetBytes(_gameName), Zero,
                                            Encoding.ASCII.GetBytes(_gamePass), Zero, Zero);
     Connection.Write(packet);
 }
Exemplo n.º 7
0
        public void MakeGameFromSettings(Client.GameDifficulty difficulty, string gameName, string gamePass)
        {
            var name = gameName.Replace("%i", _nextGameIndex.ToString());
            var pass = gamePass.Replace("%i", _nextGameIndex.ToString());

            Logger.Write($"Create Game {name} // {pass}");
            MakeGame(difficulty, name, pass);

            _nextGameIndex++;
        }
Exemplo n.º 8
0
 private void InitServers(String character, String account, String password,
                          Client.GameDifficulty difficulty, String classicKey,
                          String expansionKey, String exeInfo)
 {
     _bncsConnection = new BncsConnection();
     _bncsReader     = new BncsReader(ref _bncsConnection);
     _bncsHandler    = new BncsHandler(ref _bncsConnection, account, password,
                                       classicKey, expansionKey, exeInfo);
     _mcpConnection = new McpConnection();
     _mcpReader     = new McpReader(ref _mcpConnection);
     _mcpHandler    = new McpHandler(ref _mcpConnection, character, difficulty);
 }
Exemplo n.º 9
0
        public static UInt32 GetDifficulty(Client.GameDifficulty difficulty)
        {
            switch (difficulty)
            {
            default:
            case Client.GameDifficulty.Normal:
                return(0x0000);

            case Client.GameDifficulty.Nightmare:
                return(0x1000);

            case Client.GameDifficulty.Hell:
                return(0x2000);
            }
        }
Exemplo n.º 10
0
        public static UInt32 GetDifficulty(Client.GameDifficulty difficulty)
        {
            switch (difficulty)
            {
            default:
            case Client.GameDifficulty.NORMAL:
                return(0x0000);

            case Client.GameDifficulty.NIGHTMARE:
                return(0x1000);

            case Client.GameDifficulty.HELL:
                return(0x2000);
            }
        }
Exemplo n.º 11
0
 public Bnet(IPAddress server, String character, String account, String password, Client.GameDifficulty difficulty, String classicKey, String expansionKey, String exeInfo)
 {
     _server = server;
     InitServers(character, account, password, difficulty, classicKey, expansionKey, password);
     InitThreads(account);
     AssociateEvents();
 }
Exemplo n.º 12
0
 public void MakeRandomGame(Client.GameDifficulty difficulty)
 {
     _mcpHandler.MakeRandomGame(difficulty);
 }
Exemplo n.º 13
0
 public void MakeGameFromSettings(Client.GameDifficulty difficulty, string gameName, string gamePass)
 {
     _mcpHandler.MakeGameFromSettings(difficulty, gameName, gamePass);
 }
Exemplo n.º 14
0
 public void MakeGame(Client.GameDifficulty difficulty, String gameName, String gamePass)
 {
     m_mcpHandler.MakeGame(difficulty, gameName, gamePass);
 }