public void RequestSublimationClear(ulong rItemId) { var msg = PacketObject.Create <CsSublimationClear>(); msg.itemId = rItemId; session.Send(msg); }
private void RefreshRewardList(PReward reward, bool isWin) { if (reward == null) { return; } if (moduleGlobal.targetMatrial.isProcess) { target.Init(reward, moduleGlobal.targetMatrial); } List <PItem2> rewards = new List <PItem2>(); if (reward.diamond > 0) { PItem2 item = PacketObject.Create <PItem2>(); item.itemTypeId = (ushort)CurrencySubType.Diamond; item.num = (uint)reward.diamond; rewards.Add(item); } if (reward.rewardList != null && reward.rewardList.Length > 0) { rewards.AddRange(reward.rewardList); } if (isWin) { winReward.SetItems(rewards); } else { loseReward.SetItems(rewards); } }
public static void OnEntryPacket(PacketObject packet) { if (enable_recv_period_) { sw_recv_period_.Restart(); } }
public void RequestComposeItem(List <DecomposePair> rItemIds) { var p = PacketObject.Create <CsItemDecompose>(); p.composeArr = DecomposePair.Convert(rItemIds); session.Send(p); }
public void RequestGetGrowthFund(byte rGrowthId) { var msg = PacketObject.Create <CsChargeDrawGrowthFund>(); msg.drawId = rGrowthId; session.Send(msg); }
private void AssertDataContainer() { if (m_info == null) { m_info = PacketObject.Create <ScFactionInfos>(); } }
public override void OnRootUpdate(float diff) { base.OnRootUpdate(diff); if (loading && m_loadingType != EnumPVELoadingType.None) { if (m_lastProgress != m_progress) { m_lastProgress = m_progress; if (!FightRecordManager.IsRecovering) { var p = PacketObject.Create <CsTeamRoomLoading>(); p.progress = m_lastProgress; p.type = (sbyte)m_loadingType; Send(p); } if (m_lastProgress == 100) { if (FightRecordManager.IsRecovering) { if (!FightRecordManager.gameRecover?.GameRecordDataHandle?.OnLoadComplete() ?? true) { FightRecordManager.gameRecover?.GameRecordDataHandle?.OnTransportComplete(); } } moduleLoading.SetLoadingInfo(8); } } } }
public void SendDeleteMes(ulong playId) { var p = PacketObject.Create <CsFriendDelete>(); p.roleId = playId; session.Send(p); }
//删除没有附件的已读邮件和有附件已领取的邮件 public void SendDeleteMails() { List <ulong> mails = new List <ulong>(); for (int i = 0; i < m_allMails.Count; i++) { bool haveAttachment = m_allMails[i].attachment != null && m_allMails[i].attachment.Length >= 1 && m_allMails[i].isGet == 1; bool noAttachment = (m_allMails[i].attachment == null || m_allMails[i].attachment.Length < 1) && m_allMails[i].isRead == 1; if (haveAttachment || noAttachment) { mails.Add(m_allMails[i].mailId); } } if (mails.Count < 1) { var info = ConfigManager.Get <ConfigText>((int)TextForMatType.MailUIText); moduleGlobal.ShowMessage(info.text[2]); return; } CsSystemMailDel delete = PacketObject.Create <CsSystemMailDel>(); delete.mailIds = mails.ToArray(); session.Send(delete); }
protected override void OnConnected() { Logger.LogInfo("Team connected to server [{0}:{1}], use game session: {2}", host, port, m_useGameSession); var p = PacketObject.Create <CsTeamRoomEnter>(); p.roleId = modulePlayer.roleInfo.roleId; p.roomKey = m_room.room_key; Send(p); if (!m_useGameSession) { SendPing(); } #region NetStat statistic #if NETSTAT var r = m_useGameSession ? session.receiver : receiver; if (r != null) { r.netStat = true; } #endif #endregion }
private void Login() { if (session.connected) { session.Disconnect(); } moduleGlobal.LockUI(0.5f); session.Connect(account.server.host, account.server.port, s => { moduleGlobal.UnLockUI(); DispatchModuleEvent(EventConnection, s.connected ? 0 : 1); if (!s.connected || account == null) { return; // Connect aborted if account is null } m_preventLoginMessage = 0; DelayEvents.Remove(m_waitEventHandler); m_sendLoginTime = Level.realTime; var p = PacketObject.Create <CsLogin>(); p.accName = account.acc_name; p.accId = account.acc_id; p.tick = account.tick; p.type = WebAPI.PLATFORM_TYPE; s.Send(p); }); }
public void WorldSession() { CsWorldSession p = PacketObject.Create <CsWorldSession>(); p.roleId = m_serverRoleId; Send(p); }
public void GetServerMes() { moduleFriend.GetAllChatInfo = false; CsChatAllMessage p = PacketObject.Create <CsChatAllMessage>(); Send(p); }
public void Show_word_details(ulong playId) { CsRoleDetailView p = PacketObject.Create <CsRoleDetailView>(); p.roleId = playId; session.Send(p); }
public void RequestGetTotal(byte rTotalId) { var msg = PacketObject.Create <CsChargeDrawReward>(); msg.drawId = rTotalId; session.Send(msg); }
public void SendAddMes(ulong playId)//发送添加请求 { ApplyPlayerID = playId; var p = PacketObject.Create <CsFriendAddApply>(); p.roleId = playId; bool is_apply = false; PPlayerInfo apply_add = Apply_playerList.Find(apply => apply.roleId == playId); if (apply_add != null) { is_apply = true; } if (is_apply) { SendReplyAgreeMes(playId); DispatchModuleEvent(EventFriendAddApply, 0); } else { session.Send(p); moduleGlobal.LockUI(string.Empty, 0.5f); } AddApplyID.Add(playId); }
public void GetAllBlock() { //获取黑名单 var p = PacketObject.Create <CsFriendBlackList>(); session.Send(p); }
public void SendChangeRoom(ulong roomId) { CsChatRoomChange p = PacketObject.Create <CsChatRoomChange>(); p.roomId = roomId; Send(p); }
public void SendSetMazeHp(uint hp) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("maze_hp {0}", hp); gm.gmStr = str; session.Send(gm); }
public void SendAddExp(uint num) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("expr {0}", num); gm.gmStr = str; session.Send(gm); }
public void SendChangeLv(int num) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("lv {0}", num); gm.gmStr = str; session.Send(gm); }
public void DuplicateRole(string roleName, string accName = "") { CsCopyRole p = PacketObject.Create <CsCopyRole>(); p.roleName = roleName; p.accName = accName; session.Send(p); }
public void UnLockNpcPledge(int npcId) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("unlock_npc_pledge {0}", npcId); gm.gmStr = str; session.Send(gm); }
public void SendAddNpcExp(int npcId, int value) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("add_npc_exp {0} {1}", npcId, value); gm.gmStr = str; session.Send(gm); }
public void SendAddMoney(int type, int num) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("money {0} {1}", type, num); gm.gmStr = str; session.Send(gm); }
public void SendAddNpcMood(int mood) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("add_npc_engagement_mood {0}", mood); gm.gmStr = str; session.Send(gm); }
public void SendAddProp(ushort propId, int num) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("item {0} {1}", propId, num); gm.gmStr = str; session.Send(gm); }
public void SendCharge(int rProductId) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = $"recharge {rProductId}"; gm.gmStr = str; session.Send(gm); }
public void SendUnlockAllChase(int level) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("unlock_all_stage {0}", level); gm.gmStr = str; session.Send(gm); }
public void SendSentiment(string sent) { CsSystemGm gm = PacketObject.Create <CsSystemGm>(); string str = Util.Format("union_sent {0}", sent); gm.gmStr = str; session.Send(gm); }