Пример #1
0
    public void UserInformation(S.UserInformation p)
    {
        User.gameObject.SetActive(true);
        UserGameObject = Instantiate(WarriorModels[0], User.transform.position, Quaternion.identity);

        User.Player        = UserGameObject.GetComponent <PlayerObject>();
        User.Player.name   = p.Name;
        User.Player.Class  = p.Class;
        User.Player.Gender = p.Gender;
        User.Level         = p.Level;

        GameScene.UpdateCharacterIcon();

        User.Player.CurrentLocation       = new Vector2(p.Location.X, p.Location.Y);
        UserGameObject.transform.position = CurrentScene.Cells[(int)User.Player.CurrentLocation.x, (int)User.Player.CurrentLocation.y].position;

        User.Player.Direction = p.Direction;
        User.Player.Model.transform.rotation = ClientFunctions.GetRotation(User.Player.Direction);

        User.Inventory = p.Inventory;
        User.Equipment = p.Equipment;

        User.BindAllItems();

        Players.Add(p.ObjectID, User.Player);
        User.Player.Camera.SetActive(true);

        Tooltip.cam = User.Player.Camera.GetComponent <Camera>();
    }
Пример #2
0
        public override void Load(S.UserInformation info)
        {
            Name       = info.Name;
            NameColour = info.NameColour;
            Class      = info.Class;
            Gender     = info.Gender;
            Level      = info.Level;
            Hair       = info.Hair;

            HP = info.HP;
            MP = info.MP;

            Experience    = info.Experience;
            MaxExperience = info.MaxExperience;

            Inventory = info.Inventory;
            Equipment = info.Equipment;

            Magics = info.Magics;
            for (int i = 0; i < Magics.Count; i++)
            {
                Magics[i].CastTime += CMain.Time;
            }

            BindAllItems();
        }
Пример #3
0
        public void Load(S.UserInformation info)
        {
            Id   = info.RealId;
            Name = info.Name;
            Settings.LoadTrackedQuests(info.Name);
            NameColour    = info.NameColour;
            GuildName     = info.GuildName;
            GuildRankName = info.GuildRank;
            Class         = info.Class;
            Gender        = info.Gender;
            Level         = info.Level;

            CurrentLocation = info.Location;
            MapLocation     = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            Direction = info.Direction;
            Hair      = info.Hair;

            HP = info.HP;
            MP = info.MP;

            Experience    = info.Experience;
            MaxExperience = info.MaxExperience;

            LevelEffects = info.LevelEffects;

            Inventory      = info.Inventory;
            Equipment      = info.Equipment;
            QuestInventory = info.QuestInventory;

            HasExpandedStorage        = info.HasExpandedStorage;
            ExpandedStorageExpiryTime = info.ExpandedStorageExpiryTime;

            Magics = info.Magics;
            for (int i = 0; i < Magics.Count; i++)
            {
                if (Magics[i].CastTime > 0)
                {
                    Magics[i].CastTime = CMain.Time - Magics[i].CastTime;
                }
            }

            IntelligentCreatures = info.IntelligentCreatures; //IntelligentCreature
            SummonedCreatureType = info.SummonedCreatureType; //IntelligentCreature
            CreatureSummoned     = info.CreatureSummoned;     //IntelligentCreature

            BindAllItems();

            RefreshStats();

            SetAction();
        }
Пример #4
0
    public void UserInformation(S.UserInformation p)
    {
        User.gameObject.SetActive(true);
        UserGameObject = Instantiate(PlayerModel, User.transform.position, Quaternion.identity);
        UserGameObject.GetComponent <BoxCollider>().enabled = true;
        User.Player             = UserGameObject.GetComponent <PlayerObject>();
        User.Player.gameManager = this;
        User.Player.ObjectID    = p.ObjectID;
        User.SetName(p.Name);
        User.SetClass(p.Class);
        User.Player.Gender = p.Gender;
        User.Player.SetModel();
        User.SetLevel(p.Level);
        User.Experience    = p.Experience;
        User.MaxExperience = p.MaxExperience;

        User.HP = p.HP;
        User.MP = p.MP;
        User.Player.HealthTime = float.MaxValue;
        User.Gold   = p.Gold;
        User.Credit = p.Credit;


        GameScene.UpdateCharacterIcon();

        User.Player.CurrentLocation          = new Vector2Int(p.Location.X, p.Location.Y);
        UserGameObject.transform.position    = CurrentScene.Cells[User.Player.CurrentLocation.x, User.Player.CurrentLocation.y].position;
        User.Player.Direction                = p.Direction;
        User.Player.Model.transform.rotation = ClientFunctions.GetRotation(User.Player.Direction);

        User.Inventory = p.Inventory;
        User.Equipment = p.Equipment;

        User.Magics = p.Magics;
        foreach (ClientMagic magic in User.Magics)
        {
            GameScene.SkillDialog.AddMagic(magic);
        }

        User.BindAllItems();

        User.Player.Camera.SetActive(true);
        //User.Player.MiniMapCamera.SetActive(true);
        ObjectList.Add(p.ObjectID, User.Player);
        UserGameObject.GetComponentInChildren <AudioListener>().enabled = true;
        Tooltip.cam = User.Player.Camera.GetComponent <Camera>();
        GameScene.partyController.name = User.Player.Name;
    }
