Inheritance: global::ProtoBuf.IExtensible
 internal static Msg_RC_CampChanged BuildCampChangedMessage(EntityInfo obj)
 {
     Msg_RC_CampChanged msg = new Msg_RC_CampChanged();
     msg.obj_id = obj.GetId();
     msg.camp_id = obj.GetCampId();
     return msg;
 }
Esempio n. 2
0
 internal void SyncForNewUser(User user)
 {
     if (null != user) {
         EntityInfo userInfo = user.Info;
         Room room = GetRoom();
         if (null != userInfo && null != room && null != room.ActiveScene) {
             //发阵营给自己
             Msg_RC_CampChanged msg = new Msg_RC_CampChanged();
             msg.obj_id = 0;
             msg.camp_id = user.LobbyUserData.Camp;
             user.SendMessage(RoomMessageDefine.Msg_RC_CampChanged, msg);
             //同步场景数据给自己
             SyncSceneObjectsToUser(user);
             SyncUserObjectToOtherUsers(user);
         }
     }
 }
        protected override bool ExecCommand(StoryInstance instance, long delta)
        {
            Scene scene = instance.Context as Scene;
            if (null != scene) {
                EntityInfo obj = scene.SceneContext.GetEntityByUnitId(m_UnitId.Value);
                if (null != obj) {
                    int campId = m_CampId.Value;
                    obj.SetCampId(campId);

                    Msg_RC_CampChanged msg = new Msg_RC_CampChanged();
                    msg.obj_id = obj.GetId();
                    msg.camp_id = campId;
                    scene.NotifyAllUser(RoomMessageDefine.Msg_RC_CampChanged, msg);
                }
            }
            return false;
        }