Exemple #1
0
        public void OnCallBack(IAsyncResult iAr)
        {
            try
            {
                if (!int.TryParse(_socket.EndReceive(iAr).ToString(), out var bytes))
                {
                    Dispose();
                    return;
                }

                var data = Encoding.Default.GetString(_buffer, 0, bytes);
                if (!PlusEnvironment.GetRCONSocket().GetCommands().Parse(data))
                {
                    Log.Error("Failed to execute a MUS command. Raw data: " + data);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            Dispose();
        }