Beispiel #1
0
 public static Person makePerson(string userId, string person_name, string token)
 {
     // Set Instance
     bankInstance = new TestBank();
     friendManagerInstance = new TestFriendManager();
     Person person = new Person(userId, person_name, token, bankInstance, friendManagerInstance);
     return person;
 }
Beispiel #2
0
 public Person(string person_live_id, string person_name, string token, Bank bankInstance, FriendManager friendManager)
 {
     this.person_live_id = person_live_id;
     this.person_name = person_name;
     this.token = token;
     this.bankInstance = bankInstance;
     this.friendManagerInstance = friendManagerInstance;
 }
Beispiel #3
0
        /// <summary>
        /// </summary>
        /// <param name="user">The user.</param>
        public QQClient(QQUser user)
        {
            PacketManager = new PacketManager(this);
            ConnectionManager = new ConnectionManager(this);
            LoginManager = new LoginManager(this);
            MessageManager = new MessageManager(this);
            FriendManager = new FriendManager(this);
            PrivateManager = new PrivateManager(this);
            ClusterManager = new ClusterManager(this);

            // this.inConn = new Dictionary<InPacket, string>();
            this.QQUser = user;
            this.Proxy = new Proxy();
            this.LogManager = new QQLog(this);
            #if DEBUG
            this.LogManager.Log("uin:" + this.QQUser.QQ.ToString() + "-->" + this.QQUser.QQ.ToString("X8") + "\r\nPassword md5_1: " + Utils.Util.ToHex(this.QQUser.Password) + "\r\nPassword md5_2 (key): " + Utils.Util.ToHex(this.QQUser.QQKey.PasswordKey));
            #endif
            this.ServerInfo = new ServerInfo();
        }
