コード例 #1
0
        public void ResponseRRGetMap(ExtendedEventArgs eventArgs)
        {
            ResponseRRGetMapEventArgs args = eventArgs as ResponseRRGetMapEventArgs;

            GameManager.mapSeed = args.mapNumber;
            //Debug.Log("Get map seed from server! The number is " + args.mapNumber);
        }
コード例 #2
0
ファイル: Login.cs プロジェクト: hunvil/ConvergeGame_Client
        public void ResponseRaceInit(ExtendedEventArgs eventArgs)
        {
            ResponseRaceInitEventArgs args = eventArgs as ResponseRaceInitEventArgs;

            if (args.status == 0) {
                Application.LoadLevel ("RRReadyScene");
            } else {
                Join ();
            }
        }
コード例 #3
0
ファイル: Login.cs プロジェクト: hunvil/ConvergeGame_Client
        public void ResponseLogin(ExtendedEventArgs eventArgs)
        {
            ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs;

            if (args.status == 0) {
                Constants.USER_ID = args.user_id;
            } else {
                Debug.Log ("Login Failed");
            }
        }
コード例 #4
0
        public void ResponseGameState(ExtendedEventArgs eventArgs)
        {
            ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs;

            if (args.status == 0) {
                Constants.USER_ID = args.user_id;
            } else {
                Debug.Log("Response GameState Failed"); // Don't know what comment should be made here
            }
        }
コード例 #5
0
        public void ResponseRRStartGame(ExtendedEventArgs eventArgs)
        {
            Debug.Log ("ResponseRRStartGame has been called from Selection Manager.cs");

            ResponseRRStartGameEventArgs args = eventArgs as ResponseRRStartGameEventArgs;

            if (args.status == 0) {
                Application.LoadLevel ("RRCountdownScene");
            } else {
                //			Join();
            }
        }
コード例 #6
0
        public void ResponseLogin(ExtendedEventArgs eventArgs)
        {
            ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs;

            if (args.status == 0)
            {
                Constants.USER_ID = args.user_id;
            }
            else
            {
                Debug.Log("Login Failed");
            }
        }
コード例 #7
0
        public void ResponseRaceInit(ExtendedEventArgs eventArgs)
        {
            ResponseRaceInitEventArgs args = eventArgs as ResponseRaceInitEventArgs;

            if (args.status == 0)
            {
                Application.LoadLevel("RRReadyScene");
            }
            else
            {
                Join();
            }
        }
コード例 #8
0
ファイル: Running.cs プロジェクト: pbroestl/unity-game-client
        public void ResponseGameState(ExtendedEventArgs eventArgs)
        {
            ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs;

            if (args.status == 0)
            {
                Constants.USER_ID = args.user_id;
            }
            else
            {
                Debug.Log("Response GameState Failed");                  // Don't know what comment should be made here
            }
        }
コード例 #9
0
        public void ResponseRRStartGame(ExtendedEventArgs eventArgs)
        {
            Debug.Log("ResponseRRStartGame has been called from Selection Manager.cs");

            ResponseRRStartGameEventArgs args = eventArgs as ResponseRRStartGameEventArgs;

            if (args.status == 0)
            {
                Application.LoadLevel("RRCountdownScene");
            }
            else
            {
                //			Join();
            }
        }
コード例 #10
0
        // Update is called once per frame
        void Update()
        {
            while (msgQueue.Count > 0)
            {
                ExtendedEventArgs args = msgQueue.Dequeue();

                if (callbackList.ContainsKey(args.event_id))
                {
                    callbackList [args.event_id] (args);
                    //Debug.Log("Processed Event No. " + args.event_id + " [" + args.GetType() + "]");
                }
                else
                {
                    //Debug.Log("Missing Event No. " + args.event_id + " [" + args.GetType() + "]");
                }
            }
        }
コード例 #11
0
ファイル: Running.cs プロジェクト: pbroestl/unity-game-client
        public void ResponseRREndGame(ExtendedEventArgs eventArgs)
        {
            //		Debug.Log ("ResponseEndGame Called in Running.cs 1");
            ResponseRREndGameEventArgs args = eventArgs as ResponseRREndGameEventArgs;

            if (args.win == true)
            {
                PlayerPrefs.SetInt("Win", 1);
            }
            else
            {
                PlayerPrefs.SetInt("Win", 0);
            }
            PlayerPrefs.SetString("Winning Time", args.winningTime);

            //		Debug.Log ("ResponseEndGame Called in Running.cs 2");
            Application.LoadLevel("RREndScene");
        }
コード例 #12
0
        public void ReadSocket()
        {
            if (!socketReady)
            {
                return;
            }

            if (theStream.DataAvailable)
            {
                byte[] buffer = new byte[2];
                theStream.Read(buffer, 0, 2);
                short bufferSize = BitConverter.ToInt16(buffer, 0);

                buffer = new byte[bufferSize];
                theStream.Read(buffer, 0, bufferSize);
                MemoryStream dataStream = new MemoryStream(buffer);

                short response_id = DataReader.ReadShort(dataStream);
                Debug.Log("response_id: " + response_id);
                //Debug.Log(response_id.GetType().ToString());
                NetworkResponse response = NetworkResponseTable.get(response_id);

                if (response != null)
                {
                    response.dataStream = dataStream;

                    response.parse();
                    ExtendedEventArgs args = response.process();

                    if (args != null)
                    {
                        MessageQueue msgQueue = mainObject.GetComponent <MessageQueue>();
                        msgQueue.AddMessage(args.event_id, args);
                    }
                }
            }
        }
コード例 #13
0
 public void AddMessage(int event_id, ExtendedEventArgs args)
 {
     msgQueue.Enqueue(args);
 }
コード例 #14
0
 public void AddMessage(int event_id, ExtendedEventArgs args)
 {
     msgQueue.Enqueue(args);
 }
コード例 #15
0
        public void ResponseRREndGame(ExtendedEventArgs eventArgs)
        {
            //		Debug.Log ("ResponseEndGame Called in Running.cs 1");
            ResponseRREndGameEventArgs args = eventArgs as ResponseRREndGameEventArgs;

            if (args.win == true) {
                PlayerPrefs.SetInt ("Win", 1);
            } else {
                PlayerPrefs.SetInt ("Win", 0);
            }
            PlayerPrefs.SetString ("Winning Time", args.winningTime);

            //		Debug.Log ("ResponseEndGame Called in Running.cs 2");
            Application.LoadLevel("RREndScene");
        }
コード例 #16
0
 public void ResponseRRGetMap(ExtendedEventArgs eventArgs)
 {
     ResponseRRGetMapEventArgs args = eventArgs as ResponseRRGetMapEventArgs;
     GameManager.mapSeed = args.mapNumber;
     //Debug.Log("Get map seed from server! The number is " + args.mapNumber);
 }