www.pudn.com > XmudOSr.rar > CmdChannel.cpp
#include "stdafx.h" #include "XMudClient.h" #include "CommandCheck.h" #include "MenuCreateNew.h" #include "CommandCheck.h" #include "MainScreen.h" extern rmfullglobals myglobs; extern int g_nGameState; extern CMainScreen m_MainScreen; extern CListchatchannellist; void GetWhoOnline(CString szWhoOnline) { CChatChannel *lpChatChannel; int i,j; char *ps; CString strtmp; CStringList strls; CString parm = ("\t"); BOOL bFindHead = FALSE; if(!chatchannellist.IsEmpty()) chatchannellist.RemoveAll(); ps = strtok((char*)(LPCSTR)szWhoOnline,(const char*)parm); while (ps != NULL) { strls.AddTail(ps); ps = strtok(NULL,(const char*)parm); } j = strls.GetCount(); if (j < 8){ strtmp = szRedLow; strtmp += CString("聊天频道数据接收不正确,再试一次?"); AddSelfMsg(strtmp); return; } for(i=0;i m_sTITLE = strtmp; strtmp = strls.GetAt( strls.FindIndex(i+2)); lpChatChannel->m_sCNAME = strtmp; strtmp = strls.GetAt( strls.FindIndex(i+3)); lpChatChannel->m_sENAME = strtmp; strtmp = strls.GetAt( strls.FindIndex(i+4)); lpChatChannel->m_sSEX = strtmp; if(lpChatChannel->m_sSEX == "M") lpChatChannel->m_sSEX = "男"; else lpChatChannel->m_sSEX = "女"; strtmp = strls.GetAt( strls.FindIndex(i+5)); if(strtmp == "NULL") lpChatChannel->m_sNICKNAME.Empty(); else lpChatChannel->m_sNICKNAME = strtmp; strtmp = strls.GetAt( strls.FindIndex(i+6)); if(strtmp == "NULL") lpChatChannel->m_sFAMILY.Empty(); else lpChatChannel->m_sFAMILY = strtmp; strtmp = strls.GetAt( strls.FindIndex(i+8)); if(!lstrcmp("CHANNELDATAEND",strtmp)){ chatchannellist.AddTail(lpChatChannel); break; } i = i+7; chatchannellist.AddTail(lpChatChannel); } } strls.RemoveAll(); m_MainScreen.mFirstFD.nShowState = SHOWCHANNELUSER; m_MainScreen.mFirstFD.bReDraw[0] = TRUE; m_MainScreen.mFirstFD.bReDraw[1] = TRUE; }