Skip to content

Commit f00a5d4

Browse files
author
kbengine
committed
统一接口的命名
1 parent 1f84da2 commit f00a5d4

11 files changed

Lines changed: 31 additions & 31 deletions

File tree

‎kbe/src/client/html5/kbengine.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ function KBENGINE()
22682268
}
22692269
}
22702270

2271-
this.Client_onUpdateOtherEntityPropertys = function(stream)
2271+
this.Client_onUpdatePropertysOptimized = function(stream)
22722272
{
22732273
var eid = g_kbengine.getAoiEntityIDFromStream(stream);
22742274
g_kbengine.onUpdatePropertys_(eid, stream);
@@ -2307,7 +2307,7 @@ function KBENGINE()
23072307
entity[methoddata[2]].apply(entity, args);
23082308
}
23092309

2310-
this.Client_onRemoteOtherEntityMethodCall = function(stream)
2310+
this.Client_onRemoteMethodCallOptimized = function(stream)
23112311
{
23122312
var eid = g_kbengine.getAoiEntityIDFromStream(stream);
23132313
g_kbengine.onRemoteMethodCall_(eid, stream);
@@ -2367,7 +2367,7 @@ function KBENGINE()
23672367
}
23682368
}
23692369

2370-
this.Client_onEntityLeaveWorldAliasID = function(stream)
2370+
this.Client_onEntityLeaveWorldOptimized = function(stream)
23712371
{
23722372
var eid = g_kbengine.getAoiEntityIDFromStream(stream);
23732373
Client_onEntityLeaveWorld(eid);

‎kbe/src/client/unity3d/KBEngine.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ public Int32 getAoiEntityIDFromStream(MemoryStream stream)
10721072
return id;
10731073
}
10741074

1075-
public void Client_onUpdateOtherEntityPropertys(MemoryStream stream)
1075+
public void Client_onUpdatePropertysOptimized(MemoryStream stream)
10761076
{
10771077
Int32 eid = getAoiEntityIDFromStream(stream);
10781078
onUpdatePropertys_(eid, stream);
@@ -1138,7 +1138,7 @@ public void onUpdatePropertys_(Int32 eid, MemoryStream stream)
11381138
}
11391139
}
11401140

1141-
public void Client_onRemoteOtherEntityMethodCall(MemoryStream stream)
1141+
public void Client_onRemoteMethodCallOptimized(MemoryStream stream)
11421142
{
11431143
Int32 eid = getAoiEntityIDFromStream(stream);
11441144
onRemoteMethodCall_(eid, stream);
@@ -1235,7 +1235,7 @@ public void Client_onEntityEnterWorld(Int32 eid, UInt16 uentityType)
12351235
}
12361236
}
12371237

1238-
public void Client_onEntityLeaveWorldAliasID(MemoryStream stream)
1238+
public void Client_onEntityLeaveWorldOptimized(MemoryStream stream)
12391239
{
12401240
Int32 eid = getAoiEntityIDFromStream(stream);
12411241
KBEngineApp.app.Client_onEntityLeaveWorld(eid);

‎kbe/src/lib/client_lib/client_interface.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ NETWORK_INTERFACE_DECLARE_BEGIN(ClientInterface)
8484
ENTITY_ID, eid)
8585

8686
// 服务器上的entity已经离开游戏世界了。
87-
CLIENT_MESSAGE_DECLARE_STREAM(onEntityLeaveWorldAliasID, MERCURY_VARIABLE_MESSAGE)
87+
CLIENT_MESSAGE_DECLARE_STREAM(onEntityLeaveWorldOptimized, MERCURY_VARIABLE_MESSAGE)
8888

