本文整理汇总了C++中NetAddress::getUin方法的典型用法代码示例。如果您正苦于以下问题:C++ NetAddress::getUin方法的具体用法?C++ NetAddress::getUin怎么用?C++ NetAddress::getUin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetAddress
的用法示例。
在下文中一共展示了NetAddress::getUin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onRecvServerConncectLogin
//-----------------------------------------------------------------------------
void ServerNetApplyManager::onRecvServerConncectLogin( I32 id, Char16* name, GameNetType type, U64 serverUniqueFlag, U32 serverId,U32 code ,Char8* serverVersion)
{
// 服务器版本验证
if (StrCmp(serverVersion,SERVER_VERSION_NUMBER))
{
Char8 desc[256] = {0};
//服务器版本不一致
SServerSetting& setting = SServerSetting::getInstance();
CoreInfo* coreInfo = setting.getCoreInfo();
if (!coreInfo)
{
DYNAMIC_ASSERT(false);
}
MGStrOp::sprintf(desc,256,"版本验证错误,当前程序版本为%s,对方版本为%s",serverVersion,SERVER_VERSION_NUMBER);
LoginNetPacketProcesser::getInstance().sendLoginVersionErrorInfo(id,(Char16*)coreInfo->name.c_str(),(Byte)coreInfo->type,desc,StrLen(desc));
MGStrOp::sprintf(desc,256,"版本验证错误,当前程序版本为%s,对方版本为%s",SERVER_VERSION_NUMBER,serverVersion);
MG::MsgBox::show(desc,"版本验证");
return;
}
IServerDllInterface* serverInterface = ServerMain::getInstance().getServerDllInterface();
if (!ServerMain::getInstance().addServer(serverId,id))
{
//ServerMain::getInstance().closeServer(id);
//DYNAMIC_ASSERT(false);
//Char16 temp[256] = {0};
//MGStrOp::sprintf(temp,256,L"有重复的服务器id,请检查%s的ServerConfig.txt文件!",name);
//MG::MsgBox::show(temp,L"配置错误");
return;
}
NetAddress address = getAddress( getServerHandle(), id );
setConnectServerLoginState(address.getUin(),id,true,true);
//MG_LOG(out_error,"onLogin %s %d \n",address.getIPStr(),address.getPort());
Sleep(5);
serverInterface->onServerConnected( id, type, serverId, serverUniqueFlag, &address );
I32 len = WStrLen(name);
Char16* postName = MG_NEW Char16[MAX_SERVER_NAME_LEN];
WStrnCpyS(postName,MAX_SERVER_NAME_LEN,name,len);
NetAddress* postAddr = new NetAddress(address);
::PostMessage(ServerMain::getInstance().getDialogHandle(),LAUNCH_SERVER_CONNECT,(WPARAM)postName,(LPARAM)postAddr);
}