Ejemplo n.º 1
0
    public void OnUserEnterRoom(BaseEvent evt)
    {
        User user = (User)evt.Params["user"];

        Debug.Log("remote User info: " + user.ToString());
        Debug.Log("NetworkManager::OnUserEnterRoom .. playerId: " + user.PlayerId);
        SFSObject sFSObject = new SFSObject();

        sFSObject.PutInt("playerId", user.PlayerId);
        GameObject gameObject = GameObject.Find("battleQueue");

        if (gameObject != null)
        {
            Debug.Log("<< battleQueue found");
            QueueBattle queueBattle = gameObject.GetComponent("QueueBattle") as QueueBattle;
            if (queueBattle != null)
            {
                int factionId = (!(Factions.atlas.ToString() == user.GetVariable("faction").GetStringValue())) ? 1 : 2;
                queueBattle.addPlayerToSlot(factionId, user.PlayerId);
            }
            else
            {
                Debug.Log("cannot find QueueBattle");
            }
        }
        else
        {
            Debug.Log("Battle Queue game object is null");
            GameObject gameObject2 = GameObject.Find("Game");
            GamePlay   gamePlay    = gameObject2.GetComponent("GamePlay") as GamePlay;
            int        factionId2  = (!(Factions.atlas.ToString() == user.GetVariable("faction").GetStringValue())) ? 1 : 2;
            gamePlay.addJoiner(factionId2, user.PlayerId);
        }
    }
Ejemplo n.º 2
0
 public ChatModule(QueueBattle Parent)
 {
     sfs       = Parent.m_networkManager.smartFox;
     sfs       = null;
     QueueSkin = GUIUtil.mInstance.mQueueSkin;
     if (GameData.BattleType == 2)
     {
         bAllChat = false;
     }
 }
Ejemplo n.º 3
0
    public void Start(QueueBattle parent)
    {
        MyScreenRect     = new Rect(0f, 0f, 818f, 555f);
        PlayerGroup      = new Rect(2f, 2f, 814f, 186f);
        MissionGroup     = new Rect(2f, PlayerGroup.y + PlayerGroup.height, 814f, 95f);
        ScoreGroup       = new Rect(2f, MissionGroup.y + MissionGroup.height + 1f, 814f, 230f);
        TransferStateNum = -1;
        TransferLevel    = 1;
        TransferTimer    = (float[])TransferTimes.Clone();
        TimeStart        = Time.realtimeSinceStartup;
        Parent           = parent;
        SharedSkin       = GUIUtil.mInstance.mSharedSkin;
        StatsSkin        = GUIUtil.mInstance.mStatsSkin;
        for (int i = 0; i < 8; i++)
        {
            PlayerOrder[i] = i;
            Players[i]     = null;
        }
        for (int j = 0; j < BanzaiOrder.Length; j++)
        {
            BanzaiOrder[j] = -1;
            AtlasOrder[j]  = -1;
        }
        mFactionCards = parent.mFactionCards;
        if (GameData.MyLevel == 50 && !GameData.getPlayerHasLeveledUp(GameData.MyPlayerId))
        {
            bMax          = true;
            TransferLevel = GameData.MyLevel;
        }
        if (GameData.MyFactionId == 1)
        {
            XPBonusTexture = (GameData.eventObjects["Banzai_BonusXP_Summary_Texture"] as Texture2D);
        }
        else
        {
            XPBonusTexture = (GameData.eventObjects["Atlas_BonusXP_Summary_Texture"] as Texture2D);
        }
        string text = (string)GameData.eventObjects["BonusXP_Text"];

        if (text != null)
        {
            BonusXPText = text;
        }
        if (GameData.eventObjects["BonusXP_Summary_TextColor"] == null)
        {
            BonusXPColor = XPColor;
        }
        else
        {
            BonusXPColor = (Color)GameData.eventObjects["BonusXP_Summary_TextColor"];
        }
        Logger.trace("GameSummary::Start");
    }