Inheritance: MonoBehaviour
	private ShowPanels showPanels;										//Reference to ShowPanels script on UI GameObject, to show and hide panels
	
	private void Awake() {
		//Get a reference to ShowPanels attached to UI object
		showPanels = GetComponent<ShowPanels> ();

		//Get a reference to PlayMusic attached to UI object
		playMusic = GetComponent<PlayMusic> ();
	}
	private ShowPanels showPanels;										//Reference to ShowPanels script on UI GameObject, to show and hide panels

	
	void Awake()
	{
		//Get a reference to ShowPanels attached to UI object
	    this.showPanels = this.GetComponent<ShowPanels> ();

		//Get a reference to PlayMusic attached to UI object
	    this.playMusic = this.GetComponent<PlayMusic> ();
	}
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent<ShowPanels>();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent<PlayMusic>();

        //Set the server Address
        //messageBox = GetComponent<Text>();
    }
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.ReadFrom(Buffer, StartIndex);

            PlayInfo = new PlayMusic(Buffer, cursor);
            cursor += PlayInfo.ByteLength;

            return cursor - StartIndex;
        }
Beispiel #5
0
	void Awake()
	{
		//Get a reference to ShowPanels attached to UI object
		showPanels = GetComponent<ShowPanels> ();
        ui = GameObject.Find("UI");

		//Get a reference to PlayMusic attached to UI object
		playMusic = GetComponent<PlayMusic> ();

        // Make time run normally
        Time.timeScale = 1;
	}
Beispiel #6
0
        public void ToggleMusic(Mobile m, bool play)
        {
            if (m_ActualSong != MusicName.Invalid && m.NetState != null)
            {
                m.Send(PlayMusic.InvalidInstance);                   // Stop actual music

                if (play)
                {
                    m.Send(PlayMusic.GetInstance(m_ActualSong));
                }
            }
        }
Beispiel #7
0
        public void TestPlayMusic(MusicName music)
        {
            var data = new PlayMusic(music).Compile();

            Span <byte> expectedData = stackalloc byte[3];
            var         pos          = 0;

            expectedData.Write(ref pos, (byte)0x6D);    // Packet ID
            expectedData.Write(ref pos, (ushort)music); // Flags

            AssertThat.Equal(data, expectedData);
        }
Beispiel #8
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        //Get a reference to the CanvasGroup attached to the main menu so that we can fade it's alpha
        menuCanvasGroup = GetComponent <CanvasGroup>();

        fadeImage.color = menuSettingsData.sceneChangeFadeColor;
    }
Beispiel #9
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #10
0
        private static void OnCommandMusic(CommandEventArgs e)
        {
            e.Mobile.SendMessage("Tocando musiquinha :B");
            var musicId = e.GetInt32(0);

            try
            {
                e.Mobile.NetState.Send(PlayMusic.GetInstance(musicId));
            } catch (Exception ex)
            {
                e.Mobile.SendMessage("Achei a musica nao veih " + ex.Message);
            }
        }
