Get all peers in room
Options
Best Answer
-
That is why i wrote - look like we use it. and that is it. Just find usages of this method
in general we have AcotorsManager you may get from it ActiveActor, Inactive actors, all actors. it makes sense to send only to ActiveActors. InActive actors do not have peers attached to them
best,
ilya
1
Answers
-
1
-
Yes, i understand this. More details...
My game based on rooms. Each room have it own server logic unit, that must tick 20 times in second (subquestion: how implement it better? may be Photon ships some schedulers?). Logic unit may generate events (building done or something like this). My main question is: how can i send this event to all peers in him room?0 -
there is few overloads for PublishEvent method.
you may find examples of usages right in our code
and there is no built in schedulre in our code, except fibers scheduler. during game creation you may schedule on interval some method and it will be called every N miliseconds. but this method is not really precise. it might be executed slightly later. depending on amount of tasks in fiber
best,
ilya1 -
PublishEvent is what i looking for, thank you! But all of overloaded PublishEvent methods in Room.cs requires Actors whose will recive event. And i still don't understand the right way to get all peers (Actors) in room...0
-
That is why i wrote - look like we use it. and that is it. Just find usages of this method
in general we have AcotorsManager you may get from it ActiveActor, Inactive actors, all actors. it makes sense to send only to ActiveActors. InActive actors do not have peers attached to them
best,
ilya
1 -
Thank you, Ilya, now i understand. I can get all peers from room like (HiveGame^)this->RoomReference->Room->Actors, and then i can SendEvent for each of them!0