//-------------------------------------------------------------------------------------------------------------- HostMessage::~HostMessage () { setMessageID (0); if (attributeList) attributeList->release (); FUNKNOWN_DTOR }
NewPlayerID::NewPlayerID(GameNetworkInterface *gameNetworkInterface) : Message(gameNetworkInterface) { m_networkData.playerID = ID_NONE; // Set up for network transmission via messages registerMessageType(MESSAGE_NEW_PLAYER_ID, &m_networkData, sizeof(NetworkData), UPDATE_FREQUENCY_ONCE); setMessageID(MESSAGE_ID_EVENT); }
int SendTextIMPacket::putContents(unsigned char *buf) { int pos=0; //multi-fragment information buf[pos++] = numFragments; buf[pos++] = seqFragments; memcpy(buf+pos, &messageID, 2); pos+=2; bool hasImage = false; std::string str2send = EvaUtil::convertToSend(message, &hasImage); buf[pos++] = hasImage?QQ_IM_IMAGE_REPLY:replyType; // auto-reply or not memcpy(buf+pos, str2send.c_str(), str2send.length()); pos += str2send.length(); if (getNumFragments() == (getSeqOfFragments() + 1)) { buf[pos++] = 0x20; // a space, witch is needed in the last fragment setMessageID(getMessageID() + 1); } buf[pos++] = 0x00; // C style string terminator buf[pos++] = fontFlag; buf[pos++] = red; buf[pos++] = green; buf[pos++] = blue; buf[pos++] = 0; short tmpEncoding = htons(encoding); // encoding for text memcpy(buf+pos,&tmpEncoding, 2); pos+=2; int len = fontName.length(); // font name memcpy(buf+pos, fontName.c_str(), len); pos+=len; buf[pos++] = 0x0D; // an Enter return pos; }