8989
// 告诉客户端某个entity销毁了, 此类entity通常是还未onEntityEnterWorld。
9090
CLIENT_MESSAGE_DECLARE_ARGS1(onEntityDestroyed, MERCURY_FIXED_MESSAGE,
@@ -102,15 +102,15 @@ NETWORK_INTERFACE_DECLARE_BEGIN(ClientInterface)
102102

103103
// 远程呼叫entity方法
104104
CLIENT_MESSAGE_DECLARE_STREAM(onRemoteMethodCall, MERCURY_VARIABLE_MESSAGE)
105-
CLIENT_MESSAGE_DECLARE_STREAM(onRemoteOtherEntityMethodCall, MERCURY_VARIABLE_MESSAGE)
105+
CLIENT_MESSAGE_DECLARE_STREAM(onRemoteMethodCallOptimized, MERCURY_VARIABLE_MESSAGE)
106106

107107
// 被踢出服务器
108108
CLIENT_MESSAGE_DECLARE_ARGS1(onKicked, MERCURY_FIXED_MESSAGE,
109109
SERVER_ERROR_CODE, failedcode)
110110

111111
// 服务器更新entity属性
112112
CLIENT_MESSAGE_DECLARE_STREAM(onUpdatePropertys, MERCURY_VARIABLE_MESSAGE)
113-
CLIENT_MESSAGE_DECLARE_STREAM(onUpdateOtherEntityPropertys, MERCURY_VARIABLE_MESSAGE)
113+
CLIENT_MESSAGE_DECLARE_STREAM(onUpdatePropertysOptimized, MERCURY_VARIABLE_MESSAGE)
114114

115115
// 服务器强制设置entity的位置与朝向
116116
CLIENT_MESSAGE_DECLARE_STREAM(onSetEntityPosAndDir, MERCURY_VARIABLE_MESSAGE)

‎kbe/src/lib/client_lib/clientobjectbase.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ void ClientObjectBase::onEntityEnterWorld(Mercury::Channel * pChannel, ENTITY_ID
625625
}
626626

627627
//-------------------------------------------------------------------------------------
628-
void ClientObjectBase::onEntityLeaveWorldAliasID(Mercury::Channel * pChannel, MemoryStream& s)
628+
void ClientObjectBase::onEntityLeaveWorldOptimized(Mercury::Channel * pChannel, MemoryStream& s)
629629
{
630630
onEntityLeaveWorld(pChannel, getAoiEntityIDFromStream(s));
631631
}
@@ -715,7 +715,7 @@ void ClientObjectBase::onEntityDestroyed(Mercury::Channel * pChannel, ENTITY_ID
715715
}
716716

717717
//-------------------------------------------------------------------------------------
718-
void ClientObjectBase::onRemoteOtherEntityMethodCall(Mercury::Channel * pChannel, KBEngine::MemoryStream& s)
718+
void ClientObjectBase::onRemoteMethodCallOptimized(Mercury::Channel * pChannel, KBEngine::MemoryStream& s)
719719
{
720720
ENTITY_ID eid = getAoiEntityIDFromStream(s);
721721
onRemoteMethodCall_(eid, s);
@@ -752,7 +752,7 @@ void ClientObjectBase::onUpdatePropertys(Mercury::Channel * pChannel, MemoryStre
752752
}
753753

754754
//-------------------------------------------------------------------------------------
755-
void ClientObjectBase::onUpdateOtherEntityPropertys(Mercury::Channel * pChannel, MemoryStream& s)
755+
void ClientObjectBase::onUpdatePropertysOptimized(Mercury::Channel * pChannel, MemoryStream& s)
756756
{
757757
ENTITY_ID eid = getAoiEntityIDFromStream(s);
758758
onUpdatePropertys_(eid, s);

‎kbe/src/lib/client_lib/clientobjectbase.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class ClientObjectBase : public script::ScriptObject
191191
服务器上的entity已经离开游戏世界了
192192
*/
193193
virtual void onEntityLeaveWorld(Mercury::Channel * pChannel, ENTITY_ID eid);
194-
virtual void onEntityLeaveWorldAliasID(Mercury::Channel * pChannel, MemoryStream& s);
194+
virtual void onEntityLeaveWorldOptimized(Mercury::Channel * pChannel, MemoryStream& s);
195195

196196
/** 网络接口
197197
告诉客户端某个entity销毁了, 此类entity通常是还未onEntityEnterWorld
@@ -212,7 +212,7 @@ class ClientObjectBase : public script::ScriptObject
212212
远程调用entity的方法
213213
*/
214214
virtual void onRemoteMethodCall(Mercury::Channel* pChannel, MemoryStream& s);
215-
virtual void onRemoteOtherEntityMethodCall(Mercury::Channel* pChannel, MemoryStream& s);
215+
virtual void onRemoteMethodCallOptimized(Mercury::Channel* pChannel, MemoryStream& s);
216216
void onRemoteMethodCall_(ENTITY_ID eid, MemoryStream& s);
217217

218218
/** 网络接口
@@ -224,7 +224,7 @@ class ClientObjectBase : public script::ScriptObject
224224
服务器更新entity属性
225225
*/
226226
virtual void onUpdatePropertys(Mercury::Channel* pChannel, MemoryStream& s);
227-
virtual void onUpdateOtherEntityPropertys(Mercury::Channel* pChannel, MemoryStream& s);
227+
virtual void onUpdatePropertysOptimized(Mercury::Channel* pChannel, MemoryStream& s);
228228
void onUpdatePropertys_(ENTITY_ID eid, MemoryStream& s);
229229

230230
/** 网络接口

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ PyObject* ClientEntityMethod::callmethod(PyObject* args, PyObject* kwds)
122122
Mercury::Bundle* pSendBundle = Mercury::Bundle::ObjPool().createObject();
123123

124124
srcEntity->pWitness()->addSmartAOIEntityMessageToBundle(pForwardBundle, ClientInterface::onRemoteMethodCall,
125-
ClientInterface::onRemoteOtherEntityMethodCall, clientEntityID_);
125+
ClientInterface::onRemoteMethodCallOptimized, clientEntityID_);
126126

127127
if(mstream->wpos() > 0)
128128
(*pForwardBundle).append(mstream->data(), mstream->wpos());
@@ -154,7 +154,7 @@ PyObject* ClientEntityMethod::callmethod(PyObject* args, PyObject* kwds)
154154

155155
MERCURY_ENTITY_MESSAGE_FORWARD_CLIENT(srcEntity->getID(), (*pSendBundle), (*pForwardBundle));
156156

157-
srcEntity->pWitness()->sendToClient(ClientInterface::onRemoteOtherEntityMethodCall, pSendBundle);
157+
srcEntity->pWitness()->sendToClient(ClientInterface::onRemoteMethodCallOptimized, pSendBundle);
158158

159159
// 记录这个事件产生的数据量大小
160160
g_publicClientEventHistoryStats.trackEvent(srcEntity->getScriptName(),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ PyObject* ClientsRemoteEntityMethod::callmethod(PyObject* args, PyObject* kwds)
160160
Mercury::Bundle* pForwardBundle = Mercury::Bundle::ObjPool().createObject();
161161

162162
pAoiEntity->pWitness()->addSmartAOIEntityMessageToBundle(pForwardBundle, ClientInterface::onRemoteMethodCall,
163-
ClientInterface::onRemoteOtherEntityMethodCall, pEntity->getID());
163+
ClientInterface::onRemoteMethodCallOptimized, pEntity->getID());
164164

165165
if(mstream->wpos() > 0)
166166
(*pForwardBundle).append(mstream->data(), mstream->wpos());
@@ -193,7 +193,7 @@ PyObject* ClientsRemoteEntityMethod::callmethod(PyObject* args, PyObject* kwds)
193193
MERCURY_ENTITY_MESSAGE_FORWARD_CLIENT(pAoiEntity->getID(), (*pSendBundle), (*pForwardBundle));
194194

195195
//mailbox->postMail((*pBundle));
196-
pAoiEntity->pWitness()->sendToClient(ClientInterface::onRemoteOtherEntityMethodCall, pSendBundle);
196+
pAoiEntity->pWitness()->sendToClient(ClientInterface::onRemoteMethodCallOptimized, pSendBundle);
197197

198198
//Mercury::Bundle::ObjPool().reclaimObject(pSendBundle);
199199

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void Entity::onDefDataChanged(const PropertyDescription* propertyDescription, Py
385385
Mercury::Bundle* pForwardBundle = Mercury::Bundle::ObjPool().createObject();
386386

387387
pEntity->pWitness()->addSmartAOIEntityMessageToBundle(pForwardBundle, ClientInterface::onUpdatePropertys,
388-
ClientInterface::onUpdateOtherEntityPropertys, getID());
388+
ClientInterface::onUpdatePropertysOptimized, getID());
389389

390390
if(scriptModule_->usePropertyDescrAlias())
391391
(*pForwardBundle) << propertyDescription->aliasIDAsUint8();
@@ -402,7 +402,7 @@ void Entity::onDefDataChanged(const PropertyDescription* propertyDescription, Py
402402
Mercury::Bundle* pSendBundle = Mercury::Bundle::ObjPool().createObject();
403403
MERCURY_ENTITY_MESSAGE_FORWARD_CLIENT(pEntity->getID(), (*pSendBundle), (*pForwardBundle));
404404

405-
pEntity->pWitness()->sendToClient(ClientInterface::onUpdateOtherEntityPropertys, pSendBundle);
405+
pEntity->pWitness()->sendToClient(ClientInterface::onUpdatePropertysOptimized, pSendBundle);
406406
Mercury::Bundle::ObjPool().reclaimObject(pForwardBundle);
407407
}
408408
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ bool Witness::update()
490490

491491
Mercury::Bundle* pForwardBundle = Mercury::Bundle::ObjPool().createObject();
492492

493-
(*pForwardBundle).newMessage(ClientInterface::onEntityLeaveWorldAliasID);
493+
(*pForwardBundle).newMessage(ClientInterface::onEntityLeaveWorldOptimized);
494494
addAOIEntityIDToBundle(pForwardBundle, (*iter)->id());
495495

496496
MERCURY_ENTITY_MESSAGE_FORWARD_CLIENT_APPEND((*pSendBundle), (*pForwardBundle));

‎kbe/src/server/tools/bots/bots.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@ void Bots::onEntityLeaveWorld(Mercury::Channel * pChannel, ENTITY_ID eid)
534534
}
535535

536536
//-------------------------------------------------------------------------------------
537-
void Bots::onEntityLeaveWorldAliasID(Mercury::Channel * pChannel, MemoryStream& s)
537+
void Bots::onEntityLeaveWorldOptimized(Mercury::Channel * pChannel, MemoryStream& s)
538538
{
539539
ClientObject* pClient = findClient(pChannel);
540540
if(pClient)
541541
{
542-
pClient->onEntityLeaveWorldAliasID(pChannel, s);
542+
pClient->onEntityLeaveWorldOptimized(pChannel, s);
543543
}
544544
}
545545

@@ -584,12 +584,12 @@ void Bots::onRemoteMethodCall(Mercury::Channel* pChannel, KBEngine::MemoryStream
584584
}
585585

586586
//-------------------------------------------------------------------------------------
587-
void Bots::onRemoteOtherEntityMethodCall(Mercury::Channel* pChannel, KBEngine::MemoryStream& s)
587+
void Bots::onRemoteMethodCallOptimized(Mercury::Channel* pChannel, KBEngine::MemoryStream& s)
588588
{
589589
ClientObject* pClient = findClient(pChannel);
590590
if(pClient)
591591
{
592-
pClient->onRemoteOtherEntityMethodCall(pChannel, s);
592+
pClient->onRemoteMethodCallOptimized(pChannel, s);
593593
}
594594
}
595595

@@ -614,12 +614,12 @@ void Bots::onUpdatePropertys(Mercury::Channel* pChannel, MemoryStream& s)
614614
}
615615

616616
//-------------------------------------------------------------------------------------
617-
void Bots::onUpdateOtherEntityPropertys(Mercury::Channel* pChannel, MemoryStream& s)
617+
void Bots::onUpdatePropertysOptimized(Mercury::Channel* pChannel, MemoryStream& s)
618618
{
619619
ClientObject* pClient = findClient(pChannel);
620620
if(pClient)
621621
{
622-
pClient->onUpdateOtherEntityPropertys(pChannel, s);
622+
pClient->onUpdatePropertysOptimized(pChannel, s);
623623
}
624624
}
625625

0 commit comments

Comments
 (0)