Example #1
0
    public void sendButton(string fid)
    {
        ButtonClickSound();

        if (SceneGameOver.g_instance != null)
        {
            if (SceneGameOver.g_instance.buttonClickable)
            {
                /*if (GameOver_ServerConnection.g_instance != null)
                 * {
                 *  GameOver_ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                 * }
                 */

                tempFid = fid;

                try
                {
                    FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), fid, Callback);// " 님이 당신에게 주사위를 선물했습니다.", fid);
                    //status = "Direct Request called";
                }
                catch (System.Exception e)
                {
                    Debug.Log(e.Message);
                }

                /*
                 * if (ServerConnection.g_instance != null)
                 * {
                 *  ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                 * }
                 */
            }
        }
    }
Example #2
0
    public void HelpMessage(string fid, FriendTogetherItem helpObject)
    {
        SceneTitle.ButtonClickSound();

        tempSendFid    = fid;
        tempHelpObject = helpObject;

        all = false;

        try
        {
            FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), fid, Callback);//" 님이 당신에게 주사위를 선물했습니다.", fid);
            //status = "Direct Request called";
        }
        catch (Exception e)
        {
            Debug.Log(e.Message);
        }

        /*if (Title_ServerConnection.g_instance != null)
         * {
         *  sendList.Add(fid);
         *  Title_ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
         * }*/
        /*
         * if (ServerConnection.g_instance != null)
         * {
         *  sendList.Add(fid);
         *  ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
         * }
         */
    }
Example #3
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();
        string receiverFidList = "";

        // Server 전송

        foreach (RequestFriendItem temp in requestlist)
        {
            if (temp.btn_Toggle.value)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            try
            {
                string str = Localization.Localize("3017");
                FaceBook.CallAppRequestAsDirectRequestMessage("Invite You", CMainData.Username + str, receiverFidList, Callback);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }
        }
    }
Example #4
0
    public void SendMessageAll()
    {
        SceneTitle.ButtonClickSound();
        // Server 전송

        string receiverFidList = "";

        foreach (FriendTogetherItem temp in currentList)
        {
            bool check = false;
            foreach (string t in sendList)
            {
                if (t.Equals(temp.Fid))
                {
                    check = true;
                    break;
                }
            }

            if (!check)
            {
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);
            //Debug.Log("receiver list is " + receiverFidList);

            /*if (Title_ServerConnection.g_instance != null)
             * {
             *  Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }*/

            tempSendFid = receiverFidList;
            all         = true;

            try
            {
                FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);//+ " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }
             */
        }

        //cleanData();
    }
Example #5
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();

        string receiverFidList = "";

        // Server 전송

        foreach (RequestFriendItem temp in ItemList)
        {
            if (temp.btn_Toggle.value && temp.Fid != null)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            tempFid = receiverFidList;

            //Debug.Log("receiver list is " + receiverFidList);

            //Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);

            try
            {
                FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);// + " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                //status = "Direct Request called";
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }
             */
        }

        /*
         * this.gameObject.SetActive(false);
         *
         * if (SceneTitle.instance != null)
         * {
         *  SceneTitle.instance.changeIsMain(true);
         * }
         */
    }
Example #6
0
    public void acceptMessage(string fid, int type)
    {
        SceneTitle.ButtonClickSound();

        foreach (Message temp in CMainData.message)
        {
            if (temp.Fid.Equals(fid) && temp.Type == type)
            {
                //Server로 데이터 전송

                /*if (Title_ServerConnection.g_instance != null)
                 * {
                 *  Title_ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);
                 *
                 *  CMainData.message.Remove(temp);
                 *  temp.Obj.transform.parent = this.gameObject.transform.parent;
                 *  Destroy(temp.Obj);
                 * }*/

                if (type != 3)
                {
                    if (ServerConnection.g_instance != null)
                    {
                        ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);

                        CMainData.message.Remove(temp);
                        temp.Obj.transform.parent = this.gameObject.transform.parent;
                        Destroy(temp.Obj);
                    }
                }
                else
                {
                    tempMessageObj = temp;
                    try
                    {
                        FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), temp.Fid, Callback);// + " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                        //status = "Direct Request called";
                    }
                    catch (System.Exception e)
                    {
                        Debug.Log(e.Message);
                    }
                }

                break;
            }
        }
        if (label_message_num != null)
        {
            label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
        }
        messageGrid.repositionNow = true;
    }
Example #7
0
    public void allMessage()
    {
        ButtonClickSound();

        if (SceneGameOver.g_instance != null)
        {
            if (SceneGameOver.g_instance.buttonClickable)
            {
                if (SceneGameOver.ResultInstance != null)
                {
                    string receiverFidList = "";
                    foreach (Ranking_MsgSend temp in ranking_msg)
                    {
                        if (temp.Sendable && !receiverFidList.Contains(temp.Fid))
                        {
                            receiverFidList += temp.Fid + ",";
                        }
                    }

                    if (!receiverFidList.Equals(""))
                    {
                        receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);
                        //Debug.Log("receiver list is " + receiverFidList);

                        tempFid = receiverFidList;

                        allBtn.SetActive(false);
                        //GameOver_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);

                        try
                        {
                            FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);// " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                            //status = "Direct Request called";
                        }
                        catch (System.Exception e)
                        {
                            Debug.Log(e.Message);
                        }

                        /*
                         * if (ServerConnection.g_instance != null)
                         * {
                         *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                         * }
                         */
                    }
                }
            }
        }
    }
Example #8
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();
        // Server 전송

        string receiverFidList = "";

        foreach (RequestFriendItem temp in requestlist)
        {
            if (temp.btn_Toggle.value)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            tempFid = receiverFidList;

            //Debug.Log("receiver list is " + receiverFidList);

            /*
             * if (Title_ServerConnection.g_instance != null)
             * {
             *  Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.HELP + 1);
             * }
             */

            try
            {
                string str = Localization.Localize("3016");
                Debug.Log(CMainData.Username + str);
                FaceBook.CallAppRequestAsDirectRequestMessage("Dice Request", CMainData.Username + str, receiverFidList, Callback);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.HELP + 1);
             * }
             */
        }
    }