当前位置: 首页>>代码示例>>C++>>正文


C++ SocketOutputStream::Write方法代码示例

本文整理汇总了C++中SocketOutputStream::Write方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketOutputStream::Write方法的具体用法?C++ SocketOutputStream::Write怎么用?C++ SocketOutputStream::Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocketOutputStream的用法示例。


在下文中一共展示了SocketOutputStream::Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Write

BOOL CGBBSSychMessages::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_objID), sizeof(ObjID_t));
	oStream.Write( (CHAR*)(&m_Opt), sizeof(BYTE));
	switch(m_Opt)
	{
	case OPT_NEW_MESSAGE:
		{
			oStream.Write( (CHAR*)(&m_nLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData), m_nLength);
		}
		break;
	case OPT_REPLY_MESSAGE:
		{
			oStream.Write( (CHAR*)(&m_nID), sizeof(UINT));
			oStream.Write( (CHAR*)(&m_nLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData), m_nLength);
		}
		break;
	case OPT_DEL_MESSAGE:
		{
			oStream.Write( (CHAR*)(&m_nID), sizeof(UINT));
		}
		break;
	case OPT_SET_TITLE:
		{
			oStream.Write( (CHAR*)(&m_nLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData), m_nLength);
		}
		break;

	}

	return TRUE ;

	__LEAVE_FUNCTION

	return FALSE ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:41,代码来源:CGBBSSychMessages.cpp

示例2: Write

BOOL CGConnect::Write( SocketOutputStream& oStream )const
{
__ENTER_FUNCTION

    oStream.Write( (CHAR*)(&m_Key), sizeof(UINT) ) ;
    oStream.Write( (CHAR*)(&m_GUID), sizeof(GUID_t) ) ;
    oStream.Write( (CHAR*)(&m_ServerID), sizeof(ID_t) ) ;
    oStream.Write( (CHAR*)(&m_szAccount), sizeof(CHAR)*MAX_ACCOUNT ) ;
    oStream.Write( (CHAR*)(&m_nGender), sizeof(INT) ) ;
    oStream.Write( (CHAR*)(&m_nCheckVer), sizeof(INT) ) ;

    return TRUE ;

__LEAVE_FUNCTION

    return FALSE ;
}
开发者ID:gangzi4494,项目名称:web-pap,代码行数:17,代码来源:CGConnect.cpp

示例3: Write

BOOL GWSearchHorseFindMateInfo::Write( SocketOutputStream& oStream ) const
{
__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_szHorseName), sizeof(m_szHorseName) );
	oStream.Write( (CHAR*)(&m_iHorseLevel), sizeof(m_iHorseLevel));
	oStream.Write( (CHAR*)(&m_iHorseSex), sizeof(m_iHorseSex));
	oStream.Write( (CHAR*)(&m_iHorseGrowRate), sizeof(m_iHorseGrowRate));
	oStream.Write( (CHAR*)(&m_PlayerID), sizeof(m_PlayerID));
	oStream.Write( (CHAR*)(&m_iMaxPostion), sizeof(m_iMaxPostion));

	return TRUE;

__LEAVE_FUNCTION

	return FALSE;
}
开发者ID:rvpoochen,项目名称:wxsj2,代码行数:17,代码来源:GWSearchHorseFindMateInfo.cpp

示例4: Write

BOOL  LWAskCharLogin::Write( SocketOutputStream& oStream )const
{
    __ENTER_FUNCTION

    oStream.Write( (CHAR*)(&szAccount), sizeof(CHAR)*MAX_ACCOUNT);
    oStream.Write( (CHAR*)(&PlayerID), sizeof(PlayerID_t));
    oStream.Write( (CHAR*)(&PlayerGUID), sizeof(GUID_t));
    oStream.Write( (CHAR*)(&uKey), sizeof(UINT));
    oStream.Write( (CHAR*)(&AskStatus), sizeof(ASK_LOGINSTATUS));
    if(AskStatus == ALS_SENDDATA)
    {
        oStream.Write( (CHAR*)(&UserData), sizeof(FULLUSERDATA));
    }
    oStream.Write( (CHAR*)(&Age), sizeof(BYTE));

    return TRUE ;

    __LEAVE_FUNCTION

    return FALSE ;
}
开发者ID:gangzi4494,项目名称:web-pap,代码行数:21,代码来源:LWAskCharLogin.cpp

示例5: Write

BOOL GCNewPlayer_Move::Write( SocketOutputStream& oStream )const
{
__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_ObjID), sizeof(ObjID_t));
	oStream.Write( (CHAR*)(&m_nHandleID), sizeof(m_nHandleID));
	oStream.Write( (CHAR*)(&m_posWorld), sizeof(WORLD_POS));
	oStream.Write( (CHAR*)(&m_wEquipVer), sizeof(WORD));

	oStream.Write( (CHAR*)(&m_fMoveSpeed), sizeof(FLOAT));
	oStream.Write( (CHAR*)(&m_posTarget), sizeof(WORLD_POS));

	return TRUE ;

__LEAVE_FUNCTION

	return FALSE ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:18,代码来源:GCNewPlayer_Move.cpp

示例6: Write

BOOL GCSouXiaList::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write((CHAR*)(&m_nSouXiaCount),sizeof(BYTE));
	
	if(m_nSouXiaCount>MAX_SOUXIA_CONTAINER) 
	{
		Assert(FALSE);
	}

	for(INT i=0; i<m_nSouXiaCount; i++)
	{
		if (m_SouXiaData[i].m_CurPos >= 0 && m_SouXiaData[i].m_SouXiaID > 0)
		{
			m_SouXiaData[i].WriteSouXiaVarAttr(oStream);
		}
	}
	return TRUE ;

	__LEAVE_FUNCTION

		return FALSE ;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:24,代码来源:GCSouXiaList.cpp

示例7: Write

BOOL GWAskChangeScene::Write( SocketOutputStream& oStream ) const
{
__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_Status), sizeof(BYTE) ) ;
	oStream.Write( (CHAR*)(&m_PlayerID), sizeof(PlayerID_t) ) ;
	oStream.Write( (CHAR*)(&m_GUID), sizeof(GUID_t) ) ;
	oStream.Write( (CHAR*)(&m_SourSceneID), sizeof(SceneID_t) ) ;
	oStream.Write( (CHAR*)(&m_DestSceneID), sizeof(SceneID_t) ) ;
	if( m_Status==CSS_DIFFSERVER )
		oStream.Write( (CHAR*)(&m_UserData), sizeof(FULLUSERDATA) ) ;
	oStream.Write( (CHAR*)(&m_uKey), sizeof(UINT) ) ;

	return TRUE ;

__LEAVE_FUNCTION

	return FALSE ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:19,代码来源:GWAskChangeScene.cpp

示例8: Write

BOOL LBAskAuth::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write( (CHAR*)(szAccount), sizeof(CHAR)*MAX_ACCOUNT) ;
	oStream.Write( (CHAR*)(szPassWord), sizeof(CHAR)*MAX_MD5_SIZE);
	oStream.Write((CHAR*)(&PlayerID),sizeof(PlayerID_t));
	oStream.Write((CHAR*)(&szIP),sizeof(CHAR)*MAX_BILLING_IP_SIZE);
	for(INT i = 0; i < MIBAOUNIT_NUMBER; ++i)
	{
		oStream.Write( (CHAR*)(mAllMiBaoKey[i]),sizeof(CHAR)*MIBAOUNIT_NAME_LENGTH);
	}
	for(INT i = 0; i < MIBAOUNIT_NUMBER; ++i)
	{
		oStream.Write( (CHAR*)(mAllMiBaoValue[i]),sizeof(CHAR)*MIBAOUNIT_VALUE_LENGTH);
	}
	oStream.Write( (CHAR*)(mMacAddr), sizeof(CHAR)*MAX_MD5_SIZE);
	return TRUE ;

	__LEAVE_FUNCTION

	return FALSE ;
}
开发者ID:rvpoochen,项目名称:wxsj2,代码行数:23,代码来源:LBAskAuth.cpp

示例9: Write

BOOL LCRetCharList::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write((CHAR*)(&Result),sizeof(ASKCHARLIST_RESULT));

	if(Result == ASKCHARLIST_SUCCESS)
	{
		oStream.Write( (CHAR*)(&szAccount), sizeof(CHAR)*MAX_ACCOUNT);
		
		if(uCharNumber>DB_CHAR_NUMBER)
		{
			Assert(FALSE);
			UCHAR RealNumber = DB_CHAR_NUMBER;
			oStream.Write((CHAR*)(&RealNumber),sizeof(UCHAR));
			for(UINT i =0;i<RealNumber;i++)
			{	
				oStream.Write((CHAR*)(&CharList[i]),sizeof(DB_CHAR_BASE_INFO));
			}
		}
		else
		{
			oStream.Write((CHAR*)(&uCharNumber),sizeof(UCHAR));
			for(UINT i =0;i<uCharNumber;i++)
			{	
				oStream.Write((CHAR*)(&CharList[i]),sizeof(DB_CHAR_BASE_INFO));
			}
		}
	}
		
	return TRUE ;

	__LEAVE_FUNCTION

		return FALSE ;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:36,代码来源:LCRetCharList.cpp

示例10: Write

BOOL GCBBSMessages::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_objID), sizeof(ObjID_t));
	oStream.Write( (CHAR*)(&m_Serial), sizeof(UINT));
	oStream.Write( (CHAR*)(&m_nTitleLength), sizeof(BYTE));
	oStream.Write( (CHAR*)(m_szTitle), m_nTitleLength);
	oStream.Write( (CHAR*)(&m_MessageNum), sizeof(BYTE));
	for(UINT i=0; i<m_MessageNum; i++)
	{
		oStream.Write( (CHAR*)(m_MessageData[i].AuthorName), MAX_BBS_MESSAGE_AUTHORLENGTH);
		oStream.Write( (CHAR*)(&m_MessageData[i].nID), sizeof(UINT));
		oStream.Write( (CHAR*)(&m_MessageData[i].nHour), sizeof(BYTE));
		oStream.Write( (CHAR*)(&m_MessageData[i].nMin), sizeof(BYTE));
		oStream.Write( (CHAR*)(&m_MessageData[i].bHasReply), sizeof(BYTE));
		if(m_MessageData[i].bHasReply)
		{
			oStream.Write( (CHAR*)(&m_MessageData[i].nReHour), sizeof(BYTE));
			oStream.Write( (CHAR*)(&m_MessageData[i].nReMin), sizeof(BYTE));

			oStream.Write( (CHAR*)(&m_MessageData[i].nMsgLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData[i].szMessage), m_MessageData[i].nMsgLength);

			oStream.Write( (CHAR*)(&m_MessageData[i].nReplyMsgLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData[i].szReplyMessage), m_MessageData[i].nReplyMsgLength);
		}
		else
		{
			oStream.Write( (CHAR*)(&m_MessageData[i].nMsgLength), sizeof(BYTE));
			oStream.Write( (CHAR*)(m_MessageData[i].szMessage), m_MessageData[i].nMsgLength);
		}
	}
	return TRUE ;

	__LEAVE_FUNCTION

	return FALSE ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:39,代码来源:GCBBSMessages.cpp

示例11: Write