Beispiel #11
0
 void Awake()
 {
     //Make this object w/ music audio source continue throughout all scenes.
     //Only if there isn't already one that exists - to prevent stacking
     if (instanceRef == null)
     {
         instanceRef = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Beispiel #12
0
    private ShowPanels showPanels;                                                                              //Reference to ShowPanels script on UI GameObject, to show and hide panels


    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        var y        = Title.anchoredPosition.y;
        var sequence = DOTween.Sequence();

        sequence.Append(Title.DOAnchorPosY(y + 50, 3f).SetEase(Ease.InOutSine))
        .Append(Title.DOAnchorPosY(y, 4f).SetEase(Ease.InOutSine)).SetLoops(-1);
    }
Beispiel #13
0
 //Awake fonksiyonu obje oluşurken çalışan ilk fonksiyon.
 void Awake()
 {
     //Eğer müzik çalan PlayMusic sınıfına sahip obje yok ise music adlı değişkene ilk oluşturulan objeyi static değişkene atıyoruz.
     if (music == null)
     {
         music = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
     //Eğer müzik çalan PlayMusic sınıfına sahip obje var ise yeni oluşturulan objeyi yok ediyoruz.
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #14
0
        public Present()
        {
            view     = new View();
            tank     = new MyTank();
            bot      = new BotTanks();
            music    = new PlayMusic();
            gameOver = new GameOver();
            post     = new PostInFacebook();

            Events();
            new Task(view.Render).Start();
            new Task(ThreadBot).Start();
            view.Click();
        }
Beispiel #15
0
    void Awake()
    {
        // Make sure there is only 1 instance of the UI
        if (instance)
        {
            Destroy(instance.gameObject);
        }
        instance = this;

        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();
    }
 public override void OnMovement(Mobile m, Point3D oldLocation)
 {
     if (m_Talked == false)
     {
         if (m.InRange(this, 8) && m is PlayerMobile)
         {
             m.Send(PlayMusic.GetInstance(MusicName.Taiko));
             m_Talked = true;
             SayRandom(CalcifinaSay, this);
             this.Move(GetDirectionTo(m.Location));
             SpamTimer t = new SpamTimer();
             t.Start();
         }
     }
 }
Beispiel #17
0
        public ComponentInputlist(DirectoryInfo aDirectoryInfo, PlayMusic aPlayMusic, GetPlayingMusic aGetPlayingMusic)
        {
            directoryInfo   = aDirectoryInfo;
            playMusic       = aPlayMusic;
            getPlayingMusic = aGetPlayingMusic;

            filePathList               = new List <string>();
            timeStampTicksDictionary   = new Dictionary <string, long>();
            musicInformationDictionary = new Dictionary <string, InputMusicInformation>();

            UpdateFileList(null, null);

            isSelectedAll  = false;
            scrollPosition = Vector2.zero;
        }
Beispiel #18
0
    private ShowPanels showPanels;                                                                              //Reference to ShowPanels script on UI GameObject, to show and hide panels


    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        // **** ver se é o local correto;

        showPanels.HideGameplayPanel();
        showPanels.ShowIntro();
        showPanels.HideMenu();
        showPanels.HideEndGamePanel();
    }
Beispiel #19
0
    public void Awake()
    {
        if (Instance)
        {
            DestroyImmediate(gameObject);
        }
        else
        {
            showPanels = GetComponent <ShowPanels>();
            music      = GetComponent <PlayMusic>();

            DontDestroyOnLoad(gameObject);
            Instance = this;
        }
    }
        //UOSI
        public override void OnEnter(Mobile m)
        {
            base.OnEnter(m);


            if (!(m is PlayerMobile))
            {
                return;
            }

            m.SendMessage("Thou hast entered " + Name);

            m.Send(PlayMusic.GetInstance(MusicName.Invalid));
            m.Send(PlayMusic.GetInstance((m as PlayerMobile).GetRandomWildernessMusic()));
        }
        /// <summary>
        /// On player logout, broadcast a message.
        /// </summary>
        public static void EventSink_Logout(LogoutEventArgs e)
        {
            if (e.Mobile.Player)
            {
                e.Mobile.Send(PlayMusic.GetInstance(MusicName.LoginLoop));

                if (e.Mobile.AccessLevel <= m_AnnounceLevel)
                {
                    CommandHandlers.BroadcastMessage(AccessLevel.Player, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name));
                }
                else //broadcast any other level to the staff
                {
                    CommandHandlers.BroadcastMessage(AccessLevel.Counselor, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name));
                }
            }
        }
Beispiel #22
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        myAudioSource = GetComponent <AudioSource>();
        if (myAudioSource == null)
        {
            Debug.Log("cannot find audiosource from the StartOptions script");
        }

        myGameManager = myGameController.GetComponent <GameManager>();
    }
