bool BackBagUpdateData(uint _msgType, UMessage msg) { byte state = msg.ReadByte(); ushort itemid = msg.ReaduShort(); byte changeNumber = msg.ReadByte(); ushort itemNumber = msg.ReaduShort(); Debug.Log(itemid.ToString() + " " + changeNumber.ToString() + " " + itemNumber.ToString()); if (currentItems_.ContainsKey(itemid)) { if (itemNumber == 0) { currentItems_.Remove(itemid); return(true); } currentItems_[itemid].itemNumber = itemNumber; } else { Item item = new Item(); item.itemid = itemid; item.itemNumber = itemNumber; currentItems_.Add(itemid, item); } Bag.GetBagInstance().LoadBagItemResource(); return(true); }
/// <summary> /// /// </summary> /// <param name="message"></param> public static void HideEvent(UMessage message) { if (OnMessageEnd != null) { OnMessageEnd(message); } }
bool BackChampionInfo(uint msgType, UMessage msg) { short iscontinue = msg.ReadShort(); short length = msg.ReadShort(); for (int index = 0; index < length; index++) { ChampionRankData crd = new ChampionRankData(); crd.time = msg.ReadUInt(); crd.contestName = msg.ReadString(); crd.playerid = msg.ReadUInt(); crd.faceid = msg.ReadInt(); crd.playerName = msg.ReadString(); crd.contestid = msg.ReadUInt(); championList.Add(crd); } if (iscontinue >= 0) { currentChampionBeginIndex = (short)(iscontinue + length); } RankDataPrompt(0 == championList.Count); return(true); }
public void ProcessPacket() { if (uNetSocket == null || !IsSocketConnected) { return; } //先判断一下 防止浪费queue变量 拖慢gc if (uNetSocket.GetMessageCount() > 0) { Queue <IScsMessage> tmpQueue = uNetSocket.CopyMessage(); while (tmpQueue.Count > 0) { UMessage msg = (UMessage)tmpQueue.Dequeue(); if (msg is UMessage) { CMsgDispatcher.GetInstance().MsgDispatch(msg.GetMsgType(), msg); } else { Debug.LogError("message is Not a UMessage !"); } } } }
/// <summary> /// 服务器通知客户端需要更新排行榜 /// </summary> bool BackNeedUpdateCoinRank(uint _msgType, UMessage _ms) { m_iCoinRankState = 1; m_fLeftCoinRankTime = _ms.ReadSingle(); Debug.Log("服务器通知客户端需要更新排行榜数据!LeftCoinRankTime:%f" + m_fLeftCoinRankTime); return(true); }
public void SetSendData(UMessage msg) { msg.Add(nPlatform); msg.Add(nBindOrLogin); msg.Add(nCode); msg.Add(smachinecode); }
public UMessage AddObj(UMessage obj) { var data = db.UMessages.Add(obj); db.SaveChanges(); return(obj); }
public void ReadMessage(UMessage msg) { roomid = msg.ReadUInt(); carryMoney = msg.ReadLong(); level = msg.ReadByte(); state = msg.ReadByte(); lefttime = msg.ReadSingle(); whoisasked = msg.ReadByte(); bosssitNo = msg.ReadByte(); publiccardNum = msg.ReadByte(); for (byte index = 0; index < publiccardNum; index++) { publiccards.Add(msg.ReadByte()); } isOnPlayerNum = msg.ReadByte(); for (byte index = 0; index < isOnPlayerNum; index++) { TexasPokerPlayerInfo tpp = new TexasPokerPlayerInfo(); tpp.sitNo = msg.ReadByte(); tpp.userid = msg.ReadUInt(); tpp.faceid = msg.ReadUInt(); tpp.url = msg.ReadString(); tpp.carryMoney = msg.ReadLong(); tpp.playerName = msg.ReadString(); tpp.currentCardNum = msg.ReadByte(); tpp.preChipNum = msg.ReadLong(); tpp.currChipNum = msg.ReadLong(); playerinfos.Add(tpp.sitNo, tpp); } }
public void SetSendData(UMessage msg) { //msg.Add(carportMsgType); msg.Add(nCarID); msg.Add(nUseid); msg.Add(nChipNum); }
public void ReadData(UMessage msg) { level = msg.ReadByte(); coin = msg.ReadLong(); diamond = msg.ReadUInt(); accountID = msg.ReadUInt(); }
public void ReadMessage(UMessage msg) { countTime = msg.ReadSingle(); cutBlindsTime = msg.ReadSingle(); onePokerTime = msg.ReadSingle(); gameoverTime = msg.ReadSingle(); askChipTime = msg.ReadSingle(); maxPlayers = msg.ReadInt(); levelNum = msg.ReadByte(); for (byte index = 0; index < levelNum; index++) { TexasPokerLevelInfo levelinfo = new TexasPokerLevelInfo(); levelinfo.level = msg.ReadByte(); levelinfo.types = msg.ReadInt(); for (int typeindex = 0; typeindex < levelinfo.types; typeindex++) { TexasPokerTypeInfo typeinfo = new TexasPokerTypeInfo(); typeinfo.sign = msg.ReadByte(); typeinfo.maxCarryIn = msg.ReadUInt(); typeinfo.blinds = msg.ReadUInt(); typeinfo.currentPlayerNum = msg.ReadInt(); levelinfo.typeinfos.Add(typeinfo); } levelinfos.Add(levelinfo); } }
public void ReadData(UMessage msg) { handsel = msg.ReadLong(); addRewardCoin = msg.ReadLong(); addNormalCoin = msg.ReadLong(); carryMoney = msg.ReadLong(); int length = msg.ReadInt(); for (int index = 0; index < length; index++) { if (sortData.Count > index) { sortData[index].playerid = msg.ReadUInt(); sortData[index].faceID = msg.ReadUInt(); sortData[index].url = msg.ReadString(); sortData[index].addNormalCoin = msg.ReadLong(); sortData[index].userName = msg.ReadString(); } else { ForestDanceSortData data = new ForestDanceSortData(); data.playerid = msg.ReadUInt(); data.faceID = msg.ReadUInt(); data.url = msg.ReadString(); data.addNormalCoin = msg.ReadLong(); data.userName = msg.ReadString(); sortData.Add(data); } } }
public void SetSendData(UMessage msg) { //msg.Add(forestMsgType); msg.Add(sign); msg.Add(userID); msg.Add(chipCoin); }
public void ReadData(UMessage msg) { model = msg.ReadByte(); //model = (byte)GameCity.ForestMode_Enum.ForestMode_Handsel; //model = (byte)GameCity.ForestMode_Enum.ForestMode_GiveGun; //model = (byte)GameCity.ForestMode_Enum.ForestMode_Four; //model = (byte)GameCity.ForestMode_Enum.ForestMode_Three; sign = msg.ReadByte(); //sign = 2; osign = msg.ReadByte(); handle = msg.ReadLong(); signs.Clear(); if (model == (byte)GameCity.ForestMode_Enum.ForestMode_Flash) { power = msg.ReadByte(); } else if (model == (byte)GameCity.ForestMode_Enum.ForestMode_GiveGun) { for (int index = 0; index < sign; index++) { if (signs.Count > index) { signs[index] = msg.ReadByte(); } else { signs.Add(msg.ReadByte()); } } } //signs.Add(11); //signs.Add(12); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubChangeContent; //msg.Add(nClubMsg_Type); msg.Add(clubid); msg.Add(content); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.CM_ClubScondCreate; //msg.Add(nClubMsg_Type); msg.Add(playerid); msg.Add(clubName); }
public void ReadData(UMessage msg) { isStart = msg.ReadBool(); if (!isStart) { return; } getCoin = msg.ReadLong(); playerCoin = msg.ReadLong(); nLinenum = msg.ReadUInt(); nWinCoin = msg.ReadLong(); nFreeNum = msg.ReadByte(); cardNum = msg.ReadByte(); wLinenum = msg.ReadByte(); for (int index = 0; index < 15; index++) { icons.Add(msg.ReadByte()); } for (int index = 0; index < wLinenum; index++) { USlotWinData swd = new USlotWinData(); swd.lineid = msg.ReadByte(); swd.lof = msg.ReadByte(); swd.number = msg.ReadByte(); windata.Add(swd); } currentlottery = msg.ReadLong(); lottery = msg.ReadLong(); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubSecondExpel; //msg.Add(nClubMsg_Type); msg.Add(clubid); msg.Add(expelID); }
/// <summary> /// 兑换钻石消息 /// </summary> bool BackDiamondCashToDiamond(uint _msgType, UMessage _ms) { byte state = _ms.ReadByte(); if (state == 1) { if (DiamondOkButton) { DiamondOkButton.interactable = true; } CCustomDialog.OpenCustomConfirmUI(1508); return(false); } if (RedBagInputField) { RedBagInputField.text = string.Empty; } if (DiamondOkButton) { DiamondOkButton.interactable = false; } CCustomDialog.OpenCustomConfirmUI(1507); return(true); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubSecondJoin; //msg.Add(nClubMsg_Type); msg.Add(clubID); msg.Add(playerID); }
//填充公会数据 public void InitData(UMessage msg) { GuildID = msg.ReadUInt(); if (GuildID == 0) { failedid = msg.ReadByte(); return; } GuildName = msg.ReadString(); GuildCreatePlayerID = msg.ReadUInt(); GuildCreatePlayerName = msg.ReadString(); GuildLevel = msg.ReadUInt(); GuildMemberNum = msg.ReadUInt(); GuildMaxMemberNum = msg.ReadUInt(); GuildMoney = msg.ReadSingle(); GuildContent = msg.ReadString(); GuildActive = msg.ReadLong(); GuildBreakTime = msg.ReadUInt(); m_GuildMemberList.Clear(); for (uint index = 0; index < GuildMemberNum; index++) { GuildPlayerData member = new GuildPlayerData(); member.useid = msg.ReadUInt(); member.name = msg.ReadString(); member.vipLevel = msg.ReadUInt(); member.active = msg.ReadLong(); member.online = msg.ReadBool(); member.icon = msg.ReadUInt(); member.url = msg.ReadString(); m_GuildMemberList.Add(member); } failedid = 0; }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubSecondCheckPhone; //msg.Add(nClubMsg_Type); msg.Add(userID); msg.Add(phoneNumber); }
public void Ask4MailData() { UMessage mailmsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_REQUESTPLAYERMAILINFO); mailmsg.Add(GameMain.hall_.GetPlayerId()); NetWorkClient.GetInstance().SendMsg(mailmsg); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubSecondChangeJoinCondition; //msg.Add(nClubMsg_Type); msg.Add(clubid); msg.Add(condition); }
/// <summary> /// 发送消息到login 获取金钱排行榜 /// </summary> public void SendGetCoinRankData(short nBeginSign = 0) { UMessage LoginMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERGETCOINRANK); LoginMsg.Add(nBeginSign); NetWorkClient.GetInstance().SendMsg(LoginMsg); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ClubSecondExpelOneKey; //msg.Add(nClubMsg_Type); msg.Add(clubid); msg.Add(Time2Expel); }
void LocalFire(GameObject target) { if (BelongRole == null || BelongRole.m_nTotalCoin < m_nBulletCost) { LocalFireFail(); return; } UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CCMsg_FISHING_CM_APPLYFIRE); msg.Add(GameMain.hall_.GetPlayerId()); msg.Add(transform.eulerAngles.z); msg.Add((byte)m_Data.m_szBulletPoint.Length); msg.Add(++m_nBulletId); HallMain.SendMsgToRoomSer(msg); OnFire(target, m_nBulletId); if (m_FireSound != null) { m_FireSound.volume = AudioManager.Instance.SoundVolume; m_FireSound.loop = false; m_FireSound.Play(); } BelongRole.UpdateInfoUI(BelongRole.m_nTotalCoin - m_nBulletCost); }
public void SetSendData(UMessage msg) { //nClubMsg_Type = (uint)GameCity.ClubSecondMsg.ExitClub; //msg.Add(nClubMsg_Type); msg.Add(clubid); msg.Add(userid); }
/// <summary> /// 请求大师分排行榜数据消息 /// </summary> /// <param name="beginindex">排行榜等级</param> public void Ask4RankInfo(short beginindex = 0) { rankDataPromptUpdateState = true; GameKind_Enum currentGameID = (GameKind_Enum)currentgameid; if (0 == beginindex) { if (currentGameID == GameKind_Enum.GameKind_LandLords) { if (llrMasterList.Count > 0) { RankDataPrompt(false); return; } } else if (currentGameID == GameKind_Enum.GameKind_GuanDan) { if (terMasterList.Count > 0) { RankDataPrompt(false); return; } } } UMessage ask4RankDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_APPLYMASTERRANKTOLOGIN); ask4RankDataMsg.Add(currentgameid); ask4RankDataMsg.Add(beginindex); NetWorkClient.GetInstance().SendMsg(ask4RankDataMsg); }
// GET: UMessage/Edit/5 public ActionResult Edit(int?id) { var UserId = User.Identity.GetUserId(); var user = db.Users.Single(u => u.Id == UserId); ViewBag.UserName = user.Name; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UMessage message = db.UMessages.Find(id); if (message == null) { return(HttpNotFound()); } return(View(message)); }