private void BattleResCallback(SocketIOEvent e) { Debug.Log("[O]battle_res: " + e.ToString()); string aname = e.data.GetField("aname").str; string dname = e.data.GetField("dname").str; List <BattleCardModifier> amods = JSONListToBCMList(e.data.GetField("amods").list); List <BattleCardModifier> dmods = JSONListToBCMList(e.data.GetField("dmods").list); int aoap = (int)e.data.GetField("aoap").n; int doap = (int)e.data.GetField("doap").n; List <Card> abattle = JSONListToCardList(e.data.GetField("abattle").list); List <Card> bbattle = JSONListToCardList(e.data.GetField("bbattle").list); List <Card> akilled = JSONListToCardList(e.data.GetField("akilled").list); List <Card> atouched = JSONListToCardList(e.data.GetField("atouched").list); List <Card> dkilled = JSONListToCardList(e.data.GetField("dkilled").list); List <Card> dtouched = JSONListToCardList(e.data.GetField("dtouched").list); int ahit = (int)e.data.GetField("ahit").n; int dhit = (int)e.data.GetField("dhit").n; int aaap = (int)e.data.GetField("aaap").n; int daap = (int)e.data.GetField("daap").n; int acs = (int)e.data.GetField("acs").n; int dcs = (int)e.data.GetField("dcs").n; int ahp = (int)e.data.GetField("ahp").n; int dhp = (int)e.data.GetField("dhp").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.BattleResult, aname, dname, amods, dmods, aoap, doap, akilled, atouched, dkilled, dtouched, ahit, dhit, abattle, bbattle, aaap, daap, acs, dcs, ahp, dhp)); }
private void SelectDoneCallback(SocketIOEvent e) { Debug.Log("[O]select_done: " + e.ToString()); string who = e.data.GetField("name").str; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.SelectDoneCallback, who)); }
public virtual void OnClientCompleteSetupSkills(SocketIOEvent obj) { Debug.LogWarning(obj.ToString()); // COMPLETE TASK this.m_NextTask = "PlayScene"; this.OnTaskCompleted(); }
void updateEnergyBar(SocketIOEvent e) { Debug.Log(e.data); Debug.Log(e.name); Debug.Log(e.ToString()); float currValue = presidentImage.color.a - decreaseAmount; if (currValue < 0.9) { energyBar.gameObject.SetActive(true); } // energy Level 0-1 if (currValue > 0) { presidentImage.color = new Color(1f, 1f, 1f, currValue); energySlider.value = currValue; curr_energy = currValue; } else { currValue = 0; energySlider.value = currValue; presidentImage.color = new Color(1f, 1f, 1f, currValue); isActive = false; } }
private void UpdateManaCallback(SocketIOEvent e) { Debug.Log("[O]update_mana: " + e.ToString()); string who = e.data.GetField("name").str; int mana = (int)e.data.GetField("mana").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.UpdatePlayerMana, who, mana)); }
public virtual void OnClientUpdateEnergy(SocketIOEvent obj) { Debug.Log(obj.ToString()); var currentEnergy = obj.data.GetField("current").ToString(); var maxEnergy = obj.data.GetField("max").ToString(); this.m_LobbyManager.UpdateEnergyText(currentEnergy, maxEnergy); }
private void SelectTargetCallback(SocketIOEvent e) { Debug.Log("[O]select_target: " + e.ToString()); string who = e.data.GetField("name").str; int guid = (int)e.data.GetField("guid").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.SelectTargetCallback, who, guid)); }
private void DiscardCardCallback(SocketIOEvent e) { Debug.Log("[O]discard_card: " + e.ToString()); string who = e.data.GetField("name").str; int guid = (int)e.data.GetField("guid").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.DiscardCardCallback, who, guid)); }
private void UpdateCardPowerCallback(SocketIOEvent e) { Debug.Log("[O]update_card_power: " + e.ToString()); int guid = (int)e.data.GetField("guid").n; int power = (int)e.data.GetField("power").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.UpdateCardPowerCallback, guid, power)); }
private void RemoveBuffCallback(SocketIOEvent e) { Debug.Log("[O]remove_buff: " + e.ToString()); int cardGuid = (int)e.data.GetField("cguid").n; int buffGuid = (int)e.data.GetField("bguid").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.RemoveBuffCallback, cardGuid, buffGuid)); }
public virtual void OnClientGetRewardBattle(SocketIOEvent obj) { Debug.LogWarning(obj.ToString()); var glory = obj.data.GetField("glory").ToString(); var gold = obj.data.GetField("gold").ToString(); CUIMiniGameFightingManager.Instance.SetUpWinningBox("WINNING", string.Format("YOU WIN x{0} GLORY and x{1} GOLD", glory, gold)); }
public virtual void OnClientReceiveDice(SocketIOEvent obj) { Debug.LogWarning("OnClientReceiveDice " + obj.ToString()); var step = int.Parse(obj.data.GetField("diceStep").ToString()); var curEnergy = int.Parse(obj.data.GetField("currentEnergy").ToString()); var maxEnergy = int.Parse(obj.data.GetField("maxEnergy").ToString()); CGameManager.Instance.OnPlayerUpdateStep(step, curEnergy, maxEnergy); }
private void UpdateSlotPowerCallback(SocketIOEvent e) { Debug.Log("[O]update_slot_power: " + e.ToString()); string name = e.data.GetField("name").str; int slot = (int)e.data.GetField("slot").n; int power = (int)e.data.GetField("power").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.UpdateSlotPowerCallback, name, slot, power)); }
private void PlayCardCallback(SocketIOEvent e) { Debug.Log("[O]play_card " + e.ToString()); string who = e.data.GetField("name").str; int guid = (int)e.data.GetField("guid").n; int mana = (int)e.data.GetField("mana").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.PlayCardCallback, who, guid, mana)); }
private void OnDisconnect(SocketIOEvent evt) { started = false; Debugger.Log(Color.blue, "disconnect " + socket.IsConnected + " " + evt.ToString()); if (OnDisconnectHandler != null) { OnDisconnectHandler(evt); } }
private void OnOpen(SocketIOEvent evt) { started = true; Debugger.Log(Color.blue, "open " + socket.IsConnected + " " + evt.ToString()); if (OnOpenHandler != null) { OnOpenHandler(evt); } }
private void AddBuffCallback(SocketIOEvent e) { Debug.Log("[O]add_buff: " + e.ToString()); int cardGuid = (int)e.data.GetField("guid").n; JSONObject obj = e.data.GetField("buff"); int buffGuid = (int)obj.GetField("guid").n; string iconPath = obj.GetField("icon").str; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.AddBuffCallback, cardGuid, buffGuid, iconPath)); }
private void PlayCardSlotCallback(SocketIOEvent e) { Debug.Log("[O]play_card_slot: " + e.ToString()); string who = e.data.GetField("name").str; int guid = (int)e.data.GetField("guid").n; int slot = (int)e.data.GetField("slot").n; int power = (int)e.data.GetField("power").n; BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.PlayCardSlotCallback, who, guid, slot, power)); }
public virtual void OnClientReceiveResultPlayerQueue(SocketIOEvent obj) { Debug.LogWarning(obj.ToString()); var responseData = obj.data; var miniFightingData = TinyJSON.JSON.Load(responseData.ToString()).Make <CMiniFightingData> (); CTaskUtil.Set(CTaskUtil.MINI_FIGHTING_TEXT, responseData.ToString()); CTaskUtil.Set(CTaskUtil.MINI_FIGHTING_DATA, miniFightingData); // COMPLETE TASK this.m_NextTask = "MiniGameFightingScene"; this.OnTaskCompleted(); }
private void DrawCardCallback(SocketIOEvent e) { Debug.Log("[O]draw_card: " + e.ToString()); string who = e.data.GetField("name").str; List <JSONObject> cardsObj = e.data.GetField("cards").list; List <Card> cards = new List <Card>(); int deckN = (int)e.data.GetField("deckN").n; foreach (JSONObject obj in cardsObj) { int guid = (int)obj.GetField("guid").n; int id = (int)obj.GetField("id").n; string name = obj.GetField("name").str; string color = obj.GetField("color").str; string ctype = obj.GetField("ctype").str; int power = obj.GetField("power") == null ? 0 : (int)obj.GetField("power").n; string desc = obj.GetField("desc") == null ? "" : obj.GetField("desc").str; int cost = (int)obj.GetField("cost").n; cards.Add(new Card(guid, id, name, color, ctype, power, desc, cost)); } BoardBehaviour.CrossScenePayloads.Enqueue(new CrossScenePayload(BoardBehaviour.PlayerDrawCards, who, cards, deckN)); }
public virtual void OnClientReceiveChat(SocketIOEvent obj) { Debug.LogWarning("clientReceiveChat " + obj.ToString()); var isHasChat = obj.data.HasField("chatStr"); if (isHasChat) { // WARNING if (CSceneManager.Instance.GetActiveSceneName() != this.taskName) { return; } var chatOwner = obj.data.GetField("chatOwner").ToString().Replace("\"", string.Empty); var chatStr = obj.data.GetField("chatStr").ToString().Replace("\"", string.Empty); var chat = chatOwner + ": " + chatStr; var chatData = new CChatData() { chatOwner = chatOwner, chatStr = chat, isMine = chatOwner == this.m_UserManager.currentHero.objectName }; CUILobbyManager.Instance.ReceiveChatText(chatData); } }
public void TestClose(SocketIOEvent e) { Debug.Log("[SocketIO] Close received: " + e.ToString()); }
public virtual void OnClientReceiveSkills(SocketIOEvent obj) { Debug.LogWarning("OnClientReceiveSkills " + obj.ToString()); }
public virtual void OnClientCancelPlayerQueue(SocketIOEvent obj) { Debug.LogWarning(obj.ToString()); }
//========= Connection Messages ============= public void TestOpen(SocketIOEvent e) { print("[EventCenter] On Opened" + e.ToString()); }
public virtual void OnClientClosingGame(SocketIOEvent org) { Debug.LogWarning(org.ToString()); CUIGameManager.Instance.PlayClosingAnimation(); }
public void TestError(SocketIOEvent e) { Debug.Log("[SocketIO] Error received: " + e.ToString()); }
private void OnRoomDenied(SocketIOEvent e) { print("[EventCenter] Room " + roomNumber + " Access Denied! " + e.ToString()); }
void sendCoors(SocketIOEvent ev) { Debug.Log(ev.ToString()); //socket.Emit("connected"); }