Beispiel #23
0
        public override void OnInspectorGUI()
        {
            if (Application.isPlaying)
            {
                return;
            }
            EditorGUILayout.Space();
            PlayMusic temp = target as PlayMusic;

            Undo.RecordObject(target, "F");
            string clipName = temp.audioClip;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Music", GUILayout.MinWidth(+50));
            string    clipPath = GetMusicPath(clipName);
            AudioClip clip     = GetAudioClip(clipPath);

            if (clip != null)
            {
                temp.audioClip = clip.name;
                clipName       = clip.name;
            }
            int index = allsound.IndexOf(clipName);

            //xiala
            index = EditorGUILayout.Popup(index, allsound.ToArray(), GUILayout.MinWidth(50));
            if (index >= 1)
            {
                temp.audioClip = allsound[index];
            }
            else
            {
                temp.audioClip = string.Empty;
            }

            EditorGUILayout.EndHorizontal();

            serializedObject.Update();
            EditorGUILayout.PropertyField(m_Serialize_trigger);
            // EditorGUILayout.PropertyField(m_Serialize_volume);
            // EditorGUILayout.PropertyField(m_Serialize_pitch);
            serializedObject.ApplyModifiedProperties();
            if (GUILayout.Button("refresh music res"))
            {
                GetMusicRes(true);
            }
        }
Beispiel #24
0
    void Awake()
    {
        if (Instance != null)
        {
            Instance.showPanels.ShowMenu();
            Destroy(this.gameObject);
            return;
        }

        Instance = this;

        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();
    }
Beispiel #25
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        //Get a reference to the CanvasGroup attached to the main menu so that we can fade it's alpha
        menuCanvasGroup = GetComponent <CanvasGroup>();

        fadeImage.color = menuSettingsData.sceneChangeFadeColor;

        // hide cursor
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        //Get a reference to the CanvasGroup attached to the main menu so that we can fade it's alpha
        menuCanvasGroup = GetComponent <CanvasGroup>();

        // fadeImage.color = menuSettingsData.sceneChangeFadeColor;
        foreach (var component in disabledOnAwakeStart)
        {
            component.enabled = false;
        }
    }
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
            instance = this;
        else if (instance != this)
            Destroy (gameObject);

        enemies = new List<Enemy> ();
        DontDestroyOnLoad (gameObject);
        boardScript = GetComponent<BoardManager> ();
        MusicPlayer = GameObject.Find("UI").GetComponent<PlayMusic>();

        Instantiate(GameUI);
        levelImage = GameObject.Find("LevelImage");
        levelText = GameObject.Find("LevelText").GetComponent<Text>();
        Instantiate(Player);
        InitGame ();
    }
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (DateTime.Now >= m_NextTalk && InRange(m, 10) && InLOS(m) && m is PlayerMobile && !m.Hidden)                   // check if it's time to talk & mobile in range & in los.
            {
                m.Send(PlayMusic.GetInstance(MusicName.BattleOnStones));

                m_NextTalk = DateTime.Now + TalkDelay;                 // set next talk time
                switch (Utility.Random(2))
                {
                case 0: Say("**");
                    break;

                case 1: Say("**");
                    break;
                }
                ;
            }
        }
Beispiel #29
0
        public static async Task SendMessagePandora(PlayMusic myMusic)
        {
            //TODO: Replace the hardcoded IP Address
            //Create telnet client to send command to control Mirage Media Streamer
            using (Client client = new Client(myMusic.IPAddress, 5004, new System.Threading.CancellationToken()))
            {
                string theCommand = "Ping";
                await client.WriteLine(theCommand);

                string u = await client.TerminatedReadAsync("\r\n", TimeSpan.FromMilliseconds(2000));

                Debug.WriteLine(u);

                theCommand = "setInstance Main";
                await client.WriteLine(theCommand);

                theCommand = "ClearRadioFilter";
                await client.WriteLine(theCommand);

                u = await client.TerminatedReadAsync("\r\n", TimeSpan.FromMilliseconds(2000));

                Debug.WriteLine(u);

                theCommand = "ClearNowPlaying";
                await client.WriteLine(theCommand);

                //Play Pandora radio station
                theCommand = @"PlayRadioStation """ + myMusic.Artist + @" Radio""";
                await client.WriteLine(theCommand);

                u = await client.TerminatedReadAsync("\r\n", TimeSpan.FromMilliseconds(800));

                Debug.WriteLine(u);
                int errorPos = u.IndexOf("Station not found");
                if (errorPos > 0)
                {
                    //No radio station, so play it on spotify.
                    await SendMessageSpotify(myMusic);
                }

                theCommand = "Play";
                await client.WriteLine(theCommand);
            }
        }
