当前位置: 首页>>代码示例>>C#>>正文


C# Packet.AddRegen方法代码示例

本文整理汇总了C#中Aura.Shared.Network.Packet.AddRegen方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.AddRegen方法的具体用法?C# Packet.AddRegen怎么用?C# Packet.AddRegen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aura.Shared.Network.Packet的用法示例。


在下文中一共展示了Packet.AddRegen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StatUpdate


//.........这里部分代码省略.........
						case Stat.BalanceBaseMod: packet.PutShort((short)(creature.BalanceBaseMod)); break;

						case Stat.RightBalanceMod: packet.PutShort((short)creature.RightBalanceMod); break;
						case Stat.LeftBalanceMod: packet.PutShort((short)creature.LeftBalanceMod); break;

						case Stat.CriticalBase: packet.PutFloat(creature.CriticalBase); break;
						case Stat.CriticalBaseMod: packet.PutFloat(creature.CriticalBaseMod); break;

						case Stat.RightCriticalMod: packet.PutFloat(creature.RightCriticalMod); break;
						case Stat.LeftCriticalMod: packet.PutFloat(creature.LeftCriticalMod); break;

						case Stat.AttackMinBase: packet.PutShort((short)creature.AttackMinBase); break;
						case Stat.AttackMaxBase: packet.PutShort((short)creature.AttackMaxBase); break;

						case Stat.AttackMinBaseMod: packet.PutShort((short)creature.AttackMinBaseMod); break;
						case Stat.AttackMaxBaseMod: packet.PutShort((short)creature.AttackMaxBaseMod); break;

						case Stat.AttackMinMod: packet.PutShort((short)creature.AttackMinMod); break;
						case Stat.AttackMaxMod: packet.PutShort((short)creature.AttackMaxMod); break;

						case Stat.RightAttackMinMod: packet.PutShort((short)creature.RightAttackMinMod); break;
						case Stat.RightAttackMaxMod: packet.PutShort((short)creature.RightAttackMaxMod); break;

						case Stat.LeftAttackMinMod: packet.PutShort((short)creature.LeftAttackMinMod); break;
						case Stat.LeftAttackMaxMod: packet.PutShort((short)creature.LeftAttackMaxMod); break;

						case Stat.InjuryMinBaseMod: packet.PutShort((short)creature.InjuryMinBaseMod); break;
						case Stat.InjuryMaxBaseMod: packet.PutShort((short)creature.InjuryMaxBaseMod); break;

						case Stat.Age: packet.PutShort((short)creature.Age); break;

						// Client might crash with a mismatching value, 
						// take a chance and put an int by default.
						default:
							Log.Warning("StatUpdate: Unknown stat '{0}'.", stat);
							packet.PutInt(0);
							break;
					}
				}
			}

			// Regens
			if (regens == null)
				packet.PutInt(0);
			else
			{
				packet.PutInt(regens.Count);
				foreach (var regen in regens)
					packet.AddRegen(regen);
			}

			// Regens to Remove
			if (regensRemove == null)
				packet.PutInt(0);
			else
			{
				packet.PutInt(regensRemove.Count);
				foreach (var regen in regensRemove)
					packet.PutInt(regen.Id);
			}

			// ?
			// Maybe update of change and max?
			if (regensUpdate == null)
				packet.PutInt(0);
			else
			{
				packet.PutInt(regensUpdate.Count);
				foreach (var regen in regensUpdate)
				{
					packet.PutInt(regen.Id);
					packet.PutFloat(regen.Change);
					packet.PutFloat(regen.Max);
				}
			}

			if (type == StatUpdateType.Public)
			{
				// Another list of regens...?
				packet.PutInt(0);

				if (regensRemove == null)
					packet.PutInt(0);
				else
				{
					// Regens to Remove (again...?)
					packet.PutInt(regensRemove.Count);
					foreach (var regen in regensRemove)
						packet.PutInt(regen.Id);
				}

				// Update?
				packet.PutInt(0);
			}

			if (type == StatUpdateType.Private)
				creature.Client.Send(packet);
			else if (creature.Region != Region.Limbo)
				creature.Region.Broadcast(packet, creature);
		}
开发者ID:xKamuna,项目名称:aura,代码行数:101,代码来源:Send.Creature.cs


注:本文中的Aura.Shared.Network.Packet.AddRegen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。