Example #1
0
    public void ProcessLoad(SoundPlayData Data)
    {
        /// 이미 로드 중인 데이터 클립 제거 추가
        ///
        /// 이미 로드중인 클립이 있는가? => 플레이 리스트에 추가
        ///

        /*
         * for (int i = 0; i < Loaders.size; i++)
         * {
         *  if (Loaders[i].m_strName == Data.m_strSoundFileName)
         *  {
         *     Loaders[i].AddPlayData(Data);
         *      return;
         *  }
         * }
         */
        AudioClip TargetClip = Resources.Load <AudioClip>(string.Concat(m_strLocalLoad, Data.m_strSoundFileName));

        if (TargetClip == null)
        {
            Debugs.LogError("[사운드로드] ProcessLoad 실패! 대상 클립(", Data.m_strSoundFileName, ")을 찾을 수 없습니다!");
        }
        else
        {
            m_Storage.AddAudioClip(TargetClip);
            Data.m_AudioClipGroup.PushAudioClip(TargetClip);
            Data.LoadComplete(TargetClip, 0.0f);
            Debugs.Log(string.Concat("[사운드로드] 완료! ", Data.m_LoadedAudioClip.name, " 소요 시간 [", 0.0f, "]"));
            Data.TryPlay();
        }
        return;
    }
Example #2
0
        public void TestStart()
        {
            try
            {
                LightObject lightObject = new LightObject();

                LightObject dummy = new LightObject();
                dummy.PutInt(1, 1000);
                dummy.PutInt(2, 10);

                LightObject dummy2 = new LightObject();
                dummy2.PutInt(1, 1000);
                dummy2.PutInt(2, 10);

                dummy.PutObject(1, dummy2);

                lightObject.PutObject(2, dummy);
                lightObject.PutObject(3, dummy2);

                byte[] data = lightObject.Serialize();

                LightObject coveredObject = LightObject.Deserialize(data);

                coveredObject.GetInt(1);

                Debugs.Log(coveredObject);
            }
            catch (Exception e)
            {
                Debugs.Log(e);
            }
        }
        /// <summary>
        /// TimerJob을 Global Dispatch Timer에 등록합니다.
        /// GameObject인 bindTarget이 파괴되면 작업도 취소됩니다.
        /// 이 메서드는 동작 시간의 유효성을 따로 검사해주지 않습니다.
        /// </summary>
        /// <param name="job">실행할 TimerJob 객체</param>
        /// <param name="bindTarget">라이프 사이클을 함께할 GameObject</param>
        public void PushTimerJob(TimerJob job, GameObject bindTarget)
        {
            if (job == null)
            {
                Debugs.LogError("Job이 null입니다.");
                return;
            }

            if (bindTarget == null)
            {
                Debugs.LogError("bindTarget이 null입니다.");
                return;
            }

            var destroyTrigger = bindTarget.GetComponent <DestroyTrigger>();

            if (destroyTrigger == null)
            {
                                #if __USE_TIMER_LOG
                Debugs.Log("Create New DestroyTrigger");
                                #endif
                destroyTrigger = bindTarget.AddComponent <DestroyTrigger>();
            }

                        #if __USE_TIMER_LOG
            Debugs.Log("Attatch DestroyTrigger to gameObject");
                        #endif

            if (RegisterTrigger(destroyTrigger, bindTarget, job))
            {
                timedJobQueue.Enqueue(job);
            }
        }
Example #4
0
 public void AddProtocol(Protocol protocol)
 {
     if (protocolList.ContainsKey(protocol.type))
     {
         Debugs.Log("[EmptyProtocol] 중복된 프로토콜 등록이있습니다!");
         return;
     }
     protocolList.Add(protocol.type, protocol);
 }
Example #5
0
    /// <summary>
    /// 오디오를 리스트에서 삭제한다.
    /// </summary>
    /// <param name="ao"></param>
    static public void RemoveAudioObject(AudioObject ao)
    {
        if (ao == null || Instance == null || Instance.audioObjectList == null)
        {
            return;
        }
        Instance.audioObjectList.Remove(ao);

        Debugs.Log("[AudioObject.Remove] Count:", Instance.audioObjectList.Count);
    }
Example #6
0
    /// <summary>
    /// 오디오 설정 변경 발생시
    /// 이어폰이나 HDMI 등을 연결시 발생.
    /// </summary>
    /// <param name="deviceWasChanged"></param>
    void OnAudioConfigurationChanged(bool deviceWasChanged)
    {
        int bufferLength, numBuffers;

        AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers);
        AudioConfiguration config       = AudioSettings.GetConfiguration();
        string             m_audio_info = string.Format("Audio : {0 : #, #} Hz {1} {2} samples {3} buffers", config.sampleRate, config.speakerMode.ToString(), config.dspBufferSize, numBuffers);

        Debugs.Log("[AudioInfo]", m_audio_info);
    }
Example #7
0
        public void Listen()
        {
            Debugs.Log("[NetworkManager] Listen");
            socket.Bind(endPoint);
            socket.Listen(100);

            while (true)
            {
                BeginAccept();
            }
        }
