public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Boss); writer.Write(2, EnemyNumberThisTeam); foreach (int v in EnemyTypeThisTeamList) { writer.Write(3, v); } foreach (int v in ItemTypeThisTeamList) { writer.Write(4, v); } foreach (float v in ItemOddsThisTeamList) { writer.Write(5, v); } writer.Write(6, EnemyTeamColdTime); foreach (int v in BossEnemyTypeList) { writer.Write(11, v); } foreach (int v in BossEnemyCountList) { writer.Write(12, v); } writer.Write(13, ShowBossCome); return(writer.GetProtoBufferBytes()); }
internal static void WriteTransportMessage(this ProtoBufferWriter writer, TransportMessage transportMessage, string?environmentOverride = null) { writer.WriteRawTag(1 << 3 | 2); Write(writer, transportMessage.Id); writer.WriteRawTag(2 << 3 | 2); Write(writer, transportMessage.MessageTypeId); var transportMessageContent = transportMessage.Content ?? _emptyStream; writer.WriteRawTag(3 << 3 | 2); writer.WriteLength((int)transportMessageContent.Length); writer.WriteRawStream(transportMessageContent); writer.WriteRawTag(4 << 3 | 2); Write(writer, transportMessage.Originator); var environment = environmentOverride ?? transportMessage.Environment; if (environment != null) { writer.WriteRawTag(5 << 3 | 2); var environmentLength = GetUtf8ByteCount(environment); writer.WriteString(environment, environmentLength); } if (transportMessage.WasPersisted != null) { WriteWasPersisted(writer, transportMessage.WasPersisted.Value); } }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, UserId); writer.Write(2, Nickname); writer.Write(3, Level); writer.Write(11, CharacterCode); writer.Write(12, RoundInitHealth); writer.Write(13, EnergyCapacity); writer.Write(21, RoundCount); if (HasExp) { writer.Write(31, Exp); } if (HasExpFloor) { writer.Write(32, ExpFloor); } if (HasExpCeil) { writer.Write(33, ExpCeil); } if (HasMoney10) { writer.Write(41, Money10); } if (HasMoney1) { writer.Write(42, Money1); } return(writer.GetProtoBufferBytes()); }
internal static void WritePersistentPeerIds(this ProtoBufferWriter writer, TransportMessage transportMessage, List <PeerId>?persistentPeerIdOverride) { var peerIds = persistentPeerIdOverride ?? transportMessage.PersistentPeerIds; if (peerIds == null) { return; } for (var index = 0; index < peerIds.Count; index++) { var peerIdString = peerIds[index].ToString(); if (string.IsNullOrEmpty(peerIdString)) { continue; } writer.WriteRawTag(7 << 3 | 2); var peerIdStringLength = GetUtf8ByteCount(peerIdString); var peerIdLength = 1 + ProtoBufferWriter.ComputeStringSize(peerIdStringLength); writer.WriteLength(peerIdLength); writer.WriteRawTag(1 << 3 | 2); writer.WriteString(peerIdString, peerIdStringLength); } }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); if (HasLevelUp) { writer.Write(1, LevelUp); } if (HasEnergyCapacityUp) { writer.Write(2, EnergyCapacityUp); } foreach (VegetableUnlock v in VegetableUnlockList) { writer.Write(3, v); } foreach (SkillUnlock v in SkillUnlockList) { writer.Write(4, v); } foreach (MajorLevelUnlockInfo v in MajorLevelUnlockList) { writer.Write(5, v); } foreach (SubLevelUnlockInfo v in SubLevelUnlockList) { writer.Write(6, v); } if (HasEquipAppear) { writer.Write(7, EquipAppear); } return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Result); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, CharacterCode); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, SkillCode); foreach (int v in UseCostList) { writer.Write(2, v); } foreach (int v in UnlockLevelList) { writer.Write(3, v); } foreach (Currency v in UpgradeCostList) { writer.Write(4, v); } foreach (int v in PhysicalDamageList) { writer.Write(5, v); } if (HasExtra) { writer.Write(10, Extra); } return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, OutTradeNo); if (HasTradeNo) { writer.Write(2, TradeNo); } writer.Write(3, RechargeName); writer.Write(4, Count); writer.Write(5, TotalFee); writer.Write(6, PayChannel); writer.Write(7, BuyerUserId); if (HasReceiverUserId) { writer.Write(8, ReceiverUserId); } writer.Write(9, PayState); if (HasPostState) { writer.Write(10, PostState); } writer.Write(11, CreateTime); if (HasPayTime) { writer.Write(12, PayTime); } if (HasCloseTime) { writer.Write(13, CloseTime); } return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, VegetableCode); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, CurrentVegetable); writer.Write(2, CurrentUser); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, MajorLevelId); writer.Write(2, SubLevelId); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, DeviceUid); writer.Write(2, ClientInfo); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, RivalInfo); writer.Write(2, StartSeconds); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, EquipCode); writer.Write(2, IntroContent); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, SkillCode); writer.Write(2, PhysicalDamage); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, CurrentUser); writer.Write(2, NewCharacter); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Type); writer.Write(2, Content); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Count); writer.Write(2, NextNeedTime); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, ClientVersion); writer.Write(2, SaleChannel); writer.Write(3, Os); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Hash); writer.Write(2, HeartMaxLimit); writer.Write(3, HeartRecoverTime); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, Uid); writer.Write(2, AccessToken); writer.Write(3, ExpireTime); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, MyHealth); writer.Write(2, RivalHealth); writer.Write(3, RivalEnergy); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, RechargeName); writer.Write(2, Count); writer.Write(3, Result); return(writer.GetProtoBufferBytes()); }
private static void Write(ProtoBufferWriter writer, MessageId messageId) { var size = 1 + GetMessageSizeWithLength(ProtoBufferWriter.GuidSize); writer.WriteLength(size); writer.WriteRawTag(1 << 3 | 2); writer.WriteGuid(messageId.Value); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, CharacterCode); writer.Write(2, Description); writer.Write(3, TalentIntro); return(writer.GetProtoBufferBytes()); }
internal static void SetWasPersisted(this ProtoBufferWriter writer, bool wasPersisted) { if (writer.TryWriteBoolAtSavedPosition(wasPersisted)) { return; } WriteWasPersisted(writer, wasPersisted); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, AppId); writer.Write(2, ChannelId); writer.Write(3, UserId); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, UserId); writer.Write(2, Character); writer.Write(3, Nickname); return(writer.GetProtoBufferBytes()); }
public byte[] GetProtoBufferBytes() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1, ChallengeId); writer.Write(2, IsWin); writer.Write(3, MyDefenseData); return(writer.GetProtoBufferBytes()); }
public void Test() { ProtoBufferWriter writer = new ProtoBufferWriter(); writer.Write(1,1); writer.Write(2,1); writer.Write(2,2); writer.Write(3,"sunaijing"); byte[] data = writer.GetProtoBufferBytes(); ProtoBufferReader reader = new ProtoBufferReader(data); Assert.AreEqual(4,reader.ProtoBufferObjs.Count); }