Skip to content

Commit 1bdbaef

Browse files
committed
up
1 parent f3c6d1d commit 1bdbaef

11 files changed

Lines changed: 51 additions & 49 deletions

‎kbe/src/lib/network/html5_packet_filter.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ Reason HTML5PacketFilter::send(NetworkInterface & networkInterface, Channel * pC
140140
int space = pPacket->opsize() - pRetTCPPacket->fillfree();
141141
if(space > 0)
142142
{
143-
WARNING_MSG(boost::format("HTML5PacketFilter::send: no free space, buffer added:%1%, total=%2%.\n") %
144-
space % pRetTCPPacket->size());
143+
WARNING_MSG(fmt::format("HTML5PacketFilter::send: no free space, buffer added:{}, total={}.\n",
144+
space, pRetTCPPacket->size()));
145145

146146
pRetTCPPacket->data_resize(pRetTCPPacket->size() + space);
147147
}
@@ -188,8 +188,8 @@ Reason HTML5PacketFilter::recv(Channel * pChannel, PacketReceiver & receiver, Pa
188188
(*pPacket) >> basicSize_;
189189
if(basicSize_ != BINARY_FRAME)
190190
{
191-
ERROR_MSG(boost::format("HTML5PacketFilter::recv: frame_opcode(%1%) != %2%, addr=%3%\n") %
192-
basicSize_ % BINARY_FRAME % pChannel->c_str());
191+
ERROR_MSG(fmt::format("HTML5PacketFilter::recv: frame_opcode({}) != {}, addr={}\n",
192+
basicSize_, BINARY_FRAME, pChannel->c_str()));
193193

194194
this->pChannel_->condemn();
195195
return REASON_HTML5_ERROR;
@@ -214,8 +214,8 @@ Reason HTML5PacketFilter::recv(Channel * pChannel, PacketReceiver & receiver, Pa
214214
if(basicSize_ > 127)
215215
{
216216
this->pChannel_->condemn();
217-
ERROR_MSG(boost::format("HTML5PacketReader::processMessages: basicSize(%1%) is error! addr=%2%!\n") %
218-
basicSize_ % pChannel_->c_str());
217+
ERROR_MSG(fmt::format("HTML5PacketReader::processMessages: basicSize({}) is error! addr={}!\n",
218+
basicSize_, pChannel_->c_str()));
219219
return REASON_HTML5_ERROR;
220220
}
221221

‎kbe/src/lib/server/callbackmgr.hpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class CallbackMgr
143143
*/
144144
bool processTimeout(CALLBACK_ID cbID, T callback)
145145
{
146-
INFO_MSG(boost::format("CallbackMgr::processTimeout: %1% timeout!\n") % cbID);
146+
INFO_MSG(fmt::format("CallbackMgr::processTimeout: {} timeout!\n", cbID));
147147
return true;
148148
}
149149
protected:
@@ -197,7 +197,7 @@ inline void CallbackMgr<PyObjectPtr>::createFromStream(KBEngine::MemoryStream& s
197197

198198
if(pyCallback == NULL || cbID == 0)
199199
{
200-
ERROR_MSG(boost::format("CallbackMgr::createFromStream: pyCallback(%1%) is error!\n") % cbID);
200+
ERROR_MSG(fmt::format("CallbackMgr::createFromStream: pyCallback({}) is error!\n", cbID));
201201
continue;
202202
}
203203

@@ -224,8 +224,8 @@ template<>
224224
inline bool CallbackMgr<PyObject*>::processTimeout(CALLBACK_ID cbID, PyObject* callback)
225225
{
226226
std::string name = callback->ob_type->tp_name;
227-
INFO_MSG(boost::format("CallbackMgr::processTimeout: callbackID:%1%, callback(%2%) timeout!\n") % cbID %
228-
name);
227+
INFO_MSG(fmt::format("CallbackMgr::processTimeout: callbackID:{}, callback({}) timeout!\n", cbID ,
228+
name));
229229

230230
Py_DECREF(callback);
231231
return true;

‎kbe/src/lib/server/globaldata_server.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool GlobalDataServer::write(Mercury::Channel* pChannel, COMPONENT_TYPE componen
5858
bool GlobalDataServer::del(Mercury::Channel* pChannel, COMPONENT_TYPE componentType, const std::string& key)
5959
{
6060
if(!dict_.erase(key)){
61-
ERROR_MSG(boost::format("GlobalDataServer::del: not found the key:[%1%]\n") % key.c_str());
61+
ERROR_MSG(fmt::format("GlobalDataServer::del: not found the key:[{}]\n", key.c_str()));
6262
return false;
6363
}
6464

@@ -70,8 +70,8 @@ bool GlobalDataServer::del(Mercury::Channel* pChannel, COMPONENT_TYPE componentT
7070
void GlobalDataServer::broadcastDataChanged(Mercury::Channel* pChannel, COMPONENT_TYPE componentType,
7171
const std::string& key, const std::string& value, bool isDelete)
7272
{
73-
INFO_MSG(boost::format("GlobalDataServer::broadcastDataChanged: writer(%1%, addr=%5%), key_size=%2%, val_size=%3%, isdelete=%4%\n") %
74-
COMPONENT_NAME_EX(componentType) % key.size() % value.size() % (int)isDelete % pChannel->c_str());
73+
INFO_MSG(fmt::format("GlobalDataServer::broadcastDataChanged: writer({0}, addr={4}), key_size={1}, val_size={2}, isdelete={3}\n",
74+
COMPONENT_NAME_EX(componentType), key.size(), value.size(), (int)isDelete, pChannel->c_str()));
7575

7676
std::vector<COMPONENT_TYPE>::iterator iter = concernComponentTypes_.begin();
7777
for(; iter != concernComponentTypes_.end(); iter++)

‎kbe/src/lib/server/pendingLoginmgr.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool PendingLoginMgr::add(PLInfos* infos)
7878
infos->lastProcessTime = timestamp();
7979

8080

81-
DEBUG_MSG(boost::format("PendingLoginMgr::add: %1%, size=%2%.\n") % infos->accountName % pPLMap_.size());
81+
DEBUG_MSG(fmt::format("PendingLoginMgr::add: {}, size={}.\n", infos->accountName, pPLMap_.size()));
8282
return true;
8383
}
8484

@@ -90,7 +90,7 @@ PendingLoginMgr::PLInfos* PendingLoginMgr::remove(std::string& accountName)
9090
{
9191
PLInfos* infos = iter->second;
9292
pPLMap_.erase(iter);
93-
DEBUG_MSG(boost::format("PendingLoginMgr::remove: %1%, size=%2%.\n") % accountName % pPLMap_.size());
93+
DEBUG_MSG(fmt::format("PendingLoginMgr::remove: {}, size={}.\n", accountName, pPLMap_.size()));
9494
return infos;
9595
}
9696

@@ -131,8 +131,8 @@ bool PendingLoginMgr::process()
131131
if(curr - infos->lastProcessTime >= OP_TIME_OUT_MAX)
132132
{
133133
iter = pPLMap_.erase(iter);
134-
DEBUG_MSG(boost::format("PendingLoginMgr::process: [%2%] is timeout, currsize=%1%.\n") %
135-
pPLMap_.size() % infos->accountName);
134+
DEBUG_MSG(fmt::format("PendingLoginMgr::process: [{1}] is timeout, currsize={0}.\n",
135+
pPLMap_.size(), infos->accountName));
136136

137137
SAFE_RELEASE(infos);
138138
}

‎kbe/src/lib/server/shutdowner.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void Shutdowner::cancel()
5050
void Shutdowner::shutdown(float period, float tickPeriod, Mercury::EventDispatcher& dispatcher)
5151
{
5252
pTimerHandle_.cancel();
53-
INFO_MSG(boost::format("Shutdowner::onShutdownBegin: shutting down(period=%1%, tickPeriod=%2%)\n")
54-
% period % tickPeriod);
53+
INFO_MSG(fmt::format("Shutdowner::onShutdownBegin: shutting down(period={}, tickPeriod={})\n",
54+
period, tickPeriod));
5555

5656
tickPeriod_ = tickPeriod;
5757
pShutdownHandler_->setShuttingdown(ShutdownHandler::SHUTDOWN_STATE_BEGIN);
@@ -98,8 +98,8 @@ void Shutdowner::handleTimeout(TimerHandle handle, void * arg)
9898
pShutdownHandler_->setShuttingdown(ShutdownHandler::SHUTDOWN_STATE_END);
9999
if(!pShutdownHandler_->canShutdown())
100100
{
101-
INFO_MSG(boost::format("Shutdowner::onShutdownEnd: waiting for %1% to complete!\n") %
102-
pShutdownHandler_->lastShutdownFailReason());
101+
INFO_MSG(fmt::format("Shutdowner::onShutdownEnd: waiting for {} to complete!\n",
102+
pShutdownHandler_->lastShutdownFailReason()));
103103

104104
pShutdownHandler_->onShutdown(false);
105105
break;

‎kbe/src/server/baseapp/proxy_interface_macros.hpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ namespace KBEngine{
6161
} \
6262
else \
6363
{ \
64-
ERROR_MSG(boost::format( \
65-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
66-
eid); \
64+
ERROR_MSG(fmt::format( \
65+
"Messagehandler::handle: can't found entityID:{}.\n", \
66+
eid)); \
6767
} \
6868
} \
6969

@@ -116,9 +116,9 @@ namespace KBEngine{
116116
} \
117117
else \
118118
{ \
119-
ERROR_MSG(boost::format( \
120-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
121-
eid); \
119+
ERROR_MSG(fmt::format( \
120+
"Messagehandler::handle: can't found entityID:{}.\n", \
121+
eid)); \
122122
} \
123123
} \
124124

@@ -173,9 +173,9 @@ namespace KBEngine{
173173
} \
174174
else \
175175
{ \
176-
ERROR_MSG(boost::format( \
177-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
178-
eid); \
176+
ERROR_MSG(fmt::format( \
177+
"Messagehandler::handle: can't found entityID:{}.\n", \
178+
eid)); \
179179
} \
180180
} \
181181

‎kbe/src/server/baseapp/py_file_descriptor.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ PyObject* PyFileDescriptor::__py_deregisterWriteFileDescriptor(PyObject* self, P
197197
//-------------------------------------------------------------------------------------
198198
int PyFileDescriptor::handleInputNotification(int fd)
199199
{
200-
INFO_MSG(boost::format("PyFileDescriptor:handleInputNotification: fd = %1%\n") %
201-
fd );
200+
INFO_MSG(fmt::format("PyFileDescriptor:handleInputNotification: fd = {}\n",
201+
fd));
202202

203203
callback();
204204
return 0;
@@ -220,7 +220,7 @@ void PyFileDescriptor::callback()
220220
}
221221
else
222222
{
223-
ERROR_MSG(boost::format("PyFileDescriptor::callback: can't found callback:%1%.\n") % fd_);
223+
ERROR_MSG(fmt::format("PyFileDescriptor::callback: can't found callback:{}.\n", fd_));
224224
}
225225
}
226226

‎kbe/src/server/baseappmgr/baseappmgr.cpp‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ void Baseappmgr::onChannelDeregister(Mercury::Channel * pChannel)
104104
std::map< COMPONENT_ID, Baseapp >::iterator iter = baseapps_.find(cinfo->cid);
105105
if(iter != baseapps_.end())
106106
{
107-
WARNING_MSG(boost::format("Baseappmgr::onChannelDeregister: erase baseapp[%1%], currsize=%2%\n") %
108-
cinfo->cid % (baseapps_.size() - 1));
107+
WARNING_MSG(fmt::format("Baseappmgr::onChannelDeregister: erase baseapp[{}], currsize={}\n",
108+
cinfo->cid, (baseapps_.size() - 1)));
109109

110110
baseapps_.erase(iter);
111111
updateBestBaseapp();
@@ -168,7 +168,9 @@ void Baseappmgr::forwardMessage(Mercury::Channel* pChannel, MemoryStream& s)
168168

169169
if(cinfos == NULL || cinfos->pChannel == NULL)
170170
{
171-
ERROR_MSG(boost::format("Baseappmgr::forwardMessage: not found forwardComponent(%1%, at:%2%)!\n") % forward_componentID % cinfos);
171+
ERROR_MSG(fmt::format("Baseappmgr::forwardMessage: not found forwardComponent({}, at:{:p})!\n",
172+
forward_componentID, (void*)cinfos));
173+
172174
KBE_ASSERT(false && "Baseappmgr::forwardMessage: not found forwardComponent!\n");
173175
return;
174176
}
@@ -333,7 +335,7 @@ void Baseappmgr::registerPendingAccountToBaseappAddr(Mercury::Channel* pChannel,
333335
Components::ComponentInfos* cinfos = Components::getSingleton().findComponent(componentID);
334336
if(cinfos == NULL || cinfos->pChannel == NULL)
335337
{
336-
ERROR_MSG(boost::format("Baseappmgr::onPendingAccountGetBaseappAddr: not found baseapp(%1%).\n") % componentID);
338+
ERROR_MSG(fmt::format("Baseappmgr::onPendingAccountGetBaseappAddr: not found baseapp({}).\n", componentID));
337339
sendAllocatedBaseappAddr(pChannel, loginName, accountName, 0, 0);
338340
return;
339341
}

‎kbe/src/server/cellapp/clients_remote_entity_method.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ PyObject* ClientsRemoteEntityMethod::callmethod(PyObject* args, PyObject* kwds)
7575
if(pEntity == NULL || /*pEntity->pWitness() == NULL ||*/
7676
pEntity->isDestroyed() /*|| pEntity->clientMailbox() == NULL*/)
7777
{
78-
//WARNING_MSG(boost::format("EntityRemoteMethod::callClientMethod: not found entity(%1%).\n") %
79-
// mailbox->id());
78+
//WARNING_MSG(fmt::format("EntityRemoteMethod::callClientMethod: not found entity({}).\n",
79+
// mailbox->id()));
8080

8181
S_Return;
8282
}
@@ -108,8 +108,8 @@ PyObject* ClientsRemoteEntityMethod::callmethod(PyObject* args, PyObject* kwds)
108108
if(Mercury::g_trace_packet_use_logfile)
109109
DebugHelper::getSingleton().changeLogger("packetlogs");
110110

111-
DEBUG_MSG(boost::format("ClientsRemoteEntityMethod::callmethod: pushUpdateData: ClientInterface::onRemoteMethodCall(%1%::%2%)\n") %
112-
pEntity->scriptName() % methodDescription->getName());
111+
DEBUG_MSG(fmt::format("ClientsRemoteEntityMethod::callmethod: pushUpdateData: ClientInterface::onRemoteMethodCall({}::{})\n",
112+
pEntity->scriptName(), methodDescription->getName()));
113113

114114
switch(Mercury::g_trace_packet)
115115
{
@@ -173,8 +173,8 @@ PyObject* ClientsRemoteEntityMethod::callmethod(PyObject* args, PyObject* kwds)
173173
if(Mercury::g_trace_packet_use_logfile)
174174
DebugHelper::getSingleton().changeLogger("packetlogs");
175175

176-
DEBUG_MSG(boost::format("ClientsRemoteEntityMethod::callmethod: pushUpdateData: ClientInterface::onRemoteOtherEntityMethodCall(%1%::%2%)\n") %
177-
pAoiEntity->scriptName() % methodDescription->getName());
176+
DEBUG_MSG(fmt::format("ClientsRemoteEntityMethod::callmethod: pushUpdateData: ClientInterface::onRemoteOtherEntityMethodCall({}::{})\n",
177+
pAoiEntity->scriptName(), methodDescription->getName()));
178178

179179
switch(Mercury::g_trace_packet)
180180
{

‎kbe/src/server/cellapp/entity_remotemethod.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ PyObject* EntityRemoteMethod::tp_call(PyObject* self, PyObject* args,
6767
Entity* pEntity = Cellapp::getSingleton().findEntity(mailbox->id());
6868
if(pEntity == NULL || pEntity->pWitness() == NULL)
6969
{
70-
//WARNING_MSG(boost::format("EntityRemoteMethod::callClientMethod: not found entity(%1%).\n") %
71-
// mailbox->id());
70+
//WARNING_MSG(fmt::format("EntityRemoteMethod::callClientMethod: not found entity({}).\n",
71+
// mailbox->id()));
7272

7373
return RemoteEntityMethod::tp_call(self, args, kwds);
7474
}
@@ -90,8 +90,8 @@ PyObject* EntityRemoteMethod::tp_call(PyObject* self, PyObject* args,
9090
if(Mercury::g_trace_packet_use_logfile)
9191
DebugHelper::getSingleton().changeLogger("packetlogs");
9292

93-
DEBUG_MSG(boost::format("EntityRemoteMethod::tp_call: pushUpdateData: ClientInterface::onRemoteMethodCall(%1%::%2%)\n") %
94-
pEntity->scriptName() % methodDescription->getName());
93+
DEBUG_MSG(fmt::format("EntityRemoteMethod::tp_call: pushUpdateData: ClientInterface::onRemoteMethodCall({}::{})\n",
94+
pEntity->scriptName(), methodDescription->getName()));
9595

9696
switch(Mercury::g_trace_packet)
9797
{

0 commit comments

Comments
 (0)