Пример #5
0
        public void Load(S.UserInformation info)
        {
            Id            = info.RealId;
            Name          = info.Name;
            NameColour    = info.NameColour;
            GuildName     = info.GuildName;
            GuildRankName = info.GuildRank;
            Class         = info.Class;
            Gender        = info.Gender;
            Level         = info.Level;

            CurrentLocation = info.Location;
            MapLocation     = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            Direction = info.Direction;
            Hair      = info.Hair;

            HP = info.HP;
            MP = info.MP;

            Experience    = info.Experience;
            MaxExperience = info.MaxExperience;

            LevelEffects = info.LevelEffects;

            Inventory      = info.Inventory;
            Equipment      = info.Equipment;
            QuestInventory = info.QuestInventory;

            Magics = info.Magics;

            IntelligentCreatures = info.IntelligentCreatures; //IntelligentCreature
            SummonedCreatureType = info.SummonedCreatureType; //IntelligentCreature
            CreatureSummoned     = info.CreatureSummoned;     //IntelligentCreature

            BindAllItems();

            RefreshStats();

            SetAction();
        }
Пример #6
0
    public void UserInformation(S.UserInformation p)
    {
        User.gameObject.SetActive(true);
        UserGameObject = Instantiate(PlayerModel, User.transform.position, Quaternion.identity);
        UserGameObject.GetComponentInChildren <AudioListener>().enabled = true;

        User.Player          = UserGameObject.GetComponent <PlayerObject>();
        User.Player.ObjectID = p.ObjectID;
        User.Player.ObjectID = p.ObjectID;
        User.SetName(p.Name);
        User.SetClass(p.Class);
        User.Player.Gender = p.Gender;
        User.SetLevel(p.Level);
        User.Experience    = p.Experience;
        User.MaxExperience = p.MaxExperience;

        User.HP = p.HP;
        User.MP = p.MP;

        GameScene.UpdateCharacterIcon();

        User.Player.CurrentLocation          = new Vector2(p.Location.X, p.Location.Y);
        User.Player.gameManager              = this;
        UserGameObject.transform.position    = CurrentScene.Cells[(int)User.Player.CurrentLocation.x, (int)User.Player.CurrentLocation.y].position;
        User.Player.Direction                = p.Direction;
        User.Player.Model.transform.rotation = ClientFunctions.GetRotation(User.Player.Direction);

        User.Inventory = p.Inventory;
        User.Equipment = p.Equipment;
        User.Magics    = p.Magics;

        User.BindAllItems();

        User.Player.Camera.SetActive(true);
        User.Player.MiniMapCamera.SetActive(true);

        Tooltip.cam = User.Player.Camera.GetComponent <Camera>();
    }
Пример #7
0
 public static void UserInformation(S.UserInformation p)
 {
     gameManager.UserInformation(p);
 }
Пример #8
0
        private void GetUserInfo()
        {
            string guildname = MyGuild != null ? MyGuild.Name : "";
            string guildrank = MyGuild != null ? MyGuildRank.Name : "";
            S.UserInformation packet = new S.UserInformation
            {
                ObjectID = ObjectID,
                RealId = (uint)Info.Index,
                Name = Name,
                GuildName = guildname,
                GuildRank = guildrank,
                NameColour = GetNameColour(this),
                Class = Class,
                Gender = Gender,
                Level = Level,
                Location = CurrentLocation,
                Direction = Direction,
                Hair = Hair,
                HP = HP,
                MP = MP,

                Experience = Experience,
                MaxExperience = MaxExperience,

                LevelEffects = LevelEffects,

                Inventory = new UserItem[Info.Inventory.Length],
                Equipment = new UserItem[Info.Equipment.Length],
                QuestInventory = new UserItem[Info.QuestInventory.Length],
                Gold = Account.Gold,
                Credit = Account.Credit,
            };

            //Copy this method to prevent modification before sending packet information.
            for (int i = 0; i < Info.Magics.Count; i++)
                packet.Magics.Add(Info.Magics[i].CreateClientMagic());

            Info.Inventory.CopyTo(packet.Inventory, 0);
            Info.Equipment.CopyTo(packet.Equipment, 0);
            Info.QuestInventory.CopyTo(packet.QuestInventory, 0);

            //IntelligentCreature
            for (int i = 0; i < Info.IntelligentCreatures.Count; i++)
                packet.IntelligentCreatures.Add(Info.IntelligentCreatures[i].CreateClientIntelligentCreature());
            packet.SummonedCreatureType = SummonedCreatureType;
            packet.CreatureSummoned = CreatureSummoned;

            Enqueue(packet);
        }
Пример #9
0
        private void GetUserInfo()
        {
            S.UserInformation packet = new S.UserInformation
                {
                    ObjectID = ObjectID,
                    Name = Name,
                    NameColour = NameColour,
                    Class = Class,
                    Gender = Gender,
                    Level = Level,
                    Location = CurrentLocation,
                    Direction = Direction,
                    Hair = Hair,
                    HP = HP,
                    MP = MP,

                    Experience = Experience,
                    MaxExperience = MaxExperience,
                    Inventory = new UserItem[Info.Inventory.Length],
                    Equipment = new UserItem[Info.Equipment.Length],
                    Gold = Account.Gold,
                };

            //Copy this method to prevent modification before sending packet information.
            for (int i = 0; i < Info.Magics.Count; i++)
                packet.Magics.Add(Info.Magics[i].CreateClientMagic());

            Info.Inventory.CopyTo(packet.Inventory, 0);
            Info.Equipment.CopyTo(packet.Equipment, 0);

            Enqueue(packet);
        }