Example #8
0
    private void MultiObjectTimerTest()
    {
        Debugs.Log("MultiObjectBindTimerTest 시작");
        List <GameObject> gameObjList = new List <GameObject>();

        for (int i = 0; i < gameObjList.Count; i++)
        {
            Destroy(gameObjList[i]);
        }

        gameObjList.Clear();

        for (int i = 0; i < 10; i++)
        {
            var newGo = new GameObject(string.Concat("MultiMainDispatchTimer", i));
            gameObjList.Add(newGo);
        }

        Stopwatch sw = new Stopwatch();

        Debugs.LogFormat("Start GO Timer Test - {0}", Time.realtimeSinceStartup);

        for (int i = 0; i < 1000; i++)
        {
            int index   = i;
            int randSec = UnityEngine.Random.Range(0, 100);
            int randIdx = UnityEngine.Random.Range(0, 10);
            var go      = gameObjList[randIdx];
            Debugs.LogWarningFormat("I am {0}, reserve GO Timer - {1} Attatched To Object {2}", index, randSec.ToString(), randIdx);
            sw.Start();
            GlobalDispatchTimer.Instance.PushTimerJob(() =>
            {
                Debugs.LogErrorFormat("GO PPI BBIB - I am {0}, take {1} seconds", index, randSec);
            }, randSec, go);
            sw.Stop();

            Destroy(go);
        }

        /*
         * GlobalDispatchTimer.Instance.PushTimerJob(() =>
         * {
         *  for (int i = 0; i < 10; i++)
         *      Destroy(gameObjList[i]);
         * }, 10);
         */

        Debugs.LogFormat("End GO Timer Test - {0}", Time.realtimeSinceStartup);
        Debugs.Log("Time : " + sw.ElapsedMilliseconds + "ms");

        Debugs.Log("---------------------------------------------------------------------");
    }
Example #9
0
        private void BeginAccept()
        {
            Debugs.Log("[NetworkManager] BeginAccept");
            // Set the event to nonsignaled state.
            signal.Reset();

            socket.BeginAccept(
                new AsyncCallback(AcceptCallback),
                socket);

            // Wait until a connection is made before continuing.
            signal.WaitOne();
        }
        /// <summary>
        /// TimerJob과 라이프 사이클을 같이 하는 GameObject를 순회하면서 체크합니다.
        /// </summary>
        private void CheckDestroyedGameObject()
        {
            var markedList = new List <long>();

            if (triggerList.Count > 0)
            {
                markedList.Clear();

                var ptr = triggerList.First;
                while (ptr != null)
                {
                    var current = ptr;
                    var trigger = current.Value;

                    if (!trigger.IsActivated)
                    {
#if __USE_TIMER_LOG
                        Debugs.Log("Bind된 gameobject Destroy! TimerJob을 비활성화 합니다.");
#endif
                        markedList.Add(trigger.Key);

                        //Linked List 이므로 O(1)...
                        triggerList.Remove(current);
                    }

                    ptr = ptr.Next;
                }

                foreach (var triggerKey in markedList)
                {
                    // priorityQueue를 사용하여 TimerJob 큐를 스케줄링 하므로 TimerJob에 마크만 해두고
                    // 해당 Job의 tick이 되어 실행될때 비활성화 시켜주는게 낫다.
                    List <WeakReference> triggeredJobWeakRefList;
                    if (triggerMap.TryGetValue(triggerKey, out triggeredJobWeakRefList))
                    {
                        foreach (WeakReference triggeredJobRef in triggeredJobWeakRefList)
                        {
                            TimerJob triggeredJob = triggeredJobRef.Target as TimerJob;
                            if (triggeredJob != null)
                            {
                                triggeredJob.MarkDisposed();
                            }
                        }

                        triggerMap.Remove(triggerKey);
                    }
                }
            }
        }
Example #11
0
        private void FindProtocol(byte[] data)
        {
            LightObject lightObj = LightObject.Deserialize(data);

            lightObj.PrintDump();
            E_PROTOCOL_TYPE protocolType   = (E_PROTOCOL_TYPE)lightObj.GetInt(1);
            Protocol        targetProtocol = FindProtocol(protocolType);

            if (targetProtocol == null)
            {
                Debugs.Log("[EmptyProtocol] 해당 프로토콜을 찾을 수 없습니다.");
                return;
            }
            targetProtocol.Process(lightObj);
        }
Example #12
0
        public void AcceptCallback(IAsyncResult ar)
        {
            Debugs.Log("[NetworkManager] AcceptCallback");
            // Signal the main thread to continue.
            signal.Set();

            // Get the socket that handles the client request.
            Socket listener = (Socket)ar.AsyncState;
            Socket handler  = listener.EndAccept(ar);

            // Create the state object.
            StateObject state = new StateObject();

            state.workSocket = handler;
            handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
                                 new AsyncCallback(ReadCallback), state);
        }