VOID FINGER_BY_GUID::Write( SocketOutputStream &oStream ) const
{
	oStream.Write( (CHAR*)&m_TargetGUID, sizeof(m_TargetGUID) );
	oStream.Write( (CHAR*)&m_uOnlineFlag, sizeof(m_uOnlineFlag) );
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:5,代码来源:GameStruct_Finger.cpp

示例12: sizeof

BOOL    WGTeamAskApply::Write(SocketOutputStream& oStream )    const
{
__ENTER_FUNCTION

    oStream.Write( (CHAR*)(&m_PlayerID), sizeof(PlayerID_t) );
    oStream.Write( (CHAR*)(&m_SourPlayerID), sizeof(PlayerID_t) );
    oStream.Write( (CHAR*)&m_SourGUID, sizeof(GUID_t) );
    oStream.Write( (CHAR*)&m_DestGUID, sizeof(GUID_t) );
    oStream.Write( (CHAR*)&m_SourNameSize, sizeof(UCHAR) );
    oStream.Write( (CHAR*)&m_DestNameSize, sizeof(UCHAR) );
    oStream.Write( (CHAR*)&m_GUID, sizeof(m_GUID) );

    if ( m_SourNameSize>0 )
    {
        oStream.Write((CHAR*)&m_SourName, m_SourNameSize);
    }

    if ( m_DestNameSize>0 )
    {
        oStream.Write((CHAR*)&m_DestName, m_DestNameSize);
    }

    oStream.Write( (CHAR*)&m_uFamily, sizeof(UINT) );
    oStream.Write( (CHAR*)&m_Scene, sizeof(SceneID_t) );
    oStream.Write( (CHAR*)&m_Level, sizeof(INT) );
    oStream.Write( (CHAR*)&m_uDataID, sizeof(m_uDataID) );

    return TRUE;

__LEAVE_FUNCTION

    return FALSE;
}
开发者ID:gangzi4494,项目名称:web-pap,代码行数:33,代码来源:WGTeamAskApply.cpp

示例13: Write

VOID WG_RELATION::Write( SocketOutputStream& oStream ) const
{
    oStream.Write( (CHAR*)&m_PlayerID, sizeof(m_PlayerID) );
    oStream.Write( (CHAR*)&m_Type, sizeof(m_Type) );

    switch( m_Type )
    {
    case RET_RELATIONINFO:
        m_RelationInfo.Write( oStream );
        break;
    case RET_VIEWPLAYER:
        m_ViewPlayer.Write( oStream );
        break;
    case RET_TARGETNOTONLINE:
    case RET_RELATIONOFFLINE:
    case RET_DELFROMENEMY:
    case RET_DELFRIENDBYMAIL:
    case RET_DELFRIENDFORADDENEMY:
        m_RelationGUID.Write( oStream );
        break;
    case RET_ADDFRIEND:
    case RET_ADDTOBLACKLIST:
    case RET_TEMPFRIEND_TO_FRIEND:
    case RET_TEMPFRIEND_ADDTO_BLACKLIST:
    case RET_ADDENEMY:
        m_AddRelation.Write( oStream );
        break;
    case RET_ADDFRIENDNOTIFY:
    case RET_ASKADDFRIEND:
    case RET_REJECTADDFRIEND:
    case RET_ASKADDTOBLACKLIST:
    case RET_ASKTHROWTOFRIENDLIST:
    case RET_FRIENDADDPOINT:
        m_NotifyFriend.Write( oStream );
        break;
    case RET_ONLINELIST:
        m_RelationOnline.Write( oStream );
        break;
    case RET_RELATIONONLINE:
        m_NotifyOnline.Write( oStream );
        break;
    case RET_NOTIFY_ADDTEMPFRIEND:
        m_PlayerName.Write( oStream );
        break;
    case RET_NEW_GROUP:
        m_AddNewGroup.Write( oStream );
        break;
    case RET_ERR_TARGETNOTEXIST:
    case RET_ERR_ISFRIEND:
    case RET_ERR_ISBLACKNAME:
    case RET_ERR_SPOUSETOBLACKLIST:
    case RET_ERR_MASTERTOBLACKLIST:
    case RET_ERR_PRENTICETOBLACKLIST:
    case RET_ERR_BROTHERTOBLACKLIST:
    case RET_ERR_CANNOT_ADDFRIEND:
    case RET_ERR_CANNOTRECEIVEMAIL:
    case RET_ERR_NOTRECVSTRANGEMAIL:
        break;
    default:
        Assert(FALSE);
        return;
    }
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:63,代码来源:GameStruct_Relation.cpp

示例14: Write

BOOL GCExchangeSynchII::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_IsMyself), sizeof(BYTE));
	oStream.Write( (CHAR*)(&m_Opt), sizeof(BYTE));

	if(m_IsMyself)
	{//给自己盒子里加东西
		switch (m_Opt)
		{
		case EXCHANGE_MSG::OPT_ADDITEM:
			{
				oStream.Write( (CHAR*)(&m_FromType), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_FromIndex), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
			}
			break;
		case EXCHANGE_MSG::OPT_REMOVEITEM:
			{
				oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_FromIndex), sizeof(BYTE));
			}
			break;
		case EXCHANGE_MSG::OPT_MONEY:
			{
				oStream.Write( (CHAR*)(&m_Money), sizeof(UINT));
			}
			break;
		case EXCHANGE_MSG::OPT_REMOVEMONEY:
			{
				oStream.Write( (CHAR*)(&m_Money), sizeof(UINT));
			}
			break;
		case EXCHANGE_MSG::OPT_ADDPET:
			{
				oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
			}
			break;
		case EXCHANGE_MSG::OPT_REMOVEPET:
			{
				oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
			}
			break;
		default:
			break;
		}
	}
	else
	{//给对方盒子里加东西
		switch (m_Opt)
		{
		case EXCHANGE_MSG::OPT_ADDITEM:
			{
				oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_ExItem.isBlueEquip), sizeof(BYTE));
				oStream.Write( (CHAR*)(&m_ExItem.byNumber), sizeof(BYTE));
				if(m_ExItem.isBlueEquip)
				{
					m_ExItem.item_data.WriteItemVarAttr(oStream);
				}
				else
				{
					oStream.Write( (CHAR*)(&m_ExItem.uBagPos), sizeof(UINT));
				}
			}
			break;
		case EXCHANGE_MSG::OPT_REMOVEITEM:
			{
				oStream.Write( (CHAR*)(&m_FromIndex), sizeof(BYTE));
			}
			break;
		case EXCHANGE_MSG::OPT_MONEY:
			{
				oStream.Write( (CHAR*)(&m_Money), sizeof(UINT));
			}
			break;
		case EXCHANGE_MSG::OPT_REMOVEMONEY:
			{
				oStream.Write( (CHAR*)(&m_Money), sizeof(UINT));
			}
			break;
		case EXCHANGE_MSG::OPT_ADDPET:
			break;
		case EXCHANGE_MSG::OPT_REMOVEPET:
			{
				oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
			}
			break;
		default:
			break;
		}
	}
	return TRUE ;

	__LEAVE_FUNCTION

		return FALSE ;
