GameFramework.Scene.NotifyAllUser C# (CSharp) Method

NotifyAllUser() private method

private NotifyAllUser ( RoomMessageDefine id, object msg ) : void
id RoomMessageDefine
msg object
return void
        internal void NotifyAllUser(RoomMessageDefine id, object msg)
        {
            foreach (User us in m_Room.RoomUsers) {
                us.SendMessage(id, msg);
            }
            NotifyAllObserver(id, msg);
        }

Same methods

Scene::NotifyAllUser ( RoomMessageDefine id, object msg, int exceptId ) : void

Usage Example

示例#1
0
        private void OnAiSkill(EntityInfo npc, int skillId)
        {
            Scene scene = npc.SceneContext.CustomData as Scene;

            if (null != scene)
            {
                SkillInfo skillInfo = npc.GetSkillStateInfo().GetCurSkillInfo();
                if (null == skillInfo || !skillInfo.IsSkillActivated)
                {
                    SkillInfo curSkillInfo = npc.GetSkillStateInfo().GetSkillInfoById(skillId);
                    if (null != curSkillInfo)
                    {
                        long curTime = TimeUtility.GetLocalMilliseconds();
                        if (!curSkillInfo.IsInCd(curTime))
                        {
                            if (scene.SkillSystem.StartSkill(npc.GetId(), curSkillInfo.ConfigData, 0))
                            {
                                Msg_RC_NpcSkill skillBuilder = DataSyncUtility.BuildNpcSkillMessage(npc, skillId);

                                LogSystem.Info("Send Msg_RC_NpcSkill, EntityId={0}, SkillId={1}",
                                               npc.GetId(), skillId);
                                scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcSkill, skillBuilder);
                            }
                        }
                    }
                }
            }
        }
All Usage Examples Of GameFramework.Scene::NotifyAllUser