Example #13
0
    private void TimeReserveTest()
    {
        Debugs.Log("TimeReserveTest 시작");

        List <GameObject> gameObjList = new List <GameObject>();

        for (int i = 0; i < gameObjList.Count; i++)
        {
            Destroy(gameObjList[i]);
        }

        gameObjList.Clear();

        for (int i = 0; i < 10; i++)
        {
            var newGo = new GameObject(string.Concat("MultiMainDispatchTimer", i));
            gameObjList.Add(newGo);
        }

        Stopwatch sw = new Stopwatch();

        Debugs.LogFormat("Start Reserve Timer Test - {0}", Time.realtimeSinceStartup);

        for (int i = 0; i < 1000; i++)
        {
            int      index       = i;
            int      randSec     = UnityEngine.Random.Range(0, 10);
            DateTime reserveTime = DateTime.Now.AddSeconds(randSec);
            Debugs.LogWarningFormat("I am {0}, reserve GO Timer - Reserve Time: {1}", index, randSec.ToString(), reserveTime);
            sw.Start();
            GlobalDispatchTimer.Instance.PushTimerJob(() =>
            {
                Debugs.LogErrorFormat("GO PPI BBIB - I am {0}, Difference: {1}ms", index,
                                      (DateTime.Now.Ticks - reserveTime.Ticks) / 10000L);
            }, reserveTime);
            sw.Stop();
        }

        Debugs.Log("Time : " + sw.ElapsedMilliseconds + "ms");

        //Debugs.Log("---------------------------------------------------------------------");

        Debugs.Log("---------------------------------------------------------------------");
    }
Example #14
0
    private void SingleObjectTimerTest()
    {
        Debugs.Log("SingleObjectTimerTest 시작");
        Queue <GameObject> gameObjQueue = new Queue <GameObject>();

        while (gameObjQueue.Count > 0)
        {
            var go = gameObjQueue.Dequeue();
            Destroy(go);
        }

        for (int i = 0; i < 1000; i++)
        {
            var newGo = new GameObject(string.Concat("SingleMainDispatchTimer", i));
            gameObjQueue.Enqueue(newGo);
        }

        Stopwatch sw = new Stopwatch();

        Debugs.LogFormat("Start GO Timer Test - {0}", Time.realtimeSinceStartup);

        for (int i = 0; i < 1000; i++)
        {
            int index   = i;
            int randSec = UnityEngine.Random.Range(0, 100);
            var go      = gameObjQueue.Dequeue();
            Debugs.LogWarningFormat("I am {0}, reserve GO Timer - {1}", index, randSec.ToString());
            sw.Start();
            GlobalDispatchTimer.Instance.PushTimerJob(() =>
            {
                Debugs.LogErrorFormat("GO PPI BBIB - I am {0}, take {1} seconds", index, randSec);
            }, randSec, go);
            sw.Stop();

            Destroy(go);
        }

        Debugs.LogFormat("End GO Timer Test - {0}", Time.realtimeSinceStartup);
        Debugs.Log("Time : " + sw.ElapsedMilliseconds + "ms");

        Debugs.Log("---------------------------------------------------------------------");
    }
Example #15
0
        public void ReadCallback(IAsyncResult ar)
        {
            Debugs.Log("[NetworkManager] ReadCallback");
            String content = String.Empty;

            // Retrieve the state object and the handler socket
            // from the asynchronous state object.
            StateObject state   = (StateObject)ar.AsyncState;
            Socket      handler = state.workSocket;
            // Read data from the client socket.
            int bytesRead = handler.EndReceive(ar);

            if (bytesRead > 0)
            {
                byte[] data = new byte[bytesRead];
                System.Buffer.BlockCopy(state.buffer, 0, data, 0, bytesRead);
                packetHandler.Receieve(data);

                //// There  might be more data, so store the data received so far.
                //state.sb.Append(Encoding.ASCII.GetString(
                //    state.buffer, 0, bytesRead));

                //// Check for end-of-file tag. If it is not there, read
                //// more data.
                //content = state.sb.ToString();
                //if (content.IndexOf("<EOF>") > -1)
                //{
                //    // All the data has been read from the
                //    // client. Display it on the console.
                //    Console.WriteLine("Read {0} bytes from socket. \n Data : {1}",
                //        content.Length, content);
                //    // Echo the data back to the client.
                //    Send(handler, content);
                //}
                //else
                //{
                //    // Not all data received. Get more.
                //    handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
                //    new AsyncCallback(ReadCallback), state);
                //}
            }
        }
Example #16
0
    private void LogTaskList()
    {
        var log = new StringBuilder();

        var taskList = GlobalDispatchTimer.Instance.GetTaskList();

        foreach (var task in taskList)
        {
            TimerJob timerJob = task.Value;
            var      executor = timerJob.GetExecutor();

            log.AppendFormat("task: {0}, executedTick: {1}, is_disposed: {2}\n",
                             string.Concat(executor.Target, " - ", executor.Method),
                             timerJob.ExecutedTicks, timerJob.IsDisposed());
        }

        log.Insert(0, string.Format("currentTick: {0}\n", Time.realtimeSinceStartup));

        Debugs.Log(log.ToString());
    }