Beispiel #4
0
        // 对象进入场景,在这里初始化各种数据, 资源, 模型等
        // 传入数据。
        override public void OnEnterWorld()
        {
            base.OnEnterWorld();
            LoggerHelper.Info("Avatar name: " + name);
            // 在调用该函数前, 数据已经通过EntityAttach 和 EntityCellAttach 同步完毕
            CreateModel();
            inventoryManager = new InventoryManager(this);
            bodyenhanceManager = new BodyEnhanceManager(this);
            skillManager = new PlayerSkillManager(this);
            battleManger = new PlayerBattleManager(this, skillManager as PlayerSkillManager);

            doorOfBurySystem = new DoorOfBurySystem();
            runeManager = new RuneManager(this);
            towerManager = new TowerManager(this);
            missionManager = new MissionManager(this);
            taskManager = new TaskManager(this, (int)taskMain);
            marketManager = new MarketManager(this);
            friendManager = new FriendManager(this);
            operationSystem = new OperationSystem(this);
            sanctuaryManager = new SanctuaryManager(this);
            arenaManager = new ArenaManager(this);
            dailyEventSystem = new DailyEventSystem(this);
            rankManager = new RankManager(this);
            campaignSystem = new CampaignSystem(this);
            wingManager = new WingManager(this);
            rewardManager = new RewardManager(this);
            occupyTowerSystem = new OccupyTowerSystem(this);

            TipManager.Init();
            DragonMatchManager.Init();
            fumoManager = new FumoManager(this);

            MailManager.Instance.IsMailInfoDirty = true;
            TongManager.Instance.Init();
            GuideSystem.Instance.AddListeners();
            StoryManager.Instance.AddListeners();
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnNormalAttack, NormalAttack);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeStart, PowerChargeStart);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeInterrupt, PowerChargeInterrupt);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeComplete, PowerChargeComplete);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellOneAttack, SpellOneAttack);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellTwoAttack, SpellTwoAttack);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellThreeAttack, SpellThreeAttack);
            EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellXPAttack, SpecialAttack);
            EventDispatcher.AddEventListener<int>(Events.UIBattleEvent.OnSpriteSkill, OnSpriteSkill);

            EventDispatcher.AddEventListener<uint>(Events.GearEvent.Teleport, Teleport);
            EventDispatcher.AddEventListener<uint, int, int, int>(Events.GearEvent.Damage, SetDamage);

            EventDispatcher.AddEventListener<int, bool>(Events.InstanceEvent.InstanceLoaded, InstanceLoaded);
            EventDispatcher.AddEventListener<ushort>(Events.OtherEvent.MapIdChanged, OnMapChanged);
            EventDispatcher.AddEventListener<ulong>(Events.OtherEvent.Withdraw, Withdraw);
            EventDispatcher.AddEventListener(Events.OtherEvent.DiamondMine, DiamondMine);
            EventDispatcher.AddEventListener(Events.OtherEvent.CheckCharge, CheckCharge);
            EventDispatcher.AddEventListener(Events.OtherEvent.Charge, Charge);

            EventDispatcher.AddEventListener(ON_TASK_GUIDE, TaskGuide);
            EventDispatcher.AddEventListener(ON_END_TASK_GUIDE, EndTaskGuide);
            EventDispatcher.AddEventListener<int, int>(ON_TASK_MISSION, MissionOpen);

            EventDispatcher.AddEventListener(Events.AIEvent.DummyThink, DummyThink);
            EventDispatcher.AddEventListener(Events.StoryEvent.CGBegin, ProcCGBegin);
            EventDispatcher.AddEventListener(Events.StoryEvent.CGEnd, ProcCGEnd);
            EventDispatcher.AddEventListener<string>(Events.GearEvent.TrapBegin, ProcTrapBegin);
            EventDispatcher.AddEventListener<string>(Events.GearEvent.TrapEnd, ProcTrapEnd);
            EventDispatcher.AddEventListener(Events.GearEvent.LiftEnter, ProcLiftEnter);
            EventDispatcher.AddEventListener<int>(Events.GearEvent.PathPointTrigger, PathPointTrigger);
            EventDispatcher.AddEventListener(Events.DirecterEvent.DirActive, DirActive);

            EventDispatcher.AddEventListener<int>(Events.EnergyEvent.BuyEnergy, BuyEnergy);
            EventDispatcher.AddEventListener(ON_VIP_REAL_STATE, OnVIPRealState);

            EventDispatcher.AddEventListener<int>(Events.DiamondToGoldEvent.GoldMetallurgy, GoldMetallurgy);

            EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.AFFECTUP, OnBattleBtnPressed);
            EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.OUTPUTUP, OnBattleBtnPressed);
            EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.MOVEUP, OnBattleBtnPressed);
            EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.NORMALATTACK, OnBattleBtnPressed);
            EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.PLAYERINFOBGUP, OnBattleBtnPressed);
            EventDispatcher.AddEventListener("MainUIControllStickPressed", OnBattleBtnPressed);

            EventDispatcher.AddEventListener<Vector3>(Events.GearEvent.CrockBroken, CrockBroken);
            EventDispatcher.AddEventListener<bool, bool, Vector3>(Events.GearEvent.ChestBroken, ChestBroken);

            EventDispatcher.AddEventListener<GameObject, Vector3, float>(MogoMotor.ON_MOVE_TO_FALSE, OnMoveToFalse);
            EventDispatcher.AddEventListener(Events.OtherEvent.BossDie, BossDie);

            EventDispatcher.AddEventListener<int, bool>(Events.InstanceEvent.InstanceLoaded, SetCampControl);

            timerID = TimerHeap.AddTimer<bool>(1000, 100, SyncPos, true);
            checkDmgID = TimerHeap.AddTimer(0, 1000, CheckDmgBase);
            syncHpTimerID = TimerHeap.AddTimer(10000, 5000, SyncHp);
            skillFailoverTimer = TimerHeap.AddTimer(1000, 3000, SkillFailover);
            TimerHeap.AddTimer(5000, 0, GetServerTickReq);
            //rateTimer = TimerHeap.AddTimer(1000, 3000, CheckRate);
            CheckCharge();
            GetWingBag();
            MogoTime.Instance.InitTimeFromServer();

            MogoUIManager.Instance.LoadUIResources();
            TimerHeap.AddTimer(500, 0, EventDispatcher.TriggerEvent, Events.RuneEvent.GetBodyRunes);
            TimerHeap.AddTimer(500, 0, marketManager.GiftRecordReq);

            if (IsNewPlayer)
            {
                CurMissionID = 10100;
                CurMissionLevel = 1;

                missionManager.EnterMissionReq(CurMissionID, CurMissionLevel);
            }


            if (PlatformSdkManager.Instance)
                TimerHeap.AddTimer(1000, 60000, PlatformSdkManager.Instance.OnSetupNotification);
        }
Beispiel #5
0
	// Use this for initialization
	void Start () {
		friendManager = GameObject.Find ("FriendManager").GetComponent<FriendManager> ();
	}
Beispiel #6
0
    int RefreshNextTime { get; set; } //下一次重置时间
    #endregion

    #region 必要函数
    public FriendManager(EntityMyself _myself)
    {
        myself = _myself;
        AddListeners();
        //进入游戏的时候申请好友信息,add by Win.J H
        ReqFriendList();
        FriendReqListReq();
        Instance = this;
    }