예제 #1
0
 bool SendPacket(byte bPacket, string strArguments)
 {
     try
     {
         return(MasterClient.SendPacket(MasterClient.CreatePacket(bPacket, strArguments)));
     }
     catch { }
     return(false);
 }
예제 #2
0
        public Boolean SendTaskRemoved(Int32 iTaskID)
        {
            try
            {
                CPacket TaskRemovedPacket = MasterClient.CreatePacket((Byte)MASTER_PACKET.REMOVE_TASK, iTaskID.ToString());

                return(MasterClient.SendPacket(TaskRemovedPacket));
            }
            catch { }
            return(false);
        }
예제 #3
0
        public bool AskForKey()
        {
            try
            {
                CPacket KeyPacket = MasterClient.CreatePacket((Byte)MASTER_PACKET.LOGIN_KEY, "1");

                return(MasterClient.SendPacket(KeyPacket));
            }
            catch
            {
            }
            return(false);
        }
예제 #4
0
        public bool SendBotlist(String strBotlist, Int32 iPage)
        {
            if (String.IsNullOrEmpty(strBotlist))
            {
                return(false);
            }

            try
            {
                CPacket BotlistPacket = MasterClient.CreatePacket((Byte)MASTER_PACKET.BOTLIST, String.Format("{0}|{1}", strBotlist, iPage));

                return(MasterClient.SendPacket(BotlistPacket));
            }
            catch { }
            return(false);
        }
예제 #5
0
        public bool SendRSAAuth()
        {
            try
            {
                if (String.IsNullOrEmpty(this.Public_Key))
                {
#if DEBUG
                    Console.WriteLine(CConstants.InvalidPublicKey);
#endif
                    return(false);
                }

                String strAuthString = CUtilities.RandomString(CUtilities.RandomInt(8, 16));

                byte[] arr_bRandomString = UnicodeEncoding.Unicode.GetBytes(strAuthString);

                if (arr_bRandomString == null)
                {
                    return(false);
                }

                arr_bRandomString = CRSA.Encrypt(arr_bRandomString, this.Public_Key, 2048);

                if (arr_bRandomString == null)
                {
#if DEBUG
                    Console.WriteLine(CConstants.SendRSAAuth_RSAEncrypt_FAILED);
#endif
                    return(false);
                }

                CPacket KeyPacket = MasterClient.CreatePacket((Byte)MASTER_PACKET.LOGIN_KEY, Convert.ToBase64String(arr_bRandomString));

                if (MasterClient.SendPacket(KeyPacket))
                {
                    this.AuthString = strAuthString;
                    return(true);
                }
            }
            catch
            {
            }
            return(false);
        }
예제 #6
0
        public Boolean SendTasklist(String strTasklist)
        {
            if (String.IsNullOrEmpty(strTasklist))
            {
                return(false);
            }

            try
            {
                CPacket TasklistPacket = MasterClient.CreatePacket((Byte)MASTER_PACKET.TASKLIST, strTasklist);

                return(MasterClient.SendPacket(TasklistPacket));
            }
            catch
            {
            }

            return(false);
        }