Example #17
0
    /// <summary>
    /// 해당 Enum에 맞는 버튼 스타일을 가져옵니다.
    /// </summary>
    /// <param name="eStyle"></param>
    /// <returns></returns>
    static public CommonButtonStyle GetStyle(E_COMMON_BUTTON_STYLE eStyle)
    {
        if (m_CommonButtonStyleList == null)
        {
            ReadStyle();
        }

        CommonButtonStyle eTempStyle = null;

        if (m_CommonButtonStyleList.ContainsKey(eStyle))
        {
            eTempStyle = m_CommonButtonStyleList[eStyle];
        }
        else
        {
            Debugs.Log("해당 스타일은 존재하지 않는 스타일입니다. 0번 스타일로 대체됩니다");
            eTempStyle = m_CommonButtonStyleList[E_COMMON_BUTTON_STYLE.COMMON_STAGE_EASY]; ///해당 스타일이 없다면 0번째 스타일을 가져옵니다.
        }

        return(eTempStyle);
    }
        /// <summary>
        /// Global Queue에 delay초 뒤에 실행되도록 작업을 예약합니다.
        /// GameObject인 bindTarget이 파괴되면 작업도 취소됩니다.
        /// </summary>
        /// <param name="timerTask">실행할 작업</param>
        /// <param name="delay">실행까지 남은 초(float)</param>
        /// <param name="bindTarget">라이프 사이클을 함께할 GameObject</param>
        /// <returns>생성된 TimerJob의 할당 해제 가능한 IDisposable 객체를 반환합니다.</returns>
        public IDisposable PushTimerJob(Action timerTask, float delay, GameObject bindTarget)
        {
            if (!ValidateTime(delay))
            {
                return(null);
            }

            if ((object)bindTarget == null)
            {
                Debugs.LogError("bindTarget이 null입니다.");
                return(null);
            }

            var destroyTrigger = bindTarget.GetComponent <DestroyTrigger>();

            if (destroyTrigger == null)
            {
                                #if __USE_TIMER_LOG
                Debugs.Log("Create New DestroyTrigger");
                                #endif
                destroyTrigger = bindTarget.AddComponent <DestroyTrigger>();
            }

                        #if __USE_TIMER_LOG
            Debugs.Log("Attatch DestroyTrigger to gameObject");
                        #endif

            var timerJob = new TimerJob(timerTask, CurrentTicks + delay);

            if (!RegisterTrigger(destroyTrigger, bindTarget, timerJob))
            {
                return(null);
            }

            timedJobQueue.Enqueue(timerJob);

            return(timerJob);
        }
Example #19
0
        public void ProcessPlay()
        {
            UnityEngine.Object Asset = null;
            if (m_Request is AssetBundleRequest)
            {
                AssetBundleRequest LoaderRequest = this.m_Request as AssetBundleRequest;
                Asset = LoaderRequest.asset;
            }
            else if (this.m_Request is ResourceRequest)
            {
                ResourceRequest LoaderRequest = this.m_Request as ResourceRequest;
                Asset = LoaderRequest.asset;
            }

            if (Asset)
            {
                AudioClip TargetClip = Asset as AudioClip;
                float     fDelay     = Time.time - this.m_StartTime;
                for (int i = 0; i < m_PlayDataList.Count; i++)
                {
                    if (i == 0)
                    {
                        SoundManager.Instance.m_Storage.AddAudioClip(TargetClip);
                    }

                    m_PlayDataList[i].m_AudioClipGroup.PushAudioClip(TargetClip);
                    m_PlayDataList[i].LoadComplete(TargetClip, fDelay);
                    m_PlayDataList[i].TryPlay();

#if UNITY_EDITOR
                    if (i == 0)
                    {
                        Debugs.Log(string.Concat("[사운드로드] 완료! ", m_PlayDataList[i].m_LoadedAudioClip.name, " 소요 시간 [", fDelay, "]"));
                    }
#endif
                }
            }
        }
        private static void Init()
        {
            if (!isInited)
            {
                if (!Application.isPlaying)
                {
                    return;
                }

                GlobalDispatchTimer mainDispatcher = null;

                try
                {
                    mainDispatcher = GameObject.FindObjectOfType <GlobalDispatchTimer>();
                }
                catch (Exception e)
                {
                    Debugs.LogError("Failed to create DispatchTimer Instance.");
                }

                // 메인 디스패처가 없으면 만들어 준다.
                if (mainDispatcher == null)
                {
                    new GameObject("GlobalDispatchTimer").AddComponent <GlobalDispatchTimer>();
                }
                else
                {
                    // 있어도 강제로 Awake를 실행 시켜서 초기화 되도록 해준다.
                    instance.Awake();
                }
            }
            else
            {
                Debugs.Log("DispatchTimer가 이미 초기화 되었습니다.");
            }
        }