//.........这里部分代码省略.........
开发者ID:rvpoochen,项目名称:wxsj2,代码行数:101,代码来源:GCExchangeSynchII.cpp

示例15: Write

BOOL CGItemSynch::Write( SocketOutputStream& oStream )const
{
	__ENTER_FUNCTION

	oStream.Write( (CHAR*)(&m_Opt), sizeof(BYTE));
	switch(m_Opt)
	{
	case OPT_MOVE_ITEM_AUTO:
		{
			oStream.Write( (CHAR*)(&m_FromType), sizeof(BYTE));
			switch(m_FromType)
			{
			case POS_BAG:
			case POS_EQUIP:
			case POS_BANK:
			case POS_PLAYERSHOP:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_ItemGuid), sizeof(_ITEM_GUID));
				}
				break;
			case POS_PET:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
				}
				break;
			case POS_PLAYERSHOPPET:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
				}
				break;
			default:
				break;
			}
		}
		break;
	case OPT_MOVE_ITEM_MANU:
		{
			oStream.Write( (CHAR*)(&m_FromType), sizeof(BYTE));

			switch(m_FromType)
			{
			case POS_BAG:
			case POS_EQUIP:
			case POS_BANK:
			case POS_PLAYERSHOP:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_ItemGuid), sizeof(_ITEM_GUID));
				}
				break;
			case POS_PET:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
				}
				break;
			case POS_PLAYERSHOPPET:
				{
					oStream.Write( (CHAR*)(&m_ToType), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_ToIndex), sizeof(BYTE));
					oStream.Write( (CHAR*)(&m_PetGuid), sizeof(PET_GUID_t));
				}
				break;
			default:
				break;
			}
		}
		break;
	default:
		break;
	}
	oStream.Write( (CHAR*)(&m_ExtraInfoLength), sizeof(BYTE));
	oStream.Write( (CHAR*)(m_ExtraInfoData), m_ExtraInfoLength);
	return TRUE ;

	__LEAVE_FUNCTION

		return FALSE ;
}
开发者ID:rvpoochen,项目名称:wxsj2,代码行数:84,代码来源:CGItemSynch.cpp


注:本文中的SocketOutputStream::Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。