?? setsharelistpacket.java
字號(hào):
/*
* LumaQQ - Java QQ Client
*
* Copyright (C) 2004 luma <stubma@163.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.tsinghua.lumaqq.qq.packets.out.disk;
import java.nio.ByteBuffer;
import java.util.List;
import edu.tsinghua.lumaqq.qq.QQ;
import edu.tsinghua.lumaqq.qq.annotation.DocumentalPacket;
import edu.tsinghua.lumaqq.qq.annotation.PacketName;
import edu.tsinghua.lumaqq.qq.annotation.RelatedPacket;
import edu.tsinghua.lumaqq.qq.beans.QQUser;
import edu.tsinghua.lumaqq.qq.packets.DiskOutPacket;
import edu.tsinghua.lumaqq.qq.packets.PacketParseException;
import edu.tsinghua.lumaqq.qq.packets.in.disk.SetShareListReplyPacket;
/**
* <pre>
* 設(shè)置共享列表
* 1. 頭部
* 2. 某個(gè)加密串的長(zhǎng)度,4字節(jié)
* 3. 某個(gè)加密串
* Note: 加密串怎么得到,還不清楚。但是好像不影響功能
* 4. 屬主,4字節(jié)
* 5. 要共享的目錄id,4字節(jié)
* 6. 目錄屬性,4字節(jié)
* 7. 操作的好友數(shù)目,4字節(jié)
* 8. 好友QQ號(hào),4字節(jié)
* 9. 屬性,4字節(jié)
* Note: 9部分用來標(biāo)識(shí)操作的類型,比如如果共享位被置位,則表示添加這個(gè)好友,否則是刪除這個(gè)好友
* 10. 如果有更多好友,重復(fù)8-9部分
* </pre>
*
* @author luma
*/
@DocumentalPacket
@PacketName("修改共享設(shè)置請(qǐng)求包")
@RelatedPacket({SetShareListReplyPacket.class})
public class SetShareListPacket extends DiskOutPacket {
private int owner;
private int dirId;
private int property;
private List<Integer> remove;
private List<Integer> add;
public SetShareListPacket(ByteBuffer buf, int length, QQUser user) throws PacketParseException {
super(buf, length, user);
}
public SetShareListPacket(QQUser user) {
super(QQ.QQ_DISK_CMD_SET_SHARE_LIST, user);
}
@Override
public String getPacketName() {
return "Set Share List Packet";
}
@Override
protected void putBody(ByteBuffer buf) {
buf.putInt(0);
buf.putInt(owner);
buf.putInt(dirId);
buf.putInt(property);
int size = (remove == null ? 0 : remove.size()) + (add == null ? 0 : add.size());
buf.putInt(size);
for(Integer qq : add) {
buf.putInt(qq);
buf.putInt(QQ.QQ_DISK_FLAG_DIRECTORY | QQ.QQ_DISK_FLAG_SHARED);
}
for(Integer qq : remove) {
buf.putInt(qq);
buf.putInt(QQ.QQ_DISK_FLAG_DIRECTORY);
}
}
/**
* @return the add
*/
public List<Integer> getAdd() {
return add;
}
/**
* @param add the add to set
*/
public void setAdd(List<Integer> add) {
this.add = add;
}
/**
* @return the dirId
*/
public int getDirId() {
return dirId;
}
/**
* @param dirId the dirId to set
*/
public void setDirId(int dirId) {
this.dirId = dirId;
}
/**
* @return the owner
*/
public int getOwner() {
return owner;
}
/**
* @param owner the owner to set
*/
public void setOwner(int owner) {
this.owner = owner;
}
/**
* @return the remove
*/
public List<Integer> getRemove() {
return remove;
}
/**
* @param remove the remove to set
*/
public void setRemove(List<Integer> remove) {
this.remove = remove;
}
/**
* @return the property
*/
public int getProperty() {
return property;
}
/**
* @param property the property to set
*/
public void setProperty(int property) {
this.property = property;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -