Пример #1
0
        public MapleBuddy AddAccountBuddyRequest(int accountId, string name)
        {
            AccountBuddies.Remove(accountId);
            MapleBuddy buddy = new MapleBuddy(0, accountId, name, DEFAULT_GROUP, true, string.Empty);

            AccountBuddies.Add(accountId, buddy);
            return(buddy);
        }
Пример #2
0
        public MapleBuddy AddCharacterBuddyRequest(int characterId, string name)
        {
            CharacterBuddies.Remove(characterId);
            MapleBuddy newBuddy = new MapleBuddy(characterId, 0, name, DEFAULT_GROUP, true, string.Empty);

            CharacterBuddies.Add(characterId, newBuddy);
            return(newBuddy);
        }
Пример #3
0
            public static PacketWriter UpdateBuddy(MapleBuddy buddy)
            {
                PacketWriter pw = new PacketWriter(SendHeader.BuddyList);

                pw.WriteByte(0x15);
                pw.WriteInt(buddy.CharacterId);
                pw.WriteInt(buddy.AccountId);
                AddBuddyInfo(pw, buddy);
                pw.WriteByte(0);
                return(pw);
            }
Пример #4
0
        public MapleBuddy AddAccountBuddy(int accountId, string nickName, string group, string memo)
        {
            if (TotalBuddies >= 50 || AccountBuddies.ContainsKey(accountId))
            {
                return(null);
            }
            MapleBuddy buddy = new MapleBuddy(0, accountId, nickName, group, false, memo);

            AccountBuddies.Add(accountId, buddy);
            return(buddy);
        }
Пример #5
0
        public MapleBuddy AddCharacterBuddy(int characterId, string name, string group, string memo)
        {
            if (TotalBuddies >= 50 || CharacterBuddies.ContainsKey(characterId))
            {
                return(null);
            }
            MapleBuddy buddy = new MapleBuddy(characterId, 0, name, group, false, memo);

            CharacterBuddies.Add(characterId, buddy);
            return(buddy);
        }
Пример #6
0
 public static void AddBuddyInfo(PacketWriter pw, MapleBuddy buddy)
 {
     pw.WriteInt(buddy.CharacterId);
     pw.WriteStaticString(buddy.Name, 13);
     if (buddy.IsRequest)
     {
         pw.WriteByte(buddy.AccountBuddy ? (byte)6 : (byte)1);
     }
     else
     {
         pw.WriteByte(buddy.AccountBuddy ? (byte)7 : (byte)2);
     }
     pw.WriteInt(buddy.Channel);
     pw.WriteStaticString(buddy.Group, 16);
     pw.WriteShort(0); //I think this is a null terminator for group name and another byte
     pw.WriteInt(buddy.AccountId);
     pw.WriteStaticString(buddy.NickName, 13);
     pw.WriteStaticString(buddy.Memo, 256);
     pw.WriteInt(0);
 }