public void OnClickMoney() { CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_STORE_BUY_HERO, new ArrayList() { (byte)HeroId, false }); }
private void OnConfirm() { string command = commandInput.text; if (command.Equals(string.Empty)) { return; } string[] param = command.Split(' '); ArrayList paramList = new ArrayList() { param[0], param[1], param.Length == 3 ? param[2] : string.Empty }; int id = int.Parse(param[0]); if ((id >> 1 << 1) == id) { CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_GM, paramList); } else { CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_GM, paramList); } }
private void OnClickMulti() { SceneLoader.IsSingle = false; CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_LOGIN_PVP_REQUEST, new ArrayList() { (byte)2 }); }
public void LoadDouble(int roomId, int seed, int frequency, int stairs, List <BattlePlayerData> others) { BattleType = 2; SetData(roomId, seed, frequency, stairs, true); LoadMy(PositionMgr.vecFieldPosM); LoadOther(PositionMgr.vecFieldPosE, others[0], 1, 0.8f); LoadPlayerInfo(PlayerData.PlayerId, PlayerData.Nickname, PlayerData.CurScene, PlayerData.CurHP, 0); LoadPlayerInfo(others[0], 1); CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_LOADED, new ArrayList() { }); }
public void OnClickCoin() { if (PlayerData.Coin < int.Parse(Coin)) { MsgBoxPanel.ShowMsgBox("Warning", string.Format("Not enough Coins !"), 1); return; } MsgBoxPanel.MsgCallback OnOk = () => { CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_STORE_BUY_HERO, new ArrayList() { (byte)HeroId, true }); }; MsgBoxPanel.ShowMsgBox("Buy Hero", string.Format("Spend {0} Coins to buy {1} ?", Coin, Name.text), 2, OnOk); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Role")) { ResourceMgr.PushItem(this); BattleHero hero = collision.GetComponent <BattleHero>(); BattleManager.GetInst().EnqueueSkill(hero.PlayerId, Type); CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_GET_ITEM, new ArrayList() { (byte)Type }); } }
private void ClosePanel() { _gameObject.SetActive(false); for (int i = 0; i < _lstSceneItems.Count; ++i) { if (_lstSceneItems[i].Toggle.isOn && i != PlayerData.CurScene) { CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_PLAYER_SET_SCENE, new ArrayList() { (byte)i }); } } }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.CompareTag("Role")) { if (BattleManager.GetInst().BattleType == 2) { BattleHero hero = collider.GetComponent <BattleHero>(); CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_HERO_FAILED, new ArrayList() { hero.PlayerId }); } } }
public void OnPlatformLogin() { _loginParam = new ArrayList() { ApplicationConst.PlatformID, ApplicationConst.ChannelID, DeviceInfo.GetDeviceInfo(), System.Guid.NewGuid().ToString(), SystemInfo.deviceUniqueIdentifier, PlayerInfo.Account, PlayerInfo.Token }; CommonCommand.ExecuteShort(Client2ServerList.GetInst().C2S_LOGIN_SHORT, _loginParam, true); }
public void LoadFive(int roomId, int seed, int frequency, int stairs, List <BattlePlayerData> others) { BattleType = 2; SetData(roomId, seed, frequency, stairs, true); LoadMy(PositionMgr.vecFieldPosM); for (int i = 0; i < others.Count; ++i) { LoadOther(PositionMgr.arrVecFieldPosE[i], others[i], i + 1, 0.4f); LoadPlayerInfo(others[i], i + 1); } CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_LOADED, new ArrayList() { }); }
private void OnMouseUp() { _ray = BattleManager.GetInst().BattleCam.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(_ray, out _hit, 1000, 1 << LayerMask.NameToLayer("SkillBtn"))) { int playerIndex = int.Parse(_hit.collider.tag); int playerId = BattleManager.GetInst().IndexToPlayer(playerIndex - 1); CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_RELEASE_SKILL, new ArrayList() { playerId, (byte)Type, IsMainSkill }); } _anim["SkillBtn2"].time = _anim["SkillBtn2"].length; _anim["SkillBtn2"].speed = -1; _anim.Play("SkillBtn2"); }
public void ReduceHp(int reduceValue) { int curHp = BattleManager.GetInst().GetHp(PlayerId); int newHp = Mathf.Max(0, curHp - reduceValue); if (BattleManager.GetInst().BattleType == 1 || IsRobot) { BattleManager.GetInst().SyncHp(PlayerId, newHp); } else { CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_SYNC_HP, new ArrayList() { (byte)newHp }); } }
private void OnConfirm() { string command = commandInput.text; if (command.Equals(string.Empty)) { return; } if (ClientGM(command)) { return; } string[] param = command.Split(' '); ArrayList paramList = new ArrayList() { param[0], param[1], param.Length == 3 ? param[2] : string.Empty }; CommonCommand.ExecuteShort(Client2ServerList.GetInst().C2S_GM, paramList); }
private const int LONG_MESSAGE_END = 5; //长链接消息结束 public override void ProcessMessage(ConnectBase conn, ByteBuffer data) { int type, errCode; int moduleId = data.readByte(); switch (moduleId) { case LONG_CONNECTED: type = data.readByte(); if (type == 0) { LoginPanel.GetInst().OnPlatformLogin(); } else { CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_LOGIN, new ArrayList() { PlayerData.PlayerId }); } //ConnectLong.GetInst().ConnectedFunc(); break; case LCONNECT_EXCEPTION: type = data.readByte(); errCode = data.readInt(); if (10049 == errCode || //Cannot assign requested address 10051 == errCode || //Network is unreachable 10054 == errCode || //Connection reset by peer 10057 == errCode || //Socket is not connected 10058 == errCode || //Cannot send after socket shutdown 10060 == errCode || //Connection timed out 10061 == errCode || //Connection refused 0 == errCode) //Directly send error { if (type == 0) { ApplicationEntry.ToLoginScene(); } } else if (10053 != errCode) { Debug.LogError(string.Format("LCONNECT_EXCEPTION-Code:{0}", errCode)); } break; case SCONNECT_EXCEPTION: errCode = data.readInt(); MsgBoxPanel.MsgCallback Reconnect = () => { ConnectShort co = (ConnectShort)conn; SocketHandler.GetInst().ShortSend(co.m_Data, co.m_bFlag, co.m_bNeedEncrypt); SocketHandler.ShortSendBackFun(); }; MsgBoxPanel.ShowMsgBox(string.Empty, (string)ApplicationConst.dictStaticText["22"], 1, Reconnect); break; case LONG_MESSAGE_END: Connecting.GetInst().ForceHide(); break; default: break; } }
private void CancelSearch() { CommonCommand.ExecuteLongMain(Client2ServerList.GetInst().C2S_LOGIN_PVP_CANCEL, new ArrayList() { }); }