本文整理匯總了C#中Server.Network.PacketHitList.AddPacket方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketHitList.AddPacket方法的具體用法?C# PacketHitList.AddPacket怎麽用?C# PacketHitList.AddPacket使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Network.PacketHitList
的用法示例。
在下文中一共展示了PacketHitList.AddPacket方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AppendActiveTeam
public static void AppendActiveTeam(Client client, PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("activeteam");
Player player = client.Player;
for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.Team[i].Loaded == true) {
packet.AppendParameters(player.Team[i].Name, player.Team[i].Species.ToString(), player.Team[i].Form.ToString(), ((int)player.Team[i].Shiny).ToString(), ((int)player.Team[i].Sex).ToString(),
player.Team[i].HP.ToString(), player.Team[i].MaxHP.ToString(),
Server.Math.CalculatePercent(player.Team[i].Exp, Exp.ExpManager.Exp[player.Team[i].Level - 1]).ToString(),
player.Team[i].Level.ToString(), ((int)player.Team[i].StatusAilment).ToString(), player.Team[i].HeldItemSlot.ToString());
} else {
packet.AppendParameter("notloaded");
}
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例2: AppendAllShops
public static void AppendAllShops(Client client, PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("allshopsdata");
for (int i = 1; i <= Shops.ShopManager.Shops.MaxShops; i++) {
packet.AppendParameters(i.ToString(),
Shops.ShopManager.Shops[i].Name.Trim());
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例3: AppendFriendsList
public void AppendFriendsList(PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("friendslist");
packet.AppendParameter(Friends.Count);
for (int i = 0; i < Friends.Count; i++) {
Client clientIsOn = ClientManager.FindClient(Friends[i]);
int ison;
if (clientIsOn != null) {
ison = 1;
} else {
ison = 0;
}
packet.AppendParameters(Friends[i], ison.ToString());
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例4: AppendOwnXY
public static void AppendOwnXY(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, CreatePlayerXY(client));
client.Player.RefreshSeenCharacters(hitlist);
}
示例5: AppendMovePPUpdate
public static void AppendMovePPUpdate(Client client, PacketHitList hitlist, int moveSlot)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("moveppupdate", moveSlot.ToString(),
client.Player.GetActiveRecruit().Moves[moveSlot].CurrentPP.ToString(),
client.Player.GetActiveRecruit().Moves[moveSlot].MaxPP.ToString()));
}
示例6: AppendActiveTeamNum
public static void AppendActiveTeamNum(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("activeteamnum", client.Player.ActiveSlot.ToString()));
}
示例7: AppendMapNpcs
public static void AppendMapNpcs(Client client, PacketHitList hitlist, IMap map, bool temp)
{
TcpPacket packet = new TcpPacket("mapnpcdata");
packet.AppendParameter(map.MapID);
packet.AppendParameter(temp.ToIntString());
for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) {
if ((int)map.ActiveNpc[i].Direction > 3) map.ActiveNpc[i].Direction = Enums.Direction.Right;
packet.AppendParameters(map.ActiveNpc[i].Num.ToString(), map.ActiveNpc[i].Sprite.ToString(), map.ActiveNpc[i].Form.ToString(), ((int)map.ActiveNpc[i].Shiny).ToString(), ((int)map.ActiveNpc[i].Sex).ToString(),
map.ActiveNpc[i].X.ToString(), map.ActiveNpc[i].Y.ToString(), ((int)map.ActiveNpc[i].Direction).ToString(), ((int)map.ActiveNpc[i].StatusAilment).ToString());
if (map.ActiveNpc[i].Num > 0 && NpcManager.Npcs[map.ActiveNpc[i].Num].Behavior != Enums.NpcBehavior.Friendly && NpcManager.Npcs[map.ActiveNpc[i].Num].Behavior != Enums.NpcBehavior.Shopkeeper && NpcManager.Npcs[map.ActiveNpc[i].Num].Behavior != Enums.NpcBehavior.Scripted) {
packet.AppendParameters("1");
} else {
packet.AppendParameters("0");
}
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例8: AppendMapDone
public static void AppendMapDone(Client client, PacketHitList hitlist)
{
//client.Player.GettingMap = false;
hitlist.AddPacket(client, TcpPacket.CreatePacket("mapdone"));
}
示例9: AppendDarkness
public static void AppendDarkness(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("selfdarkness", client.Player.GetActiveRecruit().Darkness));
}
示例10: AppendConnectionID
public static void AppendConnectionID(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("myconid", client.ConnectionID.ToString()));
}
示例11: AppendConfusion
public static void AppendConfusion(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("confusion", client.Player.GetActiveRecruit().Confused.ToIntString()));
//hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerConfusion(client), Enums.OutdateType.Condition);
}
示例12: AppendBelly
public static void AppendBelly(Client client, PacketHitList hitlist)
{
hitlist.AddPacket(client, TcpPacket.CreatePacket("recruitbelly", client.Player.GetActiveRecruit().Belly.ToString(),
client.Player.GetActiveRecruit().MaxBelly.ToString()));
}
示例13: AppendAvailableExpKitModules
public static void AppendAvailableExpKitModules(Client client, PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("kitmodules");
packet.AppendParameter(client.Player.AvailableExpKitModules.Count);
for (int i = 0; i < client.Player.AvailableExpKitModules.Count; i++) {
packet.AppendParameter((int)client.Player.AvailableExpKitModules[i].Type);
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例14: AppendAllStoryNames
public static void AppendAllStoryNames(Client client, PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("allstoriesdata");
for (int i = 0; i <= Stories.StoryManager.Stories.MaxStories; i++) {
if (!string.IsNullOrEmpty(Stories.StoryManager.Stories[i].Name)) {
packet.AppendParameters(Stories.StoryManager.Stories[i].Name);
} else {
packet.AppendParameters("");
}
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}
示例15: AppendAllSpells
public static void AppendAllSpells(Client client, PacketHitList hitlist)
{
TcpPacket packet = new TcpPacket("allspellsdata");
for (int i = 1; i <= Moves.MoveManager.Moves.MaxMoves; i++) {
packet.AppendParameters(
i.ToString(),
Moves.MoveManager.Moves[i].Name.Trim(),
((int)Moves.MoveManager.Moves[i].RangeType).ToString(),
Moves.MoveManager.Moves[i].Range.ToString(),
((int)Moves.MoveManager.Moves[i].TargetType).ToString(),
Moves.MoveManager.Moves[i].HitTime.ToString(),
Moves.MoveManager.Moves[i].HitFreeze.ToIntString());
}
packet.FinalizePacket();
hitlist.AddPacket(client, packet);
}