예제 #1
0
        private async Task <string> AddGroup(string nameGroup, string typeGroup, List <string> invitedPeople)
        {
            string pathGroup;

            switch (typeGroup)
            {
            case "pg":
                pathGroup = Path.Combine(messenger.Server.PublicGroupPath, nameGroup);
                break;

            default:     //(sg)
                pathGroup = Path.Combine(messenger.Server.SecretGroupPath, nameGroup);
                break;
            }
            FileMaster.CreateDirectory(pathGroup);
            await FileMaster.UpdateFile(Path.Combine(pathGroup, "users.json"), FileMaster.AddData(user.Nickname));

            await FileMaster.UpdateFile(Path.Combine(pathGroup, "invitation.json"), FileMaster.AddSomeData(invitedPeople));

            return(pathGroup);
        }
예제 #2
0
 private async void BanOnIP(UserNicknameAndPasswordAndIPs user)
 {
     BanOnNickname(user);
     await FileMaster.UpdateFile(Path.Combine(messenger.Server.BansPath, "IPsBun.json"), FileMaster.AddSomeData(user.IPs));
 }