public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readUnsignedInt32(ref dwType); bu.readUnsignedInt32(ref dwSysInfoType); bu.readMultiByte(ref pstrName, ProtoCV.MAX_NAMESIZE, GkEncode.UTF8); bu.readMultiByte(ref pstrChat, ProtoCV.MAX_CHATINFO, GkEncode.UTF8); bu.readUnsignedInt32(ref dwFromID); bu.readUnsignedInt32(ref dwChannelID); }
public bool readArchiveFileHeader(FileStream fileHandle, ByteBuffer pMByteBuffer) { pMByteBuffer.clear (); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, 4); pMByteBuffer.length = 4; string magic = ""; pMByteBuffer.readMultiByte(ref magic, 4, Encoding.UTF8); if (magic != "asdf") // 检查 magic { return false; } pMByteBuffer.clear (); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, (int)calcArchiveHeaderSizeNoFileHeader() - 4); pMByteBuffer.length = calcArchiveHeaderSizeNoFileHeader() - 4; // 读取 endian pMByteBuffer.readUnsignedInt8(ref m_endian); pMByteBuffer.setEndian((Endian)m_endian); // 读取头部大小 pMByteBuffer.readUnsignedInt32(ref m_headerSize); // 读取版本 pMByteBuffer.readUnsignedInt32(ref m_version); // 读取文件数量 pMByteBuffer.readUnsignedInt32(ref m_fileCount); // 读取整个头 pMByteBuffer.clear (); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, (int)(m_headerSize - calcArchiveHeaderSizeNoFileHeader())); pMByteBuffer.length = m_headerSize - calcArchiveHeaderSizeNoFileHeader (); return true; }
public bool readArchiveFileHeader(FileStream fileHandle, ByteBuffer pMByteBuffer) { pMByteBuffer.clear(); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, 4); pMByteBuffer.length = 4; string magic = ""; pMByteBuffer.readMultiByte(ref magic, 4, Encoding.UTF8); if (magic != "asdf") // 检查 magic { return(false); } pMByteBuffer.clear(); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, (int)calcArchiveHeaderSizeNoFileHeader() - 4); pMByteBuffer.length = calcArchiveHeaderSizeNoFileHeader() - 4; // 读取 endian pMByteBuffer.readUnsignedInt8(ref m_endian); pMByteBuffer.setEndian((Endian)m_endian); // 读取头部大小 pMByteBuffer.readUnsignedInt32(ref m_headerSize); // 读取版本 pMByteBuffer.readUnsignedInt32(ref m_version); // 读取文件数量 pMByteBuffer.readUnsignedInt32(ref m_fileCount); // 读取整个头 pMByteBuffer.clear(); fileHandle.Read(pMByteBuffer.dynBuff.buff, 0, (int)(m_headerSize - calcArchiveHeaderSizeNoFileHeader())); pMByteBuffer.length = m_headerSize - calcArchiveHeaderSizeNoFileHeader(); return(true); }
public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readUnsignedInt32(ref reserve); bu.readUnsignedInt32(ref version); bu.readMultiByte(ref testStr, 100, GkEncode.UTF8); }
public void readHeaderFromArchiveFile(ByteBuffer bu) { bu.readUnsignedInt8(ref m_pathLen); bu.readMultiByte(ref m_fileNamePath, m_pathLen, Encoding.UTF8); bu.readUnsignedInt32(ref m_fileOffset); bu.readUnsignedInt32(ref m_fileSize); bu.readUnsignedInt32(ref m_flags); }
public void readHeaderFromArchiveFile(ByteBuffer bu) { bu.readUnsignedInt8(ref m_pathLen); bu.readMultiByte(ref m_fileNamePath, m_pathLen, Encoding.UTF8); bu.readUnsignedInt32(ref m_fileOffset); bu.readUnsignedInt32(ref m_fileSize); bu.readUnsignedInt32(ref m_flags); }
public void derialize(ByteBuffer bu) { bu.readUnsignedInt32(ref id); bu.readMultiByte(ref name, ProtoCV.MAX_NAMESIZE + 1, GkEncode.UTF8); bu.readUnsignedInt16(ref type); bu.readUnsignedInt16(ref level); bu.readUnsignedInt32(ref mapid); bu.readMultiByte(ref mapName, ProtoCV.MAX_NAMESIZE + 1, GkEncode.UTF8); bu.readUnsignedInt16(ref country); bu.readMultiByte(ref countryName, ProtoCV.MAX_NAMESIZE + 1, GkEncode.UTF8); bu.readUnsignedInt32(ref bitmask); bu.readUnsignedInt32(ref zone_state); bu.readUnsignedInt32(ref target_zone); bu.readUnsignedInt32(ref model1); bu.readUnsignedInt32(ref model2); bu.readUnsignedInt32(ref model3); bu.readUnsignedInt32(ref model4); bu.readUnsignedInt32(ref model5); bu.readUnsignedInt32(ref model6); bu.readUnsignedInt32(ref model7); bu.readUnsignedInt32(ref model8); bu.readUnsignedInt32(ref model9); bu.readUnsignedInt32(ref model10); bu.readUnsignedInt32(ref model11); bu.readUnsignedInt32(ref model12); bu.readUnsignedInt32(ref model13); bu.readUnsignedInt32(ref model14); bu.readUnsignedInt32(ref model15); bu.readUnsignedInt32(ref model16); bu.readUnsignedInt8(ref effect11); bu.readUnsignedInt8(ref effect12); bu.readUnsignedInt8(ref effect13); bu.readUnsignedInt8(ref effect14); bu.readUnsignedInt8(ref effect15); bu.readUnsignedInt8(ref effect16); bu.readUnsignedInt8(ref effect17); bu.readUnsignedInt8(ref effect18); bu.readUnsignedInt16(ref job); bu.readUnsignedInt8(ref height); bu.readUnsignedInt8(ref weight); bu.readUnsignedInt16(ref picbindloginclearnum); }
public override void derialize(ByteBuffer bu) { base.derialize(bu); charInfo = new SelectUserInfo[ProtoCV.MAX_CHARINFO]; int idx = 0; while(idx < ProtoCV.MAX_CHARINFO) { charInfo[idx].derialize(bu); ++idx; } bu.readUnsignedInt16(ref size); if(size > 0) { bu.readMultiByte(ref data, size, GkEncode.UTF8); } }
public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readUnsignedInt32(ref dwUserID); bu.readUnsignedInt32(ref loginTempID); bu.readMultiByte(ref pstrIP, ProtoCV.MAX_IP_LENGTH, GkEncode.UTF8); bu.readUnsignedInt16(ref wdPort); keyAux = new ByteBuffer(); byte[] ret = new byte[256]; bu.readBytes(ref ret, 256); keyAux.writeBytes(ret, 0, 256); keyAux.position = 58; byte index = 0; keyAux.readUnsignedInt8(ref index); keyAux.position = index; key = new byte[8]; keyAux.readBytes(ref key, 8); bu.readUnsignedInt32(ref state); }
protected void testBA() { string str = "测试数据"; ByteBuffer bu = new ByteBuffer(); bu.writeMultiByte(str, GkEncode.UTF8, 24); bu.position = 0; string ret = ""; bu.readMultiByte(ref ret, 24, GkEncode.UTF8); }
public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readMultiByte(ref pstrIP, (int)ProtoCV.MAX_IP_LENGTH, GkEncode.UTF8); bu.readUnsignedInt16(ref port); }
public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readUnsignedInt32(ref index); bu.readMultiByte(ref name, ProtoCV.MAX_NAMESIZE + 1, GkEncode.UTF8); }