本文整理汇总了C#中Entities.SendToScreen方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.SendToScreen方法的具体用法?C# Entities.SendToScreen怎么用?C# Entities.SendToScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.SendToScreen方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
/// <summary>
/// Handling the ChangeDirection action from GeneralDataPacket.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="General">The GeneralDataPacket.</param>
public static void Handle(Entities.GameClient client, GeneralDataPacket General)
{
client.Direction = (byte)General.Direction;
client.AttackPacket = null;
client.SendToScreen(General, false);
}
示例2: Handle
/// <summary>
/// Handling the Marry action of the interaction packet.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="interact">The interaction packet.</param>
public static void Handle(Entities.GameClient client, InteractionPacket interact)
{
//uint marryUID = interact.TargetUID;
//Entities.GameClient marrytarget;
Maps.IMapObject obj;
if (client.Map.MapObjects.TryGetValue(interact.TargetUID, out obj))
{
Entities.GameClient spouse = obj as Entities.GameClient;
if (client.SpouseDatabaseUID > 0)
{
using (var fmsg = Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.MARRIAGE_SELF_SPOUSE))
client.Send(fmsg);
return;
}
if (spouse.SpouseDatabaseUID > 0)
{
using (var fmsg = Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.MARRIAGE_TARGET_SPOUSE))
client.Send(fmsg);
return;
}
client.SpouseDatabaseUID = spouse.DatabaseUID;
spouse.SpouseDatabaseUID = client.DatabaseUID;
//client.CharDB.AddSpouse(client.DatabaseUID, client.SpouseDatabaseUID);
//spouse.CharDB.AddSpouse(spouse.DatabaseUID, spouse.SpouseDatabaseUID);
Database.CharacterDatabase.AddSpouse(client, spouse);
using (var mate = new Packets.StringPacket(new StringPacker(spouse.Name)))
{
mate.Data = client.EntityUID;
mate.Action = Enums.StringAction.Mate;
client.Send(mate);
}
using (var mate = new Packets.StringPacket(new StringPacker(client.Name)))
{
mate.Data = spouse.EntityUID;
mate.Action = Enums.StringAction.Mate;
spouse.Send(mate);
}
using (var fireworks = new Packets.StringPacket(new StringPacker("firework-2love")))
{
fireworks.Action = Enums.StringAction.MapEffect;
fireworks.PositionX = client.X;
fireworks.PositionY = client.Y;
client.SendToScreen(fireworks, true);
fireworks.PositionX = spouse.X;
fireworks.PositionY = spouse.Y;
spouse.SendToScreen(fireworks, true);
}
using (var msg =Packets.Message.MessageCore.CreateSystem("ALL",
string.Format(Core.MessageConst.MARRIAGE_CONGRATZ, client.Name, spouse.Name)))
{
Packets.Message.MessageCore.SendGlobalMessage(msg);
}
}
}
示例3: Handle
/// <summary>
/// Handling the ChangeAction action from GeneralDataPacket.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="General">The GeneralDataPacket.</param>
public static void Handle(Entities.GameClient client, GeneralDataPacket General)
{
Enums.ActionType actiontype = (Enums.ActionType)General.Data1Low;
client.AttackPacket = null;
if (client.Action != Enums.ActionType.Sit && client.Action != Enums.ActionType.Lie)
{
if (actiontype == Enums.ActionType.Sit || actiontype == Enums.ActionType.Lie)
{
client.SitTime = DateTime.Now;
client.UpdateStamina(true);
}
}
client.Action = actiontype;
client.SendToScreen(General, false);
}
示例4: Handle
/// <summary>
/// Handling the Jump action from GeneralDataPacket.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="General">The GeneralDataPacket.</param>
public static void Handle(Entities.GameClient client, GeneralDataPacket General)
{
if (!client.Alive)
return;
if (client.ContainsFlag1(Enums.Effect1.IceBlock))
return;
if (client.Booth != null)
{
client.Booth.CancelBooth();
client.Pullback();
}
client.Action = Enums.ActionType.None;
client.AttackPacket = null;
ushort JumpX = General.Data1Low;
ushort JumpY = General.Data1High;
if (Core.Screen.GetDistance(client.X, client.Y, JumpX, JumpY) > 28)
{
client.Pullback();
return;
}
if (!client.Map.ValidCoord(JumpX, JumpY))
{
client.Pullback();
return;
}
/*DateTime time = new ProjectX_V3_Lib.Time.SystemTime(General.Timestamp);
if (client.LastMovement > time)
{
client.Pullback(); // speedhack
return;
}*/
if (!(DateTime.Now >= client.LastMovement.AddMilliseconds(400)) && client.LastMoveJump)
{
client.Pullback(); // speedhack
return;
}
if (client.Battle != null)
{
if (!client.Battle.EnterArea(client))
{
client.Pullback();
return;
}
else if (!client.Battle.LeaveArea(client))
{
client.Pullback();
return;
}
}
if (Calculations.BasicCalculations.ChanceSuccess(50))
client.Stamina += 7;
client.LastMoveJump = true;
client.LastMovement = DateTime.Now;
client.LastX = client.X;
client.LastY = client.Y;
client.X = JumpX;
client.Y = JumpY;
client.SendToScreen(General, true);
Data.AdvancedSkill.SkillInArea(client, client.X, client.Y);
}
示例5: Handle
/// <summary>
/// Handles the message packet.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="packet">The packet.</param>
public static void Handle(Entities.GameClient client, DataPacket packet)
{
using (var message = new MessagePacket(packet))
{
if (message.Message.StartsWith("/") && !message.Message.StartsWith("//") || message.Message.StartsWith("@") && !message.Message.StartsWith("@@"))
{
Packets.Message.Commands.Handle(client, message.Message, message.Message.Split(' '));
}
else
{
if (message.ChatType != Enums.ChatType.Team && !client.Alive &&
message.ChatType != Enums.ChatType.Ghost)
return;
if (message.From != client.Name)
{
client.NetworkClient.Disconnect("INVALID_CHAT_NAME");
return;
}
switch (message.ChatType)
{
#region Whisper
case Enums.ChatType.Whisper:
{
if (message.To == client.Name)
return;
Entities.GameClient toclient;
if (Core.Kernel.Clients.TrySelect(message.To, out toclient))
{
message.FromMesh = client.Mesh;
message.ToMesh = toclient.Mesh;
toclient.Send(message);
}
else
{
if (Database.CharacterDatabase.CharacterExists(message.To))//(System.IO.File.Exists(Database.ServerDatabase.DatabaseLocation + "\\UsedNames\\" + message.To + ".nm"))
{
using (var fmsg = Packets.Message.MessageCore.CreateSystem(
client.Name, string.Format(Core.MessageConst.PLAYER_OFFLINE_WHISPER, message.To)))
client.Send(fmsg);
ProjectX_V3_Lib.IO.IniFile whisper = new ProjectX_V3_Lib.IO.IniFile(
Database.ServerDatabase.DatabaseLocation + "\\MessageQuery\\" + message.To + ".ini",
"Whisper");
int count = whisper.ReadInt32("Count", 0);
count++;
whisper.Write<int>("Count", count);
whisper.SetSection(count.ToString());
whisper.WriteString("From", client.Name);
whisper.WriteString("Message", message.Message);
whisper.Write<uint>("Mesh", client.Mesh);
}
else
{
using (var fmsg = Packets.Message.MessageCore.CreateSystem(
client.Name, string.Format(Core.MessageConst.PLAYER_OFFLINE_WHISPER2, message.To)))
client.Send(fmsg);
}
}
break;
}
#endregion
#region Talk + Ghost
case Enums.ChatType.Talk:
case Enums.ChatType.Ghost:
{
client.SendToScreen(message, false, message.ChatType == Enums.ChatType.Ghost);
break;
}
#endregion
#region World
case Enums.ChatType.World:
{
if (client.Level < 70)
{
using (var fmsg = Packets.Message.MessageCore.CreateSystem(
client.Name, Core.MessageConst.WORLD_CHAT_NO_PERMISSION))
client.Send(fmsg);
return;
}
int required = 60000;
if (client.Level >= 100)
required = 45000;
if (client.Level >= 110)
required = 30000;
if (client.Level >= 120)
required = 15000;
if (DateTime.Now >= client.WorldChatSend.AddMilliseconds(required))
{
client.WorldChatSend = DateTime.Now;
foreach (Entities.GameClient sclient in Core.Kernel.Clients.selectorCollection1.Values)
{
if (sclient.EntityUID != client.EntityUID)
//.........这里部分代码省略.........
示例6: SetUpdate
public static void SetUpdate(Entities.GameClient client, Enums.UpdateType type, ulong data, Enums.SynchroType synchro, ulong data2 = 0)
{
var packet = UpdatePacket.Create(client.EntityUID);
if (!packet.AddUpdate(type, data))
return;
if (synchro != Enums.SynchroType.False)
{
switch (synchro)
{
case Enums.SynchroType.True:
{
client.Send(packet);
break;
}
case Enums.SynchroType.Broadcast:
{
client.SendToScreen(packet, true);
break;
}
}
}
}
示例7: Handle
/// <summary>
/// Handles the movement packet.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="packet">The packet.</param>
public static void Handle(Entities.GameClient client, DataPacket packet)
{
if (client.ContainsFlag1(Enums.Effect1.IceBlock))
return;
client.Action = Enums.ActionType.None;
client.AttackPacket = null;
client.LastMoveJump = false;
using (var move = new MovementPacket(packet))
{
if (move.EntityUID != client.EntityUID)
return;
int NewX = 0, NewY = 0;
int NewDir = 0;
switch (move.WalkMode)
{
case Enums.WalkMode.Run:
case Enums.WalkMode.Walk:
{
NewDir = (int)move.Direction % 8;
NewX = client.X + DeltaX[NewDir];
NewY = client.Y + DeltaY[NewDir];
break;
}
case Enums.WalkMode.Mount:
{
NewDir = (int)move.Direction % 24;
NewX = client.X + DeltaMountX[NewDir];
NewY = client.Y + DeltaMountY[NewDir];
break;
}
}
if (client.Map.ValidCoord(NewX, NewY))
{
client.LastX = client.X;
client.LastY = client.LastY;
client.LastMovement = DateTime.Now;
client.X = (ushort)NewX;
client.Y = (ushort)NewY;
client.Direction = (byte)NewDir;
client.SendToScreen(move, true);
if (client.Battle != null)
{
if (!client.Battle.EnterArea(client))
{
client.X = client.LastX;
client.Y = client.LastY;
client.Pullback();
return;
}
else if (!client.Battle.LeaveArea(client))
{
client.X = client.LastX;
client.Y = client.LastY;
client.Pullback();
return;
}
}
Data.AdvancedSkill.SkillInArea(client, client.X, client.Y);
}
}
}