Example #21
0
    ///// <summary>
    ///// 오디오 그룹에 따라 볼륨을 조절한다.(부모 포함)
    ///// </summary>
    ///// <param name="group"></param>
    //static public void ApplyVolumeAudioObject(AudioGroup group)
    //{
    //    List<AudioObject> aoList = Instance.audioObjectList.FindAll(v => AudioGroup.HasSelfParent(v.AudioGroup, group));
    //    for (int i = 0; i < aoList.Count; ++i)
    //    {
    //        aoList[i].ApplyVolume();
    //    }
    //}
    ///// <summary>
    ///// 오디오 그룹에 따라 Mute를 설정한다.(부모 포함)
    ///// </summary>
    ///// <param name="group"></param>
    //static public void MuteAudioObject(AudioGroup group)
    //{
    //    List<AudioObject> aoList = Instance.audioObjectList.FindAll(v => AudioGroup.HasSelfParent(v.AudioGroup, group));
    //    for (int i = 0; i < aoList.Count; ++i)
    //    {
    //        aoList[i].ApplyMute();
    //    }
    //}
    /// <summary>
    /// 오디오를 리스트에서 추가한다.
    /// </summary>
    /// <param name="ao"></param>
    static public void AddAudioObject(AudioObject ao)
    {
        Instance.audioObjectList.Add(ao);

        Debugs.Log("[AudioObject.Add] Count:", Instance.audioObjectList.Count);
    }
Example #22
0
 public ILightData PrintDump()
 {
     Debugs.Log(string.Format("[Packet]\n[seq : {0}]\n[protocol : {1}]", GetInt(0).ToString(), ((E_PROTOCOL_TYPE)GetInt(1)).ToString()));
     Debugs.Log(this.ToString());
     return(this);
 }
Example #23
0
 public void Init()
 {
     Debugs.Log("[NetworkManager] Init");
     endPoint = new IPEndPoint(ipAddress, port);
     socket   = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 }
Example #24
0
 private void RecordMapBGM(int nId)
 {
     m_nCurrMapBGM = nId;
     Debugs.Log("[사운드-BGM] 새로운 BGM(", nId.ToString(), ") 감지");
 }
Example #25
0
        /// <summary>
        /// keep sure input is ccw
        /// </summary>
        public HEFace AddFace(List <HEVertex> vertice)
        {
            if (vertice == null || vertice.Count < 3)
            {
                return(null);
            }

            for (int i = 0; i < vertice.Count; i++)
            {
                var v1 = vertice[i];
                if (!v1.IsBoundary)
                {
                    Debugs.Log("will create none-manifold surface");
                    return(null);
                }
                var v2   = vertice[(i + 1) % vertice.Count];
                var edge = HEdgeBetween(v1, v2);
                if (edge != null && !edge.IsBoundary)
                {
                    Debugs.Log("will create none-manifold surface");
                    return(null);
                }
            }

            var face           = _NewFace();
            var hedges         = new List <HEEdge>(vertice.Count);
            var flags_edge_new = new bool[vertice.Count];

            for (int i = 0; i < vertice.Count; i++)
            {
                var vid1 = i;
                var vid2 = (i + 1) % vertice.Count;
                var v1   = vertice[vid1];
                var v2   = vertice[vid2];
                var edge = EdgeBetween(v1, v2);
                // keep sure edges exist
                if (edge == null)
                {
                    flags_edge_new[i] = true;
                    edge = AddEdge(v1, v2);
                }
                HEEdge toV1, toV2;
                if (edge.Relative.VertexTo == v1)
                {
                    toV1 = edge.Relative;
                    toV2 = edge.Relative.OppEdge;
                }
                else
                {
                    toV2 = edge.Relative;
                    toV1 = edge.Relative.OppEdge;
                }
                toV2.RelativeFace = face;
                if (face.Relative == null)
                {
                    face.Relative = toV2;
                }
                hedges.Add(toV2);
            }

            for (int i = 0; i < vertice.Count; i++)
            {
                var id1 = i;
                var id2 = (i + 1) % vertice.Count;
                if (!flags_edge_new[id1] && !flags_edge_new[id2])
                {
                    var edge1 = hedges[id1];
                    var edge2 = hedges[id2];
                    if (edge1.NextEdge != edge2)
                    {
                        var edgeopp2 = edge2.OppEdge;
                        var edgeopp1 = edge1.OppEdge;
                        var edge3    = edgeopp2;
                        do
                        {
                            edge3 = edge3.NextEdge.OppEdge;
                        }while (!edge3.IsBoundary);
                        var edge4 = edge3.NextEdge;

                        var edge5 = edge1.NextEdge;
                        var edge6 = edge2.PreEdge;

                        edge3.NextEdge = edge5;
                        edge5.PreEdge  = edge3;
                        edge6.NextEdge = edge4;
                        edge4.PreEdge  = edge6;
                        edge1.NextEdge = edge2;
                        edge2.PreEdge  = edge1;
                    }
                }
            }

            var vertice_need_update = new List <HEVertex>();

            for (int i = 0; i < vertice.Count; i++)
            {
                var id1     = i;
                var id2     = (i + 1) % vertice.Count;
                var edge1   = hedges[id1];
                var edge2   = hedges[id2];
                var edgeop1 = edge1.OppEdge;
                var edgeop2 = edge2.OppEdge;
                var vertex  = vertice[id2];

                if (flags_edge_new[id1])
                {
                    if (flags_edge_new[id2])
                    {
                        if (vertex.IsIsolated)
                        {
                            vertex.OuterGoing = edgeop1;
                            edgeop2.NextEdge  = edgeop1;
                            edgeop1.PreEdge   = edgeop2;
                        }
                        else
                        {
                            var e1 = vertex.OuterGoing;
                            var e2 = vertex.OuterGoing.PreEdge;
                            edgeop2.NextEdge = e1;
                            e1.PreEdge       = edgeop2;
                            edgeop1.PreEdge  = e2;
                            e2.NextEdge      = edgeop1;
                        }
                    }
                    else
                    {
                        var e1 = edge2.PreEdge;
                        e1.NextEdge       = edgeop1;
                        edgeop1.PreEdge   = e1;
                        vertex.OuterGoing = edgeop1;
                    }
                }
                else
                {
                    if (flags_edge_new[id2])
                    {
                        var e1 = edge1.NextEdge;
                        edgeop2.NextEdge  = e1;
                        e1.PreEdge        = edgeop2;
                        vertex.OuterGoing = e1;
                    }
                    else
                    {
                        vertice_need_update.Add(vertex);
                    }
                }

                edge1.NextEdge = edge2;
                edge2.PreEdge  = edge1;
            }

            foreach (var v in vertice_need_update)
            {
                v.AdjustOutGoingToBoundary();
            }

            face.UpdateDegree();
            return(face);
        }
