internal void InitBetting(Electrotank.Electroserver5.Api.EsObject eso) { if (panelBetting.gameObject.activeSelf) { panelBetting.HideAllButton(); } ShowPanelJoin(); foreach (PlayerBettingView pv in panelJoin.listBettingPlayer) { if (pv.iconChange.gameObject.activeSelf) { pv.iconChange.gameObject.SetActive(false); } } PlayerBettingView view = panelJoin.listBettingPlayer.Find(lbv => lbv.model.Player.username == eso.getString("userName")); ECardTexture texture = view.GetComponentInChildren <ECardTexture>(); view.model.CardId = eso.getInteger("cardId"); view.model.ETypeLaying = (ETypeLayingBetting)eso.getInteger("gaNgoaiType"); view.model.ChipBetting = eso.getLong("value"); view.SetData(view.model); if (GameManager.Instance.mInfo.username == eso.getString("userName")) { panelJoin.ShowButonJoin(model); } if (eso.getString("userName") != GameManager.Instance.mInfo.username) { view.iconChange.gameObject.SetActive(true); } }
void PluginMessageOnProcess(string command, string action, Electrotank.Electroserver5.Api.EsObject PluginMessageParameters) { if (command == "acceptFriendRequest") { this.initInformation(mUser); } }
internal void OnShowPreViewBetting(Electrotank.Electroserver5.Api.EsObject eso) { if (!eso.variableExists("bettings")) { NotificationView.ShowMessage("Chưa có lịch sử chơi gà ngoài", 3f); return; } ShowPanelPreview(); panelPreview.ShowPreview(eso); }
public void ShowCardFullLaying(bool isResult) { int cardid = 0; int x = 0; LocationFullLaying(GameModelChan.game.listFullLaying[0], isResult); LocationFullLaying(GameModelChan.game.listFullLaying[1], isResult); // kiem tra hien thi chiu luc ket thuc game // se toi uu lai sau if (GameModelChan.game.listFullLaying[2] != null) { if (GameModelChan.game.listFullLaying[2].Length == 4) { for (int i = 0; i < GameModelChan.game.listFullLaying[2].Length; i++) { Electrotank.Electroserver5.Api.EsObject obj = GameModelChan.game.listFullLaying[2][i]; cardid = obj.getInteger("id"); } for (int j = 0; j < GameModelChan.game.listFullLaying[2].Length; j++) { Electrotank.Electroserver5.Api.EsObject obj = GameModelChan.game.listFullLaying[2][j]; if (cardid == obj.getInteger("id")) { x++; } } if (x == 4) { LocationFullLayingChiu(GameModelChan.game.listFullLaying[2], isResult); } else { LocationFullLaying(GameModelChan.game.listFullLaying[2], isResult); } } else { LocationFullLaying(GameModelChan.game.listFullLaying[2], isResult); } } }
/// <summary> /// Build EsObject from List /// </summary> static public Electrotank.Electroserver5.Api.EsObject SetEsObject(string command, params object[] param) { Electrotank.Electroserver5.Api.EsObject eso = new Electrotank.Electroserver5.Api.EsObject(); if (!string.IsNullOrEmpty(command)) { eso.setString(Fields.COMMAND, command); } if (param == null) { return(eso); } for (int i = 0; i < param.Length; i += 2) { string key = (string)param[i]; object obj = param[i + 1]; if (obj.GetType() == typeof(Electrotank.Electroserver5.Api.EsObject)) { eso.setEsObject(key, (Electrotank.Electroserver5.Api.EsObject)obj); } else if (obj.GetType() == typeof(string)) { eso.setString(key, (string)obj); } else if (obj.GetType() == typeof(int)) { eso.setInteger(key, (int)obj); } else if (obj.GetType() == typeof(bool)) { eso.setBoolean(key, (bool)obj); } else if (obj.GetType() == typeof(long)) { eso.setLong(key, (long)obj); } else if (obj is Electrotank.Electroserver5.Api.EsObject[]) { eso.setEsObjectArray(key, (Electrotank.Electroserver5.Api.EsObject[])obj); } else if (obj is int[]) { eso.setIntegerArray(key, (int[])obj); } else if (obj is string[]) { eso.setStringArray(key, (string[])obj); } else { Debug.LogError("-----> " + key + " Invalid"); } //else if (obj.GetType() == typeof(byte)) // eso.setByte(key, (byte)obj); //else if (obj.GetType() == typeof(char)) // eso.setChar(key, (char)obj); //else if (obj.GetType() == typeof(float)) // eso.setFloat(key, (float)obj); //else if (obj.GetType() == typeof(double)) // eso.setDouble(key, (double)obj); //else if (obj.GetType() == typeof(short)) // eso.setShort(key, (short)obj); } return(eso); }
public ChannelPhom(Electrotank.Electroserver5.Api.EsObject obj) { if (obj.variableExists("zoneId")) { zoneId = obj.getInteger("zoneId"); } if (obj.variableExists("roomId")) { roomId = obj.getInteger("roomId"); } if (obj.variableExists("zoneName")) { zoneName = obj.getString("zoneName"); } if (obj.variableExists("roomName")) { roomName = obj.getString("roomName"); switch (roomName) { case "phom_nghiepdu": this.type = ChannelType.Amateur; break; case "phom_chuyennghiep": this.type = ChannelType.Professional; break; case "phom_caothu": this.type = ChannelType.Experts; break; case "phom_daigia": this.type = ChannelType.Giants; break; default: break; } } if (obj.variableExists("description")) { description = obj.getString("description"); } if (obj.variableExists("maximumPlayers")) { maximumPlayers = obj.getInteger("maximumPlayers"); } if (obj.variableExists("numberUsers")) { numberUsers = obj.getInteger("numberUsers"); } if (obj.variableExists("bettingValues")) { bettingValues = obj.getIntegerArray("bettingValues"); } if (obj.variableExists("minimumMoney")) { minimumMoney = obj.getInteger("minimumMoney"); } if (obj.variableExists("moneyType")) { moneyType = obj.getString("moneyType"); } }
internal void OnShowIndividualCard(Electrotank.Electroserver5.Api.EsObject eso) { ShowPanelBetting(); panelBetting.ShowIndividualCard(eso); }
public void OnBettingValueHandler(Electrotank.Electroserver5.Api.EsObject eso) { panelJoin.OnBettingValueChange(eso); }
public ChannelChan(Electrotank.Electroserver5.Api.EsObject obj) { if (obj.variableExists("zoneId")) { zoneId = obj.getInteger("zoneId"); } if (obj.variableExists("roomId")) { roomId = obj.getInteger("roomId"); } if (obj.variableExists("zoneName")) { zoneName = obj.getString("zoneName"); } if (obj.variableExists("roomName")) { roomName = obj.getString("roomName"); switch (roomName) { case "chan_nendat": this.type = ChannelType.Amateur; break; case "chan_chieucoi": this.type = ChannelType.Professional; break; case "chan_phango": this.type = ChannelType.Experts; break; case "chan_sapgu": this.type = ChannelType.Giants; break; case "chan_giaidau": this.type = ChannelType.Tournament; break; default: break; } } if (obj.variableExists("description")) { description = obj.getString("description"); } if (obj.variableExists("maximumPlayers")) { maximumPlayers = obj.getInteger("maximumPlayers"); } if (obj.variableExists("numberUsers")) { numberUsers = obj.getInteger("numberUsers"); } if (obj.variableExists("bettingValues")) { bettingValues = obj.getIntegerArray("bettingValues"); } if (obj.variableExists("minimumMoney")) { minimumMoney = obj.getInteger("minimumMoney"); } if (obj.variableExists("playActionTime")) { timePlay = obj.getIntegerArray("playActionTime"); } if (obj.variableExists("moneyType")) { moneyType = obj.getString("moneyType"); } }
public void LocationFullLayingChiu(Electrotank.Electroserver5.Api.EsObject[] list, bool isResult) { int x = 0; int carid = 0; if (list == null || list.Length == 0) { return; } string textValue = ""; int index = 0; if (GameModelChan.game.listFullLaying[2] == list) { index = (GameModelChan.game.listFullLaying[0].Length + GameModelChan.game.listFullLaying[1].Length) / 2; textValue = "Ù"; } List <GameObject> listGameObject = new List <GameObject>(); for (int i = 0; i < list.Length; i++) { Electrotank.Electroserver5.Api.EsObject obj = list[i]; carid = obj.getInteger("id"); if (carid == obj.getInteger("id")) { x++; } ChanCard c = new ChanCard(0, obj.getInteger("id")); c.Instantiate(GameModelChan.game.mPlaymat.locationFullLaying); if (obj.variableExists("cardDraw") && obj.getBoolean("cardDraw")) { c.isDrawFromDeck = true; } Vector3 moveToPosition = GameModelChan.game.mPlaymat.GetLocationFullLayingChiu(index, i); if (isResult) { moveToPosition.x -= 230f; } c.gameObject.transform.localPosition = moveToPosition; if (i % 2 == 1) { index++; } listGameObject.Add(c.gameObject); } int indexCenter = Mathf.FloorToInt(listGameObject.Count / 2) - 1; Vector3 centerObject = new Vector3(listGameObject[indexCenter].transform.localPosition.x, 110f, listGameObject[indexCenter].transform.localPosition.z); if (listGameObject.Count / 2 % 2 == 0) { centerObject.x += 20f; } GameObject objText = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/LablePrefab")); UILabel text = objText.GetComponent <UILabel>(); objText.transform.parent = GameModelChan.game.mPlaymat.locationFullLaying; objText.transform.localScale = Vector3.one; objText.transform.localPosition = centerObject; text.color = Color.black; text.text = textValue; ListGameObjectFulllaying.Add(objText); ListGameObjectFulllaying.AddRange(listGameObject); }