本文整理汇总了C++中CNetMsg::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ CNetMsg::Init方法的具体用法?C++ CNetMsg::Init怎么用?C++ CNetMsg::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNetMsg
的用法示例。
在下文中一共展示了CNetMsg::Init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UserRegRepMsg
void UserRegRepMsg(CNetMsg& msg, int subno, int userindex, BM_USER_REG_ERROR_TYPE errcode)
{
msg.Init(BM_USER_REG_REP);
msg << subno
<< userindex
<< errcode;
}
示例2: SupItemRepMsg
void SupItemRepMsg(CNetMsg& rmsg, int charindex, bool isstart, CSupItem ** supItem )
{
// listmsg
// listflag userindex charindex count a_index itemindex itemflag itemplus itemcount
int listflag = 0, userindex;
if(isstart)
listflag |= (1 << 0);
userindex = (*supItem)->userId();
rmsg.Init(BM_ITEM_REP);
CNetMsg temp;
temp.Init();
for(int i = 0; i < 20 && (*supItem); i++)
{
temp << (*supItem)->index()
<< (*supItem)->itemIndex()
<< (*supItem)->itemFlag()
<< (*supItem)->itemPlus()
<< (*supItem)->itemCount();
GAMELOG << init("BillItem_List");
GAMELOG << (*supItem)->index() << delim
<< (*supItem)->catalId() << delim
<< (*supItem)->server() << delim
<< (*supItem)->userId() << delim
<< (*supItem)->itemIndex() << delim
<< (*supItem)->itemFlag() << delim
<< (*supItem)->itemPlus() << delim
<< (*supItem)->itemCount() << delim
<< i
<< end;
(*supItem) = (*supItem)->next();
}
if( !(*supItem) ) listflag |= (1 << 1);
rmsg << listflag
<< userindex
<< charindex;
rmsg << i << temp;
}
示例3: StashSealMsg
void StashSealMsg(CNetMsg &m_msg, int m1, int m2, char m3) // CHECKED
{
m_msg.Init(112);
m_msg.__ls((unsigned char)14);
m_msg.__ls((int)m1);
m_msg.__ls((int)m2);
m_msg.__ls((char)m3);
}
示例4: PreopenGiftErrorMsg
void PreopenGiftErrorMsg(CNetMsg &m_msg, int m1, int m2, _tagMsgConnErrorCode m3) // CHECKED
{
m_msg.Init(112);
m_msg.__ls((unsigned char)9);
m_msg.__ls((int)m1);
m_msg.__ls((int)m2);
m_msg.__ls((char)m3);
}
示例5: SetItemRepMsg
void SetItemRepMsg(CNetMsg& rmsg, int userindex, int subno, int charindex, MSG_BBILLINFO_ITEM_ERROR_TYPE subtype)
{
rmsg.Init(BM_SET_ITEM_REP);
rmsg << userindex
<< subno
<< charindex
<< (char) subtype;
}
示例6: CashBalanceRepMsg
void CashBalanceRepMsg(CNetMsg& msg, BILL_ERROR_MESSAGE_TYPE errcode, char gameID, int userindex, int cpID, int balance)
{
msg.Init(MSG_BILLITEM_CASHBALANCE_REP);
msg << (unsigned char) errcode
<< gameID
<< userindex
<< cpID
<< balance;
}
示例7: ConnCashItemPurchaseHistoryRep
void ConnCashItemPurchaseHistoryRep(CNetMsg::SP& msg, int userindex, int charindex, int y, int m, int d)
{
CLCString sql(4096);
int ctid = -1, preCtid = -1, i;
sql.Format("select * from t_purchase0%d where a_user_idx = %d and a_server = %d "
"and year(a_pdate) = %d and month(a_pdate) = %d and dayofmonth(a_pdate) = %d order by a_ctid ", userindex % 10, userindex, gserver.m_serverno, y, m, d);
CDBCmd cmd;
cmd.Init(&gserver.m_dbuser);
cmd.SetQuery(sql);
msg->Init(MSG_CONN_REP);
RefMsg(msg) << (unsigned char) MSG_CONN_CASHITEM_PURCHASEHISTORY_REP;
i = 0;
if( !cmd.Open() )
{
RefMsg(msg) << charindex
<< (unsigned char) MSG_EX_CASHITEM_ERROR_CONN << i;
return;
}
if( !cmd.MoveFirst() )
{
RefMsg(msg) << charindex
<< (unsigned char) MSG_EX_CASHITEM_ERROR_SUCCESS << i;
return;
}
CNetMsg ctmsg;
ctmsg.Init();
int j = 1;
do
{
cmd.GetRec("a_ctid", ctid);
if( preCtid != -1 && preCtid != ctid )
{
ctmsg << i
<< preCtid;
i = 0;
j++;
}
preCtid = ctid;
i++;
}
while(cmd.MoveNext() );
ctmsg << i << ctid;
RefMsg(msg) << charindex
<< (unsigned char) MSG_EX_CASHITEM_ERROR_SUCCESS << j << ctmsg;
}
示例8: StashCheckPasswordMsg
void StashCheckPasswordMsg(CNetMsg &m_msg, int m1, int m2, char m3) // CHECKED
{
m_msg.Init(112);
m_msg.__ls((char)12);
m_msg.__ls((int)m1);
m_msg.__ls((int)m2);
m_msg.__ls((char const *)"");
m_msg.__ls((char)m3);
}
示例9: StashChangePasswordMsg
void StashChangePasswordMsg(CNetMsg &m_msg, int m1, int m2, char const *m3, char m4) // CHECKED
{
m_msg.Init(112);
m_msg.__ls((unsigned char)13);
m_msg.__ls((int)m1);
m_msg.__ls((int)m2);
m_msg.__ls((char const *)"");
m_msg.__ls((char const *)m3);
m_msg.__ls((char)m4);
}
示例10: MsgrLogoutRepMsg
void MsgrLogoutRepMsg(CNetMsg &netmsg, int a2, int a3, int a4, int a5, char a6, const char *a7)
{
netmsg.Init(102);
netmsg.__ls(a2);
netmsg.__ls(a3);
netmsg.__ls(a4);
netmsg.__ls(a5);
netmsg.__ls(9);
netmsg.__ls(a6);
netmsg.__ls(a7);
}
示例11: MsgrWhisperNotfoundMsg
void MsgrWhisperNotfoundMsg(CNetMsg &netmsg, int a2, int a3, int a4, int a5, int a6, const char *a7)
{
netmsg.Init(102);
netmsg.__ls(a2);
netmsg.__ls(a3);
netmsg.__ls(a4);
netmsg.__ls(5);
netmsg.__ls(3);
netmsg.__ls(a6);
netmsg.__ls(a7);
}
示例12: LogoutReqMsg
void LogoutReqMsg(CNetMsg &m_msg, int a1, int a2, int a3, CDescriptor *m_desc) // CHECKED
{
m_msg.Init(101);
m_msg.__ls((int)0);
m_msg.__ls((int)a1);
m_msg.__ls((int)a2);
m_msg.__ls((int)a3);
m_msg.__ls((unsigned char)6);
m_msg.__ls((char const *)m_desc->Username);
m_msg.__ls((char const *)m_desc->Password);
}
示例13: PayRepMsg
void PayRepMsg(CNetMsg& msg, BM_PAY_ERROR_TYPE errcode, int subno, int userindex, CUser* user, int isauto)
{
msg.Init(BM_PAY_REP);
msg << subno
<< userindex
<< errcode;
if (user)
{
msg << user->billguid()
<< user->billviewname()
<< user->billsection()
<< user->surplus()
<< user->endtime_year()
<< user->endtime_mon()
<< user->endtime_day()
<< user->endtime_hour()
<< user->endtime_min()
<< user->RemainTime();
if (user->reserve_found())
{
msg << 1
<< user->reserve_billguild()
<< user->reserve_billvalue()
<< user->reserve_billname();
}
else
{
msg << 0
<< ""
<< 0
<< "";
}
}
else
{
msg << ""
<< ""
<< 0
<< 0
<< 0
<< 0
<< 0
<< 0
<< 0
<< 0
<< 0
<< ""
<< 0
<< "";
}
msg << isauto;
}
示例14: MsgrWhisperRep
void MsgrWhisperRep(CNetMsg &netmsg, int a2, int a3, int a4, int a5, int a6, const char *a7, const char *a8, const char *a9)
{
netmsg.Init(102);
netmsg.__ls(a2);
netmsg.__ls(a3);
netmsg.__ls(a4);
netmsg.__ls(a5);
netmsg.__ls(1);
netmsg.__ls(a6);
netmsg.__ls(a7);
netmsg.__ls(a8);
netmsg.__ls(a9);
}
示例15: CanBuyRepMsg
void CanBuyRepMsg(CNetMsg& msg, BILL_ERROR_MESSAGE_TYPE errcode, char gameID, int userindex, int cpID, char count, const int itemID[], int balance)
{
msg.Init(MSG_BILLITEM_CANBUY_REP);
msg << (unsigned char) errcode
<< gameID
<< userindex
<< cpID
<< count;
for(int i = 0; i < count; i++)
msg << itemID[i];
msg << balance;
}