Example #26
0
 public static void Dump(this object obj)
 {
     Debugs.Log(obj);
 }
Example #27
0
 /// <summary>
 /// Job이 실행되지 않도록 비활성화합니다.
 /// </summary>
 public virtual void Dispose()
 {
     // deactivated 상태로 마킹해두고 실행될 시점에 실행이 안되도록하자..
     MarkDisposed();
     Debugs.Log("TimerJob Dispose 됨");
 }
Example #28
0
    public void ReceivePlayingGame(MessageReceiving message)
    {
        sessionid      = message.readShort();
        leftdatabaseid = message.readByte();
        leftuserid     = message.readLong();
        leftavatarids  = message.readByte();
        leftGOLD       = message.readLong();
        leftnameShow   = message.readString();
        leftwin        = message.readInt();
        lefttie        = message.readInt();
        leftdraw       = message.readInt();

        leftcharackterID                              = message.readByte();
        lefthp                                        = message.readShort();
        leftmana                                      = message.readShort();
        leftdamgeAttack1                              = message.readShort();
        leftdamgeAttack2                              = message.readShort();
        leftshield                                    = message.readShort();
        leftspell                                     = message.readByte();
        leftmanaOfSkill1                              = message.readShort();
        leftdelayOfSkill1                             = message.readLong();
        leftmanaOfSkill2                              = message.readShort();
        leftdelayOfSkill2                             = message.readLong();
        leftmanaOfUtimate                             = message.readShort();
        leftdelayOfUtimate                            = message.readLong();
        leftmax_hp                                    = message.readShort();
        leftmax_mana                                  = message.readShort();
        leftmax_shield                                = message.readShort();
        lefttimeDelaySpell                            = message.readLong();
        lefttimeDelaySkill1                           = message.readLong();
        lefttimeDelaySkill2                           = message.readLong();
        lefttimeDelayUltimate                         = message.readLong();
        lefteffect1_time_stun                         = message.readLong();
        lefteffect2_time_doNotRecoverHP               = message.readLong();
        lefteffect3_time_upDamage                     = message.readLong();
        lefteffect3_value_upDamage                    = message.readShort();
        lefteffect4_time_slowMatrix                   = message.readLong();
        lefteffect5_time_doNotMovePiece               = message.readLong();
        lefteffect6_time_doNotChangePiece             = message.readLong();
        lefteffect7_time_disableSpell                 = message.readLong();
        lefteffect8_time_freeze                       = message.readLong();
        lefteffect9_time_speedupMatrix                = message.readLong();
        lefteffect10_time_hypnosis_pieceMoveBackwards = message.readLong();
        lefteffect11_time_backDamage                  = message.readLong();
        lefteffect12_time_avoidDamage                 = message.readLong();
        lefteffect13_time_downDamage                  = message.readLong();
        lefteffect13_value_downDamage                 = message.readShort();
        lefteffect14_time_virtual_hp                  = message.readLong();
        lefteffect14_value_virtual_hp                 = message.readShort();
        lefteffect15_time_bloodsucking                = message.readLong();
        lefteffect15_perthousand_bloodsucking         = message.readShort();
        lefteffect16_time_avoidEffect                 = message.readLong();
        leftcurrentPiece                              = message.readMiniByte();
        leftnextPiece                                 = message.readMiniByte();
        for (int i = 0; i < Constant.ROW; i++)
        {
            for (int j = 0; j < Constant.COL; j++)
            {
                leftmatrix[i, j] = message.readByte();
            }
        }
        // player 2 chair4: right;
        sessionid1s     = message.readShort();
        rightdatabaseid = message.readByte();
        rightuserid     = message.readLong();
        rightavatarids  = message.readByte();
        rightGOLD       = message.readLong();
        rightnameShow   = message.readString();
        rightwin        = message.readInt();
        righttie        = message.readInt();
        rightdraw       = message.readInt();


        rightcharackterID                              = message.readByte();
        righthp                                        = message.readShort();
        rightmana                                      = message.readShort();
        rightdamgeAttack1                              = message.readShort();
        rightdamgeAttack2                              = message.readShort();
        rightshield                                    = message.readShort();
        rightspell                                     = message.readByte();
        rightmanaOfSkill1                              = message.readShort();
        rightdelayOfSkill1                             = message.readLong();
        rightmanaOfSkill2                              = message.readShort();
        rightdelayOfSkill2                             = message.readLong();
        rightmanaOfUtimate                             = message.readShort();
        rightdelayOfUtimate                            = message.readLong();
        rightmax_hp                                    = message.readShort();
        rightmax_mana                                  = message.readShort();
        rightmax_shield                                = message.readShort();
        righttimeDelaySpell                            = message.readLong();
        righttimeDelaySkill1                           = message.readLong();
        righttimeDelaySkill2                           = message.readLong();
        righttimeDelayUltimate                         = message.readLong();
        righteffect1_time_stun                         = message.readLong();
        righteffect2_time_doNotRecoverHP               = message.readLong();
        righteffect3_time_upDamage                     = message.readLong();
        righteffect3_value_upDamage                    = message.readShort();
        righteffect4_time_slowMatrix                   = message.readLong();
        righteffect5_time_doNotMovePiece               = message.readLong();
        righteffect6_time_doNotChangePiece             = message.readLong();
        righteffect7_time_disableSpell                 = message.readLong();
        righteffect8_time_freeze                       = message.readLong();
        righteffect9_time_speedupMatrix                = message.readLong();
        righteffect10_time_hypnosis_pieceMoveBackwards = message.readLong();
        righteffect11_time_backDamage                  = message.readLong();
        righteffect12_time_avoidDamage                 = message.readLong();
        righteffect13_time_downDamage                  = message.readLong();
        righteffect13_value_downDamage                 = message.readShort();
        righteffect14_time_virtual_hp                  = message.readLong();
        righteffect14_value_virtual_hp                 = message.readShort();
        righteffect15_time_bloodsucking                = message.readLong();
        righteffect15_perthousand_bloodsucking         = message.readShort();
        righteffect16_time_avoidEffect                 = message.readLong();
        rightcurrentPiece                              = message.readMiniByte();
        rightnextPiece                                 = message.readMiniByte();
        for (int i = 0; i < Constant.ROW; i++)
        {
            for (int j = 0; j < Constant.COL; j++)
            {
                rightmatrix[i, j] = message.readByte();
            }
        }
        Debugs.Log(">>>>> ReceivePlayingGame >>>>> sessionid0 " + sessionid0 + " >>>>>>>>>> sessionid1 " + sessionid1);

        //BOL_Main_Controller.instance.InitDataBattle();
        //BOL_Main_Controller.instance.InitDataShowHeroAndButton();
        if (BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_VIEWER || BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_PLAYER)
        {
            BOL_Main_Controller.instance.SpawnHeroWhenChoice(Constant.CHAIR_LEFT, leftcharackterID, sessionid);
            BOL_Main_Controller.instance.SpawnHeroWhenChoice(Constant.CHAIR_RIGHT, rightcharackterID, sessionid1s);

            //BOL_ChoiceHero.instance.btnChoiceChairLeft.SpawnHerowhenchoice(leftcharackterID,sessionid);
            //BOL_ChoiceHero.instance.btnChoiceChairRight.SpawnHerowhenchoice(leftcharackterID,sessionid1s);
        }
        BolNetworkReceiving.instance.health_left_df  = leftmax_hp;
        BolNetworkReceiving.instance.mana_left_df    = leftmax_mana;
        BolNetworkReceiving.instance.shield_left_df  = leftmax_shield;
        BolNetworkReceiving.instance.health_right_df = rightmax_hp;
        BolNetworkReceiving.instance.mana_right_df   = rightmax_mana;
        BolNetworkReceiving.instance.shield_right_df = rightmax_shield;
        BolNetworkReceiving.instance.HeroIDLeft      = leftcharackterID;
        BolNetworkReceiving.instance.HeroIDRight     = rightcharackterID;
        BOL_Main_Controller.instance.StartInitData(BOL_Main_Controller.instance.InitDataPlaying, BOL_Main_Controller.instance.ActionPlaying);
        BOL_Main_Controller.instance._BOL_PlayBattle_left.SetValuePiece(leftnextPiece, BOL_Battle_PlayerInGame.NEXT_PIECE);
        BOL_Main_Controller.instance._BOL_PlayBattle_left.SetPostionPiece(leftcurrentPiece, 1, 0, 3);
        BOL_Main_Controller.instance._BOL_PlayBattle_left.SetValueHPorMP(BOL_Battle_PlayerInGame.HEALTH, lefthp, BolNetworkReceiving.instance.health_left_df, Constant.CHAIR_LEFT);
        BOL_Main_Controller.instance._BOL_PlayBattle_left.SetValueHPorMP(BOL_Battle_PlayerInGame.MANA, leftmana, BolNetworkReceiving.instance.mana_left_df, Constant.CHAIR_LEFT);
        BOL_Main_Controller.instance._BOL_PlayBattle_left.SetValueHPorMP(BOL_Battle_PlayerInGame.SHIELD, leftshield, BolNetworkReceiving.instance.shield_left_df, Constant.CHAIR_LEFT);
        BOL_Main_Controller.instance._BOL_PlayBattle_right.SetValuePiece(rightnextPiece, BOL_Battle_PlayerInGame.NEXT_PIECE);
        BOL_Main_Controller.instance._BOL_PlayBattle_right.SetPostionPiece(rightcurrentPiece, 1, 0, 3);
        BOL_Main_Controller.instance._BOL_PlayBattle_right.SetValueHPorMP(BOL_Battle_PlayerInGame.HEALTH, righthp, BolNetworkReceiving.instance.health_right_df, Constant.CHAIR_RIGHT);
        BOL_Main_Controller.instance._BOL_PlayBattle_right.SetValueHPorMP(BOL_Battle_PlayerInGame.MANA, rightmana, BolNetworkReceiving.instance.mana_right_df, Constant.CHAIR_RIGHT);
        BOL_Main_Controller.instance._BOL_PlayBattle_right.SetValueHPorMP(BOL_Battle_PlayerInGame.SHIELD, rightshield, BolNetworkReceiving.instance.shield_right_df, Constant.CHAIR_RIGHT);
        BOL_PlaySkill_Controller.instance.isStartGame = true;
        BOL_PlaySkill_Controller.instance.InitData();
        if (BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_PLAYER || BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_VIEWER)
        {
#if TEST
            Debug.Log(leftmatrix.Length + "  " + rightmatrix.Length);
            Debug.Log(leftcharackterID + "  " + rightcharackterID);
#endif

            for (int i = 0; i < Constant.ROW; i++)
            {
                for (int j = 0; j < Constant.COL; j++)
                {
                    BOL_Main_Controller.instance._BOL_PlayBattle_left.AddPieceInMatrix(leftmatrix[i, j], i, j);
                    BOL_Main_Controller.instance._BOL_PlayBattle_right.AddPieceInMatrix(rightmatrix[i, j], i, j);
                }
            }
        }

        BOL_ShowPlayer_Manager.instance.AddPlayerPlayGame(sessionid, Constant.CHAIR_LEFT);
        BOL_ShowPlayer_Manager.instance.AddPlayerPlayGame(sessionid1s, Constant.CHAIR_RIGHT);
        for (int i = 0; i < BOL_ShowPlayer_Manager.instance.listUserIngame.Count; i++)
        {
            if (sessionid == BOL_ShowPlayer_Manager.instance.listUserIngame[i].sessionId)
            {
#if TEST
                Debug.Log("session " + BOL_ShowPlayer_Manager.instance.listUserIngame[i].sessionId
                          + " nameshow " + BOL_ShowPlayer_Manager.instance.listUserIngame[i].nameShowInGame
                          + " list count " + BOL_ShowPlayer_Manager.instance.listUserIngame.Count);
#endif
                BOL_ChoiceHero.instance.btnChoiceChairLeft.infoPlayer.InitData(BOL_ShowPlayer_Manager.instance.listUserIngame[i]);
            }
        }
        BOL_ChoiceHero.instance.btnChoiceChairLeft.ShowInfoPlayer();
        for (int i = 0; i < BOL_ShowPlayer_Manager.instance.listUserIngame.Count; i++)
        {
            if (sessionid1s == BOL_ShowPlayer_Manager.instance.listUserIngame[i].sessionId)
            {
#if TEST
                Debug.Log("session " + BOL_ShowPlayer_Manager.instance.listUserIngame[i].sessionId
                          + " nameshow " + BOL_ShowPlayer_Manager.instance.listUserIngame[i].nameShowInGame
                          + " list count " + BOL_ShowPlayer_Manager.instance.listUserIngame.Count);
#endif
                BOL_ChoiceHero.instance.btnChoiceChairRight.infoPlayer.InitData(BOL_ShowPlayer_Manager.instance.listUserIngame[i]);
            }
        }
        BOL_ChoiceHero.instance.btnChoiceChairRight.ShowInfoPlayer();
    }
Example #29
0
        public override void Process(LightObject lightObj)
        {
            DummyPacket packet = new DummyPacket(lightObj);

            Debugs.Log(lightObj);
        }