Beispiel #30
0
        public static async System.Threading.Tasks.Task <string> WebElanPandoraAsync(PlayMusic mymusic)
        {
            await SendMessageToElan.InitializeElan(mymusic);

            //initialize the web client
            theIPAddress = mymusic.IPAddress;

            //send the request to the Rest Sharp IP address
            // client = new RestClient("http://" + theIPAddress + "/api");

            //set the room to play the music in
            string theCommand = @"setzone """ + mymusic.Room + @"""";

            ProcessWebPost(theCommand);

            // power the speaker on
            ProcessWebPost("Power on");

            //set the source to main
            theCommand = @"setsource ""Main""";
            ProcessWebPost(theCommand);

            //Set the instance to the Main player
            ProcessWebPost("setInstance/Main");

            //clear the queue
            ProcessWebPost("ClearNowPlaying");

            //clear the queue
            ProcessWebPost("Stop");

            //send Station to Pandora
            Rootobject results = ProcessWebGet("PlayRadioStation/" + mymusic.Artist + " Radio");

            //Add switch to spotify if no station
            if (results.events.Length < 3)
            {
                WebElan(mymusic);
            }

            return("OK");
        }
        public override void OnEnter(Mobile m)
        {
            if (m is PlayerMobile)
            {
                PlayerMobile player = m as PlayerMobile;

                if (m.Warmode)
                {
                    ////////// Boss Theme 4 //////////
                    m.Send(PlayMusic.GetInstance(MusicName.Docktown));
                }
                else
                {
                    ////////// Boss Theme 4 //////////
                    m.Send(PlayMusic.GetInstance(MusicName.Docktown));
                }
            }

            base.OnEnter(m);
        }
Beispiel #32
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        uiManager.pause(true);

        //Load saved music options if they are set
        SavedVariables savedVariables = GameObject.Find("DontDestroy").GetComponent <SavedVariables>();

        if (savedVariables.set)
        {
            showPanels.ShowOptionsPanel();
            GameObject.FindGameObjectWithTag("Slider").GetComponent <Slider>().value = savedVariables.sliderValue;
            GameObject.FindGameObjectWithTag("Toggle").GetComponent <Toggle>().isOn  = savedVariables.toggleValue;
            showPanels.HideOptionsPanel();
        }
    }
Beispiel #33
0
    private void Start()
    {
        pm = player.GetComponentInChildren <PlayMusic>();
        pm.ChangeClip(levelMusicId);

        hasSong1 = PlayerPrefs.GetInt("Song1") != (int)music.none;
        hasSong2 = PlayerPrefs.GetInt("Song2") != (int)music.none;
        hasSong3 = PlayerPrefs.GetInt("Song3") != (int)music.none;

        if (hasSong1)
        {
            currentSongIn1 = PlayerPrefs.GetInt("Song1") == (int)levelMusicId;
        }
        if (hasSong2)
        {
            currentSongIn2 = PlayerPrefs.GetInt("Song2") == (int)levelMusicId;
        }
        if (hasSong3)
        {
            currentSongIn3 = PlayerPrefs.GetInt("Song2") == (int)levelMusicId;
        }
    }
Beispiel #34
0
        internal static void OnRegionChange(Mobile m, Region oldRegion, Region newRegion)
        {
            if (newRegion != null && m.NetState != null)
            {
                m.CheckLightLevels(false);

                if (oldRegion == null || oldRegion.Music != newRegion.Music)
                {
                    m.Send(PlayMusic.GetInstance(newRegion.Music));
                }
            }

            Region oldR = oldRegion;
            Region newR = newRegion;

            while (oldR != newR)
            {
                int oldRChild = (oldR != null ? oldR.ChildLevel : -1);
                int newRChild = (newR != null ? newR.ChildLevel : -1);

                if (oldRChild >= newRChild && oldR != null)
                {
                    oldR.OnExit(m);

                    oldR = oldR.Parent;
                }

                if (newRChild >= oldRChild && newR != null)
                {
                    newR.OnEnter(m);

                    EventSink.InvokeOnEnterRegion(new OnEnterRegionEventArgs(m, oldRegion, newR));

                    newR = newR.Parent;
                }
            }
        }
Beispiel #35
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (DateTime.Now >= m_NextTalk && InRange(m, 10) && InLOS(m) && m is PlayerMobile && !m.Hidden)                   // check if it's time to talk & mobile in range & in los.
            {
                m.Send(PlayMusic.GetInstance(MusicName.StygianDragon));

                ShootLightningArrow(m);

                RangePerception = 300;
                CurrentSpeed    = BoostedSpeed;
                this.Combatant  = m;

                m_NextTalk = DateTime.Now + TalkDelay;                 // set next talk time
                switch (Utility.Random(2))
                {
                case 0: Say("**");
                    break;

                case 1: Say("**");
                    break;
                }
                ;
            }
        }
Beispiel #36
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        //setup ChilliConnect SDK with game token and verbose logging
        chilliConnect       = new ChilliConnectSdk(GAME_TOKEN, true);
        ChilliConnectId     = PlayerPrefs.GetString("ChilliConnectId");
        ChilliConnectSecret = PlayerPrefs.GetString("ChilliConnectSecret");
        UnityEngine.Debug.Log("Loaded from PlayerPrefs ChilliconnectId: " + ChilliConnectId + " ChilliConnectSecret: " + ChilliConnectSecret);

        //if player not created
        if (ChilliConnectId.Length == 0)
        {
            CreateAndLoginPlayer();
        }
        else
        {
            LoginPlayer();
        }
    }
Beispiel #37
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent<ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent<PlayMusic> ();

        dontDestroy = GetComponent<DontDestroy> ();

        //Check if there is an existing instance of this object
        if((instance) && (instance.GetInstanceID() != GetInstanceID()))
            DestroyImmediate(gameObject); //Delete duplicate
        else
        {
            instance = this; //Make this object the only instance
            DontDestroyOnLoad (gameObject); //Set as do not destroy
        }
    }
Beispiel #38
0
    void Awake()
    {
        /*uisys = GameObject.FindGameObjectsWithTag("UI");
        if (uisys.Length != 1) {
            Destroy (gameObject);
        }*/

        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent<ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent<PlayMusic> ();
    }
Beispiel #39
0
    //Awake is called before Start()
    void Awake()
    {
        //Get a component reference to ShowPanels attached to this object, store in showPanels variable
        showPanels = GetComponent<ShowPanels> ();
        //Get a component reference to StartButton attached to this object, store in startScript variable
        startScript = GetComponent<StartOptions> ();

        playMusic = GetComponent<PlayMusic>();
    }
Beispiel #40
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent<ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent<PlayMusic> ();

        leftCurtain  = GameObject.Find("left curtain").transform;
        rightCurtain = GameObject.Find("right curtain").transform;
        leftCurtainTarget  = leftCurtain.transform.position;
        rightCurtainTarget = rightCurtain.transform.position;
        leftCurtainTarget.x  = -target;
        rightCurtainTarget.x = target;
    }
 // Use this for initialization
 void Start()
 {
     playMusic = GameObject.Find("UI").GetComponentInChildren<PlayMusic>();
     lightSource = lightSourceObject.GetComponent<Light>();
     rainbowPonies.GetComponent<ParticleSystem>().Pause();
     fails = 0;
     level = 1;
     required_sequence = new ArrayList();
     currentSequence = new ArrayList();
     mirrorSequenceIndex = new ArrayList();
     StartGame();
 }
	private PlayMusic playMusic;										//Reference to PlayMusic script

	void Awake() {
		//Get a reference to PlayMusic attached to UI object
		playMusic = GetComponent<PlayMusic> ();
	}
 // Use this for initialization
 void Start()
 {
     playMusic = GameObject.Find("UI").GetComponentInChildren<PlayMusic>();
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public DataController()
        {          
            // create lists
            roomObjects = new RoomObjectList(300);
            roomObjectsFiltered = new RoomObjectListFiltered(roomObjects);
            projectiles = new ProjectileList(50);
            onlinePlayers = new OnlinePlayerList(200);
            inventoryObjects = new InventoryObjectList(100);
            avatarCondition = new StatNumericList(5);
            avatarAttributes = new StatNumericList(10);
            avatarSkills = new SkillList(100);
            avatarSpells = new SkillList(100);
            avatarQuests = new SkillList(100);
            roomBuffs = new ObjectBaseList<ObjectBase>(30);
            avatarBuffs = new ObjectBaseList<ObjectBase>(30);
            spellObjects = new SpellObjectList(100);
            backgroundOverlays = new BackgroundOverlayList(5);
            playerOverlays = new ObjectBaseList<PlayerOverlay>(10);            
            chatMessages = new BaseList<ServerString>(101);
            gameMessageLog = new BaseList<GameMessage>(100);
            visitedTargets = new List<RoomObject>(50);
            clickedTargets = new List<uint>(50);
            actionButtons = new ActionButtonList();
            ignoreList = new List<string>(20);
            chatCommandHistory = new List<string>(20);

            // attach some listeners
            RoomObjects.ListChanged += OnRoomObjectsListChanged;
            Projectiles.ListChanged += OnProjectilesListChanged;
            ChatMessages.ListChanged += OnChatMessagesListChanged;

            // make some lists sorted
            OnlinePlayers.SortByName();
            AvatarSkills.SortByResourceName();
            AvatarSpells.SortByResourceName();
            SpellObjects.SortByName();
            
            // create single data objects
            roomInformation = new RoomInfo();
            lightShading = new LightShading(0, new SpherePosition(0, 0));
            backgroundMusic = new PlayMusic();
            guildInfo = new GuildInfo();
            guildShieldInfo = new GuildShieldInfo();
            guildAskData = new GuildAskData();
            diplomacyInfo = new DiplomacyInfo();
            adminInfo = new AdminInfo();
            tradeInfo = new TradeInfo();
            buyInfo = new BuyInfo();
            welcomeInfo = new WelcomeInfo();
            charCreationInfo = new CharCreationInfo();
            statChangeInfo = new StatChangeInfo();
            newsGroup = new NewsGroup();
            objectContents = new ObjectContents();
            effects = new Effects();
            lookPlayer = new PlayerInfo();
            lookObject = new ObjectInfo();
            clientPreferences = new PreferencesFlags();

            // some values
            ChatMessagesMaximum = 100;
            ChatCommandHistoryMaximum = 20;
            ChatCommandHistoryIndex = -1;
            AvatarObject = null;
            IsResting = false;
            SelfTarget = false;
            IsNextAttackApplyCastOnHighlightedObject = false;
            AvatarID = UInt32.MaxValue;
            TargetID = UInt32.MaxValue;
            ViewerPosition = V3.ZERO;
            UIMode = UIMode.None;
        }
Beispiel #45
0
        public static Packet GetInstance(MusicName name)
        {
            if (name == MusicName.Invalid)
            {
                return InvalidInstance;
            }

            int v = (int)name;
            Packet p;

            if (v >= 0 && v < m_Instances.Length)
            {
                p = m_Instances[v];

                if (p == null)
                {
                    m_Instances[v] = p = SetStatic(new PlayMusic(name));
                }
            }
            else
            {
                p = new PlayMusic(name);
            }

            return p;
        }
 public PlayMidiMessage(uint ResourceID) 
     : base(MessageTypeGameMode.PlayMidi)
 {
     this.PlayInfo = new PlayMusic(ResourceID);
 }