Skip to content

Commit 98c6fb9

Browse files
committed
Renamed functions
1 parent b118aee commit 98c6fb9

2 files changed

Lines changed: 51 additions & 43 deletions

File tree

fusion/api/fusion.script_api

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This is a generated file. Do not modify. Created using https://github.com/britzl/generatedocs
12
- name: fusion
23
type: table
34
desc: Functions and constants for interacting with Photon Fusion
@@ -26,9 +27,6 @@
2627
- name: user
2728
type: string
2829
optional: True
29-
- name: region
30-
type: string
31-
optional: True
3230

3331
- name: disconnect
3432
type: function
@@ -173,12 +171,12 @@
173171
- name: enable
174172
type: boolean
175173

176-
- name: register_scene_object
174+
- name: create_map_object
177175
type: function
178176
desc: |
179-
Register a scene object.
177+
Create a map object.
180178
parameters:
181-
- name: scene
179+
- name: map
182180
type: number
183181
- name: factory_url
184182
type: string
@@ -234,10 +232,10 @@
234232
type: string
235233
optional: True
236234

237-
- name: register_object
235+
- name: create_object
238236
type: function
239237
desc: |
240-
Register an object.
238+
Create an object.
241239
parameters:
242240
- name: scene
243241
type: number
@@ -249,19 +247,19 @@
249247
type: string
250248
optional: True
251249

252-
- name: unregister_object
250+
- name: destroy_object
253251
type: function
254252
desc: |
255-
Unregister a previously registered object.
253+
Destroy a previously created object.
256254
parameters:
257255
- name: id
258256
type: string
259257
optional: True
260258

261-
- name: change_scene
259+
- name: map_change
262260
type: function
263261
desc: |
264-
Change scene.
262+
Change map.
265263
parameters:
266264
- name: index
267265
type: number
@@ -382,7 +380,7 @@
382380

383381
optional: True
384382

385-
- name: set_send_rate
383+
- name: set_room_send_rate
386384
type: function
387385
desc: |
388386
Set the send rate of an object. This decided how much bandwidth to allocate
@@ -410,7 +408,7 @@
410408

411409
optional: True
412410

413-
- name: reset_send_rate
411+
- name: reset_room_send_rate
414412
type: function
415413
desc: |
416414
Reset the send rate of an object.
@@ -667,15 +665,25 @@
667665
desc: |
668666
EVENT_SUB_OBJECT_DESTROYED
669667

668+
- name: EVENT_OBJECT_FORCE_ALIVE
669+
type: number
670+
desc: |
671+
EVENT_OBJECT_FORCE_ALIVE
672+
673+
- name: EVENT_SUB_OBJECT_FORCE_ALIVE
674+
type: number
675+
desc: |
676+
EVENT_SUB_OBJECT_FORCE_ALIVE
677+
670678
- name: EVENT_OBJECT_OWNER_CHANGED
671679
type: number
672680
desc: |
673681
EVENT_OBJECT_OWNER_CHANGED
674682

675-
- name: EVENT_OBJECT_PREDICTION_OVERRIDE
683+
- name: EVENT_PREDICTION_OVERRIDE
676684
type: number
677685
desc: |
678-
EVENT_OBJECT_PREDICTION_OVERRIDE
686+
EVENT_PREDICTION_OVERRIDE
679687

680688
- name: EVENT_LOBBY_STATS
681689
type: number
@@ -697,10 +705,10 @@
697705
desc: |
698706
EVENT_RPC
699707

700-
- name: EVENT_SCENE_CHANGE
708+
- name: EVENT_MAP_CHANGE
701709
type: number
702710
desc: |
703-
EVENT_SCENE_CHANGE
711+
EVENT_MAP_CHANGE
704712

705713
- name: EVENT_DESTROYED_MAP_ACTOR
706714
type: number

fusion/src/fusion.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static void DeserializeFusionObject(FusionObject* fusion_object)
594594
}
595595
}
596596

597-
static dmGameObject::Result DoRegisterObject(dmhash_t id, dmMessage::URL* factory_url, uint32_t scene, FusionCore::ObjectOwnerModes owner_mode)
597+
static dmGameObject::Result DoCreateObject(dmhash_t id, dmMessage::URL* factory_url, uint32_t scene, FusionCore::ObjectOwnerModes owner_mode)
598598
{
599599
if (HasSharedObject(id))
600600
{
@@ -1007,7 +1007,7 @@ void Fusion_OnFusionStart()
10071007
// send object properties
10081008
void Fusion_TickBeforeFrameEnd()
10091009
{
1010-
dmLogInfo("TickBeforeFrameEnd");
1010+
// dmLogInfo("TickBeforeFrameEnd");
10111011
dmHashTable<dmhash_t, FusionObject*>::Iterator iter = g_Ctx->m_FusionObjects.GetIterator();
10121012
while(iter.Next())
10131013
{
@@ -1023,7 +1023,7 @@ void Fusion_TickBeforeFrameEnd()
10231023
// updated object properties with received data
10241024
void Fusion_TickAfterFrameBegin(double dt)
10251025
{
1026-
dmLogInfo("Fusion_TickAfterFrameBegin");
1026+
// dmLogInfo("Fusion_TickAfterFrameBegin");
10271027
dmHashTable<dmhash_t, FusionObject*>::Iterator iter = g_Ctx->m_FusionObjects.GetIterator();
10281028
while(iter.Next())
10291029
{
@@ -1771,16 +1771,16 @@ static int EnableDebug(lua_State* L)
17711771

17721772

17731773

1774-
/** Register a scene object
1775-
* @name register_scene_object
1776-
* @number scene
1774+
/** Create a map object
1775+
* @name create_map_object
1776+
* @number map
17771777
* @string factory_url
17781778
* @number owner_mode
17791779
* @string [id]
17801780
*/
1781-
static int RegisterSceneObject(lua_State* L)
1781+
static int CreateMapObject(lua_State* L)
17821782
{
1783-
dmLogInfo("RegisterSceneObject");
1783+
dmLogInfo("CreateMapObject");
17841784
if (!g_Ctx->m_FusionClient)
17851785
{
17861786
luaL_error(L, "No Fusion client");
@@ -1810,7 +1810,7 @@ static int RegisterSceneObject(lua_State* L)
18101810
bool alreadyPopulated;
18111811
uint32_t engineFlags = 0;
18121812
int32_t requiredObjectsCount = 0;
1813-
dmLogInfo("Calling CreateSceneObject");
1813+
dmLogInfo("Calling CreateMapObject");
18141814
FusionCore::ObjectRoot* object = g_Ctx->m_FusionClient->CreateMapObject(alreadyPopulated,
18151815
wordsCount,
18161816
type,
@@ -1822,7 +1822,7 @@ static int RegisterSceneObject(lua_State* L)
18221822
engineFlags,
18231823
requiredObjectsCount);
18241824

1825-
dmLogInfo("Calling CreateSceneObject - done");
1825+
dmLogInfo("Calling CreateMapObject - done");
18261826
FusionObject* fusion_object = CreateFusionObject(id, object);
18271827
if (!fusion_object)
18281828
{
@@ -1921,7 +1921,7 @@ static int SpawnObject(lua_State* L)
19211921
uint32_t scene = (uint32_t)luaL_checknumber(L, 4);
19221922
FusionCore::ObjectOwnerModes ownerMode = (FusionCore::ObjectOwnerModes)luaL_checknumber(L, 5);
19231923

1924-
r = DoRegisterObject(id, &factory_url, scene, ownerMode);
1924+
r = DoCreateObject(id, &factory_url, scene, ownerMode);
19251925
if (dmGameObject::RESULT_OK != r)
19261926
{
19271927
luaL_error(L, "Unable to spawn game object");
@@ -1962,16 +1962,16 @@ static int DespawnObject(lua_State* L)
19621962
}
19631963

19641964

1965-
/** Register an object
1966-
* @name register_object
1965+
/** Create an object
1966+
* @name create_object
19671967
* @number scene
19681968
* @string factory_url
19691969
* @number owner_mode
19701970
* @string [id]
19711971
*/
1972-
static int RegisterObject(lua_State* L)
1972+
static int CreateObject(lua_State* L)
19731973
{
1974-
dmLogInfo("RegisterObject");
1974+
dmLogInfo("CreateObject");
19751975
if (!g_Ctx->m_FusionClient)
19761976
{
19771977
luaL_error(L, "No Fusion client");
@@ -1985,8 +1985,8 @@ static int RegisterObject(lua_State* L)
19851985
FusionCore::ObjectOwnerModes ownerMode = (FusionCore::ObjectOwnerModes)luaL_checknumber(L, 3);
19861986
dmhash_t id = ResolveId(L, 4);
19871987

1988-
dmLogInfo("RegisterObject %d", ownerMode);
1989-
dmGameObject::Result r = DoRegisterObject(id, factory_url, scene, ownerMode);
1988+
dmLogInfo("CreateObject %d", ownerMode);
1989+
dmGameObject::Result r = DoCreateObject(id, factory_url, scene, ownerMode);
19901990
if (dmGameObject::RESULT_OK != r)
19911991
{
19921992
luaL_error(L, "Unable to create object");
@@ -1996,13 +1996,13 @@ static int RegisterObject(lua_State* L)
19961996
return 0;
19971997
}
19981998

1999-
/** Unregister a previously registered object
2000-
* @name unregister_object
1999+
/** Destroy a previously created object
2000+
* @name destroy_object
20012001
* @string [id]
20022002
*/
2003-
static int UnregisterObject(lua_State* L)
2003+
static int DestroyObject(lua_State* L)
20042004
{
2005-
dmLogInfo("UnregisterObject");
2005+
dmLogInfo("DestroyObject");
20062006
if (!g_Ctx->m_FusionClient)
20072007
{
20082008
luaL_error(L, "No Fusion client");
@@ -2161,7 +2161,7 @@ static int GetOwnerId(lua_State* L)
21612161
*/
21622162
static int HasAuthority(lua_State* L)
21632163
{
2164-
dmLogInfo("HasAuthority");
2164+
// dmLogInfo("HasAuthority");
21652165
if (!g_Ctx->m_FusionClient)
21662166
{
21672167
luaL_error(L, "No Fusion client");
@@ -2634,9 +2634,9 @@ static const luaL_reg Module_methods[] = {
26342634
// lifecycle
26352635
{ "spawn", SpawnObject },
26362636
{ "despawn", DespawnObject },
2637-
{ "register_object", RegisterObject },
2638-
{ "register_scene_object", RegisterSceneObject },
2639-
{ "unregister_object", UnregisterObject },
2637+
{ "create_object", CreateObject },
2638+
{ "create_map_object", CreateMapObject },
2639+
{ "destroy_object", DestroyObject },
26402640
{ "map_change", MapChange },
26412641

26422642
// rpc and events

0 commit comments

Comments
 (0)