本文整理汇总了C++中WorldSocket类的典型用法代码示例。如果您正苦于以下问题:C++ WorldSocket类的具体用法?C++ WorldSocket怎么用?C++ WorldSocket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WorldSocket类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: HandleWoWPacket
void WServer::HandleWoWPacket(WorldPacket & pck)
{
uint32 sessionid, size;
uint16 opcode;
/* get session */
pck >> sessionid >> opcode >> size;
Session * session = sClientMgr.GetSession(sessionid);
if(!session) return;
/* write it to that session's output buffer */
WorldSocket * s = session->GetSocket();
if(s) s->OutPacket(opcode, size, size ? ((const void*)(pck.contents() + 10)) : 0);
}
开发者ID:Goatform,项目名称:ascent,代码行数:14,代码来源:WorkerServer.cpp
示例2: HandleSessionInfo
void LogonCommClientSocket::HandleSessionInfo(WorldPacket & recvData)
{
uint32 request_id;
recvData >> request_id;
// find the socket with this request
WorldSocket * sock = sLogonCommHandler.GetSocketByRequest(request_id);
if(sock == 0 || sock->Authed || !sock->IsConnected()) // Expired/Client disconnected
return;
// extract sessionkey / account information (done by WS)
sock->Authed = true;
sLogonCommHandler.RemoveUnauthedSocket(request_id);
sock->InformationRetreiveCallback(recvData, request_id);
}
开发者ID:h4s0n,项目名称:Sandshroud,代码行数:15,代码来源:LogonCommClient.cpp
示例3: ASSERT
void ClusterInterface::HandlePlayerLogin(WorldPacket & pck)
{
/* player x logging into instance y */
uint32 guid, instance, mapid;
uint32 accountid, accountflags, sessionid;
string gmpermissions, accountname;
pck >> guid >> mapid >> instance >> accountid >> accountflags >> sessionid >> gmpermissions >> accountname;
/* find the instance */
Map * ma = sWorldCreator.GetMap(mapid);
ASSERT(ma);
MapMgr * mm = ma->GetInstance(instance);
ASSERT(mm);
/* create the session */
WorldSession * s = sWorld.FindSession(accountid);
ASSERT(!s);
/* create the socket */
WorldSocket * so = new WorldSocket(sessionid);
s = new WorldSession(accountid, accountname, so);
_sessions[sessionid] = s;
sWorld.AddSession(s);
bool login_result = s->PlayerLogin(guid, mapid, instance);
if(login_result)
{
/* login was ok. send a message to the realm server telling him to distribute our info to all other realm server */
WorldPacket data(ICMSG_PLAYER_LOGIN_RESULT, 5);
data << guid << sessionid << uint8(1);
SendPacket(&data);
}
else
{
/* for some reason the login failed */
WorldPacket data(ICMSG_PLAYER_LOGIN_RESULT, 5);
data << guid << sessionid << uint8(0);
SendPacket(&data);
/* tell the client his login failed before deleting the session */
data.Initialize(SMSG_CHARACTER_LOGIN_FAILED);
data << uint8(62);
so->SendPacket(&data);
/* destroy the session */
DestroySession(sessionid);
}
}
开发者ID:Chero,项目名称:abcwow,代码行数:48,代码来源:ClusterInterface.cpp
示例4: AddNewSockets
void AddNewSockets() {
ACE_GUARD(ACE_Thread_Mutex, Guard, m_NewSockets_Lock);
if (m_NewSockets.empty())
return;
for (SocketSet::const_iterator i = m_NewSockets.begin();
i != m_NewSockets.end(); ++i) {
WorldSocket* sock = (*i);
if (sock->IsClosed()) {
sScriptMgr->OnSocketClose(sock, true);
sock->RemoveReference();
--m_Connections;
} else
m_Sockets.insert(sock);
}
m_NewSockets.clear();
}
开发者ID:ProjectStarGate,项目名称:StarGate-Plus-EMU,代码行数:21,代码来源:WorldSocketMgr.cpp
注:本文中的WorldSocket类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论