private async Task <RichResult> QuickReturn(VisionHelper vision, MsgObject msg)
        {
            var ret = await vision.AnalyzeImage(msg.PicUrl, msg.FromUserName);

            if (ret != null)
            {
                //Response.Write(string.Format("<xml><ToUserName><![CDATA[{0}]]></ToUserName><FromUserName><![CDATA[{1}]]></FromUserName><CreateTime>12345678</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[{2}]]></Content><DebugInfo><![CDATA[{3}]]></DebugInfo><ErrorInfo><![CDATA[{4}]]></ErrorInfo></xml>",
                //    msg.FromUserName, msg.ToUserName, ret.analyzeImageResult, ret.timeLogs, ret.errorLogs));
                if (ret.errorLogs.Equals(""))
                {
                    // Production mode
                    var returnString = string.Format("{0} 想知道贵图有多火辣么? 请看归图:{1}", ret.analyzeImageResult, ret.uploadedUrl);
                    Response.Write(string.Format("<xml><ToUserName><![CDATA[{0}]]></ToUserName><FromUserName><![CDATA[{1}]]></FromUserName><CreateTime>12345678</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[{2}]]></Content></xml>",
                                                 msg.FromUserName, msg.ToUserName, returnString));
                    Response.End();
                    return(ret);
                }
                else
                {
                    //Response.Write(string.Format("<xml><ToUserName><![CDATA[{0}]]></ToUserName><FromUserName><![CDATA[{1}]]></FromUserName><CreateTime>12345678</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[{2}]]></Content></xml>",
                    //msg.FromUserName, msg.ToUserName, "机器人很忙,请稍后再试"));
                    //Response.End();
                    return(ret);
                }
            }
            return(null);
        }
        public override void Character_ReplaceAll(MsgObject message)
        {
            var customCtrl = Singleton <CustomControl> .Instance;
            var chara      = customCtrl.chainfo;

            chara.chaFile.Load(message.path);
            chara.Reload(false, false, false);

            if (chara.Sex == 0)
            {
                (chara as CharMale).maleStatusInfo.visibleSon = false;
            }
            else
            {
                (chara as CharFemale).UpdateBustSoftnessAndGravity();
            }

            customCtrl.subMenuCtrl.UpdateLimitMainMenu();
            customCtrl.SetSameSetting();
            customCtrl.noChangeSubMenu = true;
            customCtrl.ChangeSwimTypeFromLoad();
            customCtrl.noChangeSubMenu = false;
            customCtrl.UpdateCharaName();
            customCtrl.UpdateAcsName();
        }
        // MapSelectScene.OnEnter()
        public override void Character_LoadFemale(MsgObject message)
        {
            var mapSelect = FindObjectOfType <MapSelectScene>();
            var traverse  = Traverse.Create(mapSelect);

            traverse.Field("charFile").SetValue(message.path);

            var keys = Map.Instance.MapInfoDic.Keys.ToList();

            traverse.Field("mapKeys").SetValue(keys);
            //mapSelect.SetMapListNormal();
            mapSelect.SetMapList();

            //int select = UnityEngine.Random.Range(0, keys.Count);
            int select = 1;

            if (keys.Count != 1)
            {
                traverse.Field("mapIdx").SetValue(UnityEngine.Random.Range(0, keys.Count));
            }

            mapSelect.SetMapImage(keys[select]);
            mapSelect.mapSelectInfo.buttons[2].interactable = true;
            mapSelect.mapSelectInfo.buttons[3].interactable = true;
            mapSelect.mapSelectInfo.objRoot.SetActive(true);
            mapSelect.charaSelectInfo.objRoot.SetActive(false);
        }
Beispiel #4
0
    public void SendMessage(MsgObject message)
    {
        if (connectedTcpClient != null)
        {
            try
            {
                NetworkStream stream = connectedTcpClient.GetStream();
                if (stream.CanWrite)
                {
                    byte[] serverMessageAsByteArray = MessagePackSerializer.Serialize(message);
                    stream.Write(serverMessageAsByteArray, 0, serverMessageAsByteArray.Length);
                    Console.WriteLine($"SENDING MESSAGE: {message.type}");
                }
            }
            catch (Exception ex)
            {
                if (ex is SocketException || ex is InvalidOperationException)
                {
                    Console.WriteLine(ex);
                    return;
                }

                throw ex;
            }
        }
    }
        public override void Outfit_Save(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                string date = GetTimeNow();

                foreach (var chara in characters)
                {
                    string prefix = chara.sex == 0 ? "KKCoordeM" : "KKCoordeF";
                    string path   = Path.Combine(message.path, $"{prefix}_{date}.png");

                    Log(LogLevel.Message, $"Save outfit [{Path.GetFileName(path)}]");
                    PlaySaveSound();

                    DelayAction(() =>
                    {
                        var chaFile = chara.charInfo.chaFile;
                        var outfit  = chaFile.coordinate[chaFile.status.coordinateType];
                        CustomCapture.CreatePng(ref outfit.pngData, 252, 352, null, null, Camera.main, null);
                        outfit.coordinateName = "coordinateName";
                        outfit.SaveFile(path);
                    });
                }
            }
            else
            {
                Log(LogLevel.Message, "Select character before saving outfit");
                PlayFailSound();
            }
        }
    //is used to receive msgs sent by the server
    public void Receiver()
    {
        this.tcpListener = new TcpListener(IPAddress.Any, receivePort);

        //this loop will keep on listening
        while (true)
        {
            // Always use a Sleep call in a while(true) loop
            // to avoid locking up your CPU. --Shanika
            //Thread.Sleep(10);
            tcpListener.Start();
            TcpClient client         = this.tcpListener.AcceptTcpClient();
            Stream    streamReceiver = client.GetStream();
            Byte[]    bytes          = new Byte[256];

            int    i;
            String data = null;

            while ((i = streamReceiver.Read(bytes, 0, bytes.Length)) != 0)
            {
                //receive msg sent by server
                data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
            }
            //write to console- for testing purposes
            Console.WriteLine(data);
            msg = data;
            //creates a MsgObject object and stores the respectivr values
            MsgObject msgObject = new MsgObject(msg, DateTime.Now);
            msgParser.addMsg(msgObject);

            streamReceiver.Close();
            tcpListener.Stop();
            client.Close();
        }
    }
        public override void Scene_ImportChara(MsgObject message)
        {
            using (var fileStream = new FileStream(message.path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                using (var binaryReader = new BinaryReader(fileStream))
                {
                    long size = 0L;
                    PngAssist.CheckPngData(binaryReader, ref size, true);
                    var version   = new Version(binaryReader.ReadString());
                    var sceneInfo = Studio.Studio.Instance.sceneInfo;
                    var traverse  = Traverse.Create(sceneInfo);
                    traverse.Property("dicImport").SetValue(new Dictionary <int, ObjectInfo>());
                    traverse.Property("dicChangeKey").SetValue(new Dictionary <int, int>());

                    int num = binaryReader.ReadInt32();
                    for (int i = 0; i < num; i++)
                    {
                        int value = binaryReader.ReadInt32();
                        int type  = binaryReader.ReadInt32();

                        if (type == 0)
                        {
                            var objectInfo = new OICharInfo(null, Studio.Studio.GetNewIndex());
                            objectInfo.Load(binaryReader, version, true, true);
                            sceneInfo.dicObject.Add(objectInfo.dicKey, objectInfo);
                            sceneInfo.dicImport.Add(objectInfo.dicKey, objectInfo);
                            sceneInfo.dicChangeKey.Add(objectInfo.dicKey, value);
                        }
                        else
                        {
                            ObjectInfo objectInfo = null;
                            switch (type)
                            {
                            case 1:
                                objectInfo = new OIItemInfo(-1, Studio.Studio.GetNewIndex());
                                break;

                            case 2:
                                objectInfo = new OILightInfo(-1, Studio.Studio.GetNewIndex());
                                break;

                            case 3:
                                objectInfo = new OIFolderInfo(Studio.Studio.GetNewIndex());
                                break;

                            default:
                                Console.WriteLine($"対象外 : {type}");
                                break;
                            }

                            objectInfo.Load(binaryReader, version, true, true);
                        }
                    }
                }
            }

            AddObjectAssist.LoadChild(Studio.Studio.Instance.sceneInfo.dicImport, null, null);
            Studio.Studio.Instance.treeNodeCtrl.RefreshHierachy();
        }
Beispiel #8
0
        public override void Character_LoadMale(MsgObject message)
        {
            var chara = Manager.Character.Instance.dictMale[0];

            chara.chaFile.Load(message.path);
            chara.Reload(false, false, false);
            chara.maleStatusInfo.visibleSon = false;
        }
Beispiel #9
0
        public override void Character_LoadFemale(MsgObject message)
        {
            var chara = Manager.Character.Instance.dictFemale[0];

            chara.chaFile.Load(message.path);
            chara.Reload(false, false, false);
            chara.UpdateBustSoftnessAndGravity();
        }
        public override void Scene_Save(MsgObject message)
        {
            Studio.Studio.Instance.dicObjectCtrl.Values.ToList().ForEach(x => x.OnSavePreprocessing());
            Studio.Studio.Instance.sceneInfo.cameraSaveData = Studio.Studio.Instance.cameraCtrl.Export();
            string path = Path.Combine(message.path, GetTimeNow() + ".png");

            Studio.Studio.Instance.sceneInfo.Save(path);
            PluginUtils.InvokePluginMethod("HSStudioNEOExtSave.StudioNEOExtendSaveMgr", "SaveExtData", path);
        }
        public override void Outfit_Save(MsgObject message)
        {
            var    customCtrl = Singleton <CustomControl> .Instance;
            string prefix     = customCtrl.chainfo.Sex == 0 ? "coordM" : "coordF";
            string path       = Path.Combine(message.path, $"{prefix}_{GetTimeNow()}.png");

            CreatePng(ref customCtrl.chainfo.clothesInfo.clothesPNG);
            customCtrl.CustomSaveClothesAssist(path);
        }
        public override void Character_Save(MsgObject message)
        {
            var    customCtrl = Singleton <CustomControl> .Instance;
            string path       = Path.Combine(message.path, $"{customCtrl.chainfo.customInfo.name}_{GetTimeNow()}.png");

            customCtrl.chainfo.chaFile.charaFileName = Path.GetFileNameWithoutExtension(path);
            CreatePng(ref customCtrl.chainfo.chaFile.charaFilePNG);
            customCtrl.CustomSaveCharaAssist(path);
        }
Beispiel #13
0
        /// <summary>
        /// 当修改用户的IM信息时,给其他联系人发送透传消息通知更新当前用户的信息
        /// </summary>
        /// <returns></returns>
        public static void SendIMUserUpdateCmdMessage(IMUser imUser)
        {
            UpdateIMUserCmdMagBody cmdMagBody = new UpdateIMUserCmdMagBody(imUser);
            var otherUsers = Logic.BLL.UserInfoService.FindList(a => !a.UID.Equals(imUser.IMUserName, StringComparison.OrdinalIgnoreCase) && a.Status == 1 && a.HuanXinUUID.Length > 0)
                             .Select(a => a.UID).ToArray();

            if (otherUsers.Any())
            {
                MsgObject mgsObj = new MsgObject(MsgTargetType.users, otherUsers, cmdMagBody, null);
                emChat.SendMessages(mgsObj);
            }
        }
Beispiel #14
0
        public override void Outfit_Load(MsgObject message)
        {
            var chara = Manager.Character.Instance.dictFemale[0];

            chara.clothesInfo.Load(message.path);
            chara.chaFile.SetCoordinateInfo(chara.statusInfo.coordinateType);
            chara.Reload(false, false, false);

            //if(chara.Sex == 0)
            //    (chara as CharMale).maleStatusInfo.visibleSon = false;
            //else
            (chara as CharFemale).UpdateBustSoftnessAndGravity();
        }
        // Copied from CustomControl.Start
        public override void Character_Save(MsgObject message)
        {
            var customCtrl = Singleton <CustomControl> .Instance;
            var customBase = CustomBase.Instance;

            var    param       = customBase.chaCtrl.fileParam;
            string filename    = $"{param.lastname}_{param.firstname}_{GetTimeNow()}";
            string filenameext = filename + ".png";
            string path        = Path.Combine(message.path, filenameext);

            Log(LogLevel.Message, $"Save character [{filenameext}]");
            PlaySaveSound();

            DelayAction(() =>
            {
                //customCtrl.saveMode = true;
                //KKKiyase.ForceDisableOneFrame();

                byte[] facePngData = customCtrl.customCap.CapCharaFace(true);
                customBase.chaCtrl.chaFile.facePngData = facePngData;
                customCtrl.customCap.UpdateFaceImage(customBase.chaCtrl.chaFile.facePngData);

                byte[] pngData = customCtrl.customCap.CapCharaCard(true, customBase.saveFrameAssist);
                customBase.chaCtrl.chaFile.pngData = pngData;
                customCtrl.customCap.UpdateCardImage(customBase.chaCtrl.chaFile.pngData);

                customBase.chaCtrl.chaFile.SaveCharaFile(filename, byte.MaxValue, false);

                if (customCtrl.saveFileListCtrl)
                {
                    string club        = "";
                    string personality = "";
                    if (customBase.chaCtrl.sex != 0)
                    {
                        club        = Voice.Instance.voiceInfoDic.TryGetValue(param.personality, out VoiceInfo.Param param1) ? param1.Personality : "不明";
                        personality = Game.ClubInfos.TryGetValue(param.clubActivities, out ClubInfo.Param param2) ? param2.Name : "不明";
                    }
                    else
                    {
                        customCtrl.saveFileListCtrl.DisableAddInfo();
                    }

                    int noUseIndex = customCtrl.saveFileListCtrl.GetNoUseIndex();
                    customCtrl.saveFileListCtrl.AddList(noUseIndex, customBase.chaCtrl.chaFile.parameter.fullname, club, personality, path, filename, DateTime.Now, false);
                    customCtrl.saveFileListCtrl.ReCreate();
                }

                customCtrl.saveMode = false;
            });
        }
        // Copied from Studio.SaveScene
        public override void Scene_Save(MsgObject message)
        {
            string path = Path.Combine(message.path, GetTimeNow() + ".png");

            Log(LogLevel.Message, $"Save scene [{Path.GetFileName(path)}]");
            PlaySaveSound();

            DelayAction(() =>
            {
                Studio.Studio.Instance.dicObjectCtrl.Values.ToList().ForEach(x => x.OnSavePreprocessing());
                Studio.Studio.Instance.sceneInfo.cameraSaveData = Studio.Studio.Instance.cameraCtrl.Export();
                Studio.Studio.Instance.sceneInfo.Save(path);
            });
        }
        public override void Pose_Load(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                foreach (var chara in characters)
                {
                    PauseCtrl.Load(chara, message.path);
                }
            }
            else
            {
                Console.WriteLine("Select character to pose");
            }
        }
        public override void Scene_Load(MsgObject message)
        {
            PluginUtils.InvokePluginMethod("LockOnPlugin.LockOnBase", "ResetModState");
            Studio.Studio.Instance.LoadScene(message.path);
            StartCoroutine(StudioNEOExtendSaveMgrLoad());

            IEnumerator StudioNEOExtendSaveMgrLoad()
            {
                for (int i = 0; i < 3; i++)
                {
                    yield return(null);
                }
                PluginUtils.InvokePluginMethod("HSStudioNEOExtSave.StudioNEOExtendSaveMgr", "LoadExtData", message.path);
                PluginUtils.InvokePluginMethod("HSStudioNEOExtSave.StudioNEOExtendSaveMgr", "LoadExtDataRaw", message.path);
            }
        }
Beispiel #19
0
        public override bool CreateClassMetadata(ClassMetadata clazz, IReflectClass claxx
                                                 , ClassMetadata superClazz)
        {
            Write(Msg.CreateClass.GetWriterForString(SystemTransaction(), Config().ResolveAliasRuntimeName
                                                         (claxx.GetName())));
            Msg resp = GetResponse();

            if (resp == null)
            {
                return(false);
            }
            if (resp.Equals(Msg.Failed))
            {
                // if the class can not be created on the server, send class meta to the server.
                SendClassMeta(claxx);
                resp = GetResponse();
            }
            if (resp.Equals(Msg.Failed))
            {
                if (ConfigImpl.ExceptionsOnNotStorable())
                {
                    throw new ObjectNotStorableException(claxx);
                }
                return(false);
            }
            if (!resp.Equals(Msg.ObjectToClient))
            {
                return(false);
            }
            MsgObject      message = (MsgObject)resp;
            StatefulBuffer bytes   = message.Unmarshall();

            if (bytes == null)
            {
                return(false);
            }
            bytes.SetTransaction(SystemTransaction());
            if (!base.CreateClassMetadata(clazz, claxx, superClazz))
            {
                return(false);
            }
            clazz.SetID(message.GetId());
            clazz.ReadName1(SystemTransaction(), bytes);
            ClassCollection().AddClassMetadata(clazz);
            ClassCollection().ReadClassMetadata(clazz, claxx);
            return(true);
        }
Beispiel #20
0
        private void ListenForData()
        {
            try
            {
                socketConnection = new TcpClient("localhost", 8052);
                Byte[] bytes = new Byte[1024];
                while (true)
                {
                    using (NetworkStream stream = socketConnection.GetStream())
                    {
                        int length;
                        while ((length = stream.Read(bytes, 0, bytes.Length)) != 0)
                        {
                            var incomingData = new byte[length];
                            Array.Copy(bytes, 0, incomingData, 0, length);
                            var message = MessagePackSerializer.Deserialize <MsgObject>(incomingData);
                            message.Print(length);

                            switch (message.type)
                            {
                            case MsgObject.Type.Quit:
                                SendMessage(MsgObject.QuitMsg());
                                throw new SocketException();

                            case MsgObject.Type.Add:
                                MessageAction(message);
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex is SocketException || ex is InvalidOperationException || ex is IOException)
                {
                    Console.WriteLine("Server not found, try again");
                    ListenForData();
                    return;
                }

                throw ex;
            }
        }
        public override void Character_Save(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                string date = GetTimeNow();

                foreach (var chara in characters)
                {
                    string path = Path.Combine(message.path, $"{chara.charInfo.customInfo.name}_{date}.png");
                    SaveChara(chara.charInfo, path);
                }
            }
            else
            {
                Console.WriteLine("Select characters to save");
            }
        }
    //will loop and decode msgs as the queue gets updated
    public void msgProcessor()
    {
        while (gameRunning)
        {
            if (msgQueue.Count != 0)
            {
                MsgObject msgObject = msgQueue.Dequeue();
                String    msg       = msgObject.getMessage();
                DateTime  time      = msgObject.getTime();

                var splitString = msg.Split(':');

                //this will update message with time - to be printed on GUI
                message = time + " : " + msg + "\n";

                if (splitString.Length == 0)
                {
                    //a response msg which is a warning to be handled
                    warningHandler(msg);
                }
                else
                {
                    //if the server response is an update to the GUI

                    messageDeoder(msg);
                }

                //clears the coins list and update-Shanika
                coinLocations.Clear();
                for (int i = 0; i < Constant.MAP_SIZE; i++)
                {
                    for (int j = 0; j < Constant.MAP_SIZE; j++)
                    {
                        if (map[i, j] == "C")
                        {
                            coinLocations.Add((10 * (i)) + (j));
                        }
                    }
                }
            }
        }
    }
        public override void Outfit_Save(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                string date = GetTimeNow();

                foreach (var chara in characters)
                {
                    string prefix = chara.oiCharInfo.sex == 0 ? "coordM" : "coordF";
                    string path   = Path.Combine(message.path, $"{prefix}_{date}.png");
                    SaveOutfit(chara.charInfo, path);
                }
            }
            else
            {
                Console.WriteLine("Select character to save outfit");
            }
        }
Beispiel #24
0
        MsgObject ProcessData(byte[] thepacket)
        {
            MemoryStream msgStream = new MemoryStream(thepacket, 0, thepacket.Length);
            BinaryReader reader    = new BinaryReader(msgStream, Encoding.Unicode);

            byte[] data = reader.ReadBytes(msgIdSize);
            uint   msgID;

            if (reverseByte)
            {
                msgID = NetUtilites.ByteReverse_uint(data);
            }
            else
            {
                msgID = BitConverter.ToUInt32(data, 0);
            }
            data = reader.ReadBytes(thepacket.Length - msgIdSize);
            MsgObject msg = new MsgObject((OpCode)msgID, data);

            return(msg);
        }
Beispiel #25
0
        public static MsgObject SendMsg(int iFromUser, int iToUser, string iMsg, SignalRChatContext iDb)
        {
            var msgToAdd = new Messages();

            msgToAdd.Msg           = iMsg;
            msgToAdd.MsgFromUserId = iFromUser;
            msgToAdd.MsgToUserId   = iToUser;
            msgToAdd.SendDate      = DateTime.Now;

            iDb.Messages.Add(msgToAdd);
            iDb.SaveChanges();

            MsgObject ret = new MsgObject();

            ret.msg        = msgToAdd.Msg;
            ret.fromUserId = msgToAdd.MsgFromUserId;
            ret.toUserId   = msgToAdd.MsgToUserId;
            ret.sentDate   = msgToAdd.SendDate;

            return(ret);
        }
        private bool ProcessTxtMsg(string xml)
        {
            MsgObject msg = new MsgObject(xml);

            if (msg.MsgType != "text")
            {
                return(false);
            }

            string content = msg.Content;

            if (content.Length > 0)
            {
                using (var dbContext = new WeixinDBContext())
                {
                    bool filter    = false;
                    var  blackList = dbContext.BlackList.Select(p => p.Value).ToList();
                    foreach (var value in blackList)
                    {
                        if (content.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)
                        {
                            filter = true;
                            break;
                        }
                    }
                    if (filter == false)
                    {
                        Danmu danmu = new Danmu();
                        danmu.UserName   = string.Empty;
                        danmu.OpenId     = msg.FromUserName;
                        danmu.CreateTime = msg.CreateTime;
                        danmu.Content    = content;
                        dbContext.Danmus.Add(danmu);
                        dbContext.SaveChanges();
                    }
                }
            }

            return(true);
        }
        public override void Outfit_Load(MsgObject message)
        {
            var customCtrl = Singleton <CustomControl> .Instance;
            var chara      = customCtrl.chainfo;

            chara.clothesInfo.Load(message.path);
            chara.chaFile.SetCoordinateInfo(chara.statusInfo.coordinateType);
            chara.Reload(false, false, false);

            if (chara.Sex == 0)
            {
                (chara as CharMale).maleStatusInfo.visibleSon = false;
            }
            else
            {
                (chara as CharFemale).UpdateBustSoftnessAndGravity();
            }

            customCtrl.subMenuCtrl.UpdateLimitMainMenu();
            customCtrl.ChangeSwimTypeFromLoad();
            customCtrl.UpdateAcsName();
        }
        public async Task <ActionResult> SendMsg(chatMsgInput iMsgIobj)
        {
            try
            {
                int userId = ExractIdFromToken();
                if (userId == 0)
                {
                    return(BadRequest());
                }

                SignalRChatContext DB = new SignalRChatContext();

                using (var transaction = DB.Database.BeginTransaction())
                {
                    try
                    {
                        MsgObject res = MsgFunctions.SendMsg(userId, iMsgIobj.toUserId, iMsgIobj.msg, DB);

                        transaction.Commit();

                        await hubContext.Clients.All.SentMsgEvent(userId, iMsgIobj.toUserId, iMsgIobj.msg);

                        return(new JsonResult(res));
                    }
                    catch (Exception exc)
                    {
                        //write exc to log...
                        transaction.Rollback();
                        return(BadRequest());
                    }
                }
            }
            catch (Exception ex)
            {
                //write ex to log...
                return(BadRequest());
            }
        }
        public override void Character_ReplaceBody(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                foreach (var chara in characters)
                {
                    if (chara.charInfo.Sex == 0)
                    {
                    }
                    else
                    {
                        using (var memoryStream = new MemoryStream())
                        {
                            using (var binaryWriter = new BinaryWriter(memoryStream))
                            {
                                chara.charInfo.chaFile.clothesInfo.Save(binaryWriter);
                                var coordinateType = chara.charInfo.statusInfo.coordinateType;

                                chara.ChangeChara(message.path);
                                chara.charInfo.chaFile.clothesInfo.Load(new MemoryStream(memoryStream.ToArray()), true);
                                chara.charInfo.chaFile.SetCoordinateInfo(coordinateType);
                                chara.charInfo.Reload(false, true, true);

                                var female = chara as OCICharFemale;
                                female.female.UpdateBustSoftnessAndGravity();
                                female.SetTuyaRate(female.oiCharInfo.skinRate);
                            }
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("Select characters to replace");
            }
        }
        public override void Outfit_Load(MsgObject message)
        {
            var characters = GetSelectedCharacters();

            if (characters.Count > 0)
            {
                foreach (var chara in characters)
                {
                    chara.LoadClothesFile(message.path);
                    if (chara.charInfo.Sex == 1)
                    {
                        var female = chara as OCICharFemale;
                        female.SetTuyaRate(female.oiCharInfo.skinRate);
                    }
                }

                UpdateStateInfo();
            }
            else
            {
                Console.WriteLine("Select character before loading outfit");
            }
        }