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


C# Packet.PutLong方法代码示例

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


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

示例1: SendRebirthEventInfo

	private void SendRebirthEventInfo(Creature creature)
	{
		var duration = PlayTimeNeeded;
		var startPlayTime = (long)creature.Vars.Perm[StartPlayTimeVar];
		var pastPlayTime = TimeSpan.FromSeconds(creature.PlayTime - startPlayTime);

		var packet = new Packet(Op.RebirthEventInfo, creature.EntityId);
		packet.PutByte(true);
		packet.PutLong(duration);
		packet.PutLong(pastPlayTime);
		packet.PutString(L("(Receive a Rebirth Potion at 0.00%.)"));
		packet.PutString(L("Receive Potion"));

		creature.Client.Send(packet);
	}
开发者ID:aura-project,项目名称:aura,代码行数:15,代码来源:new_rebirth_event.cs

示例2: StartRP

		/// <summary>
		/// Sends StartRP to creature's client, to switch to control
		/// to given RP character.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="entityId"></param>
		public static void StartRP(Creature creature, long entityId)
		{
			Packet packet = new Packet(Op.StartRP, MabiId.Channel);
			packet.PutLong(entityId);

			creature.Client.Send(packet);
		}
开发者ID:aura-project,项目名称:aura,代码行数:13,代码来源:Send.RolePlaying.cs

示例3: ReadNoteR

		/// <summary>
		/// Sends note to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="note">Set to null for negative response.</param>
		public static void ReadNoteR(MsgrClient client, Note note)
		{
			var packet = new Packet(Op.Msgr.ReadNoteR, 0);

			packet.PutByte(note != null);
			if (note != null)
			{
				packet.PutLong(note.Id);
				packet.PutString(note.FromCharacterName);
				packet.PutString(note.FromServer);
				packet.PutLong(note.GetLongTime());
				packet.PutByte(0); // Notification note? (reply disabled)
				packet.PutString(note.Message);
			}

			client.Send(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:22,代码来源:MsgrSenders.cs

示例4: EndRP

		/// <summary>
		/// Send EndRP to creature's client, to end RP session.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="regionId"></param>
		public static void EndRP(Creature creature, int regionId)
		{
			Packet packet = new Packet(Op.EndRP, MabiId.Channel);
			packet.PutLong(creature.EntityId);
			packet.PutInt(regionId);

			creature.Client.Send(packet);
		}
开发者ID:aura-project,项目名称:aura,代码行数:13,代码来源:Send.RolePlaying.cs

示例5: RequestSecondaryLogin

		/// <summary>
		/// Sends RequestSecondaryLogin to creature's client, requesting
		/// it to send a login packet for the given entity id.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="entityId">Entity to log in.</param>
		/// <param name="channelHost">Host of channel to log in to.</param>
		/// <param name="channelPort">Port of channel to log in to.</param>
		public static void RequestSecondaryLogin(Creature creature, long entityId, string channelHost, int channelPort)
		{
			Packet packet = new Packet(Op.RequestSecondaryLogin, MabiId.Channel);
			packet.PutLong(entityId);
			packet.PutString(channelHost);
			packet.PutShort((short)channelPort);

			creature.Client.Send(packet);
		}
开发者ID:aura-project,项目名称:aura,代码行数:17,代码来源:Send.RolePlaying.cs

示例6: DungeonInfo

		/// <summary>
		/// Sends DungeonInfo to creature's client.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="dungeon"></param>
		public static void DungeonInfo(Creature creature, Dungeon dungeon)
		{
			var packet = new Packet(Op.DungeonInfo, MabiId.Broadcast);

			packet.PutLong(creature.EntityId);
			packet.PutLong(dungeon.InstanceId);
			packet.PutByte(1);
			packet.PutString(dungeon.Name);
			packet.PutInt(dungeon.ItemId);
			packet.PutInt(dungeon.Seed);
			packet.PutInt(dungeon.FloorPlan);

			packet.PutInt(dungeon.Regions.Count);
			foreach (var floor in dungeon.Regions)
				packet.PutInt(floor.Id);

			packet.PutString(dungeon.Options.ToString());

			packet.PutInt(dungeon.Generator.Floors.Count);
			foreach (var floor in dungeon.Generator.Floors)
			{
				var rooms = floor.GetRooms();

				packet.PutInt(rooms.Count);
				foreach (var room in rooms)
				{
					packet.PutByte((byte)room.X);
					packet.PutByte((byte)room.Y);
				}
			}

			packet.PutInt(0); // ? look at ciar info

			packet.PutInt(dungeon.Generator.Floors.Count);
			foreach (var floor in dungeon.Generator.Floors)
			{
				packet.PutUInt(0); // Floor seed or 0 apparently
				packet.PutInt(0); // Somethin.
			}

			creature.Client.Send(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:47,代码来源:Send.Dungeons.cs

示例7: NoteListRequestR

		/// <summary>
		/// Sends note list to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="notes">Set to null for negative response.</param>
		public static void NoteListRequestR(MsgrClient client, List<Note> notes)
		{
			var packet = new Packet(Op.Msgr.NoteListRequestR, 0);

			packet.PutByte(notes != null);
			if (notes != null)
			{
				packet.PutInt(notes.Count);
				foreach (var note in notes)
				{
					packet.PutLong(note.Id);
					packet.PutString(note.Sender);
					packet.PutString(note.Message);
					packet.PutLong(note.GetLongTime());
					packet.PutByte(note.Read);
					packet.PutByte(0); // Hidden if 1?
				}
			}

			client.Send(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:26,代码来源:MsgrSenders.cs

示例8: GetTestPacket

		private Packet GetTestPacket()
		{
			var packet = new Packet(0x01234567, 0x0123456789101112);
			packet.PutByte(byte.MaxValue / 2);
			packet.PutShort(short.MaxValue / 2);
			packet.PutUShort(ushort.MaxValue / 2);
			packet.PutInt(int.MaxValue / 2);
			packet.PutUInt(uint.MaxValue / 2);
			packet.PutLong(long.MaxValue / 2);
			packet.PutULong(ulong.MaxValue / 2);
			packet.PutFloat(float.MaxValue / 2);
			packet.PutString("foobar^2");
			packet.PutBin(new byte[] { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 });

			return packet;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:16,代码来源:Packet.cs

示例9: GuildMemberState

		/// <summary>
		/// Sends GuildMemberState to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="guild"></param>
		/// <param name="member"></param>
		/// <param name="user"></param>
		/// <param name="status"></param>
		public static void GuildMemberState(MsgrClient client, Guild guild, GuildMember member, User user, ContactStatus status)
		{
			var packet = new Packet(Op.Msgr.GuildMemberState, 0);
			packet.PutByte(true);
			packet.PutInt(user.Id);
			packet.PutByte((byte)(status == ContactStatus.Online ? ContactStatus.Online : ContactStatus.Offline));
			packet.PutString(user.ChannelName);
			packet.PutLong(user.LastLogin.Ticks);
			packet.PutInt((int)member.Rank);
			packet.PutString(user.FullName);

			client.Send(packet);
		}
开发者ID:aura-project,项目名称:aura,代码行数:21,代码来源:MsgrSenders.cs

示例10: PartyWindowUpdate

		/// <summary>
		/// I THINK this one is for actually updating the UI element of the party (with leader controls).
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="party"></param>
		public static void PartyWindowUpdate(Creature creature, Party party)
		{
			var packet = new Packet(Op.PartyWindowUpdate, 0);

			packet.PutLong(creature.EntityId);

			// TODO: Find out what these actually mean.
			packet.PutByte(1);
			packet.PutByte(1);
			packet.PutByte(0);
			packet.PutByte(0);

			party.Broadcast(packet, true);
		}
开发者ID:aura-project,项目名称:aura,代码行数:19,代码来源:Send.Parties.cs

示例11: YouGotNote

		/// <summary>
		/// Sends note to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="note"></param>
		public static void YouGotNote(MsgrClient client, Note note)
		{
			var packet = new Packet(Op.Msgr.YouGotNote, 0);

			packet.PutLong(note.Id);
			packet.PutString(note.FromCharacterName);
			packet.PutString(note.FromServer);

			client.Send(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:15,代码来源:MsgrSenders.cs

示例12: ChatLeave

		/// <summary>
		/// Notifies session user about user closing chat window.
		/// </summary>
		/// <param name="session"></param>
		/// <param name="user"></param>
		public static void ChatLeave(ChatSession session, User user)
		{
			var packet = new Packet(Op.Msgr.ChatLeave, 0);

			packet.PutLong(session.Id);
			packet.PutInt(user.Id);

			session.Broadcast(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:14,代码来源:MsgrSenders.cs

示例13: PartyLeaveUpdate

		/// <summary>
		/// Updates remaining party members of a member who has left the party.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="party"></param>
		public static void PartyLeaveUpdate(Creature creature, Party party)
		{
			var packet = new Packet(Op.PartyLeaveUpdate, 0);

			packet.PutLong(creature.EntityId);

			party.Broadcast(packet, true);
		}
开发者ID:aura-project,项目名称:aura,代码行数:13,代码来源:Send.Parties.cs

示例14: ChatR

		/// <summary>
		/// Broadcasts chat message in session.
		/// </summary>
		/// <param name="session"></param>
		/// <param name="contactId"></param>
		/// <param name="message"></param>
		public static void ChatR(ChatSession session, int contactId, string message)
		{
			var packet = new Packet(Op.Msgr.ChatR, 0);

			packet.PutLong(session.Id);
			packet.PutInt(contactId);
			packet.PutString(message);

			session.Broadcast(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:16,代码来源:MsgrSenders.cs

示例15: ChatJoin

		/// <summary>
		/// Sends initial chat session information to user.
		/// </summary>
		/// <param name="user"></param>
		/// <param name="session"></param>
		public static void ChatJoin(User user, ChatSession session)
		{
			var users = session.GetUsers();

			var packet = new Packet(Op.Msgr.ChatJoin, 0);

			packet.PutLong(session.Id);
			packet.PutInt(users.Length);
			foreach (var sessionUser in users)
			{
				packet.PutInt(sessionUser.Id);
				packet.PutString(sessionUser.FullName);
			}

			user.Client.Send(packet);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:21,代码来源:MsgrSenders.cs


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