本文整理汇总了C#中Game.Base.Packets.GSPacketIn.ClearContext方法的典型用法代码示例。如果您正苦于以下问题:C# GSPacketIn.ClearContext方法的具体用法?C# GSPacketIn.ClearContext怎么用?C# GSPacketIn.ClearContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game.Base.Packets.GSPacketIn
的用法示例。
在下文中一共展示了GSPacketIn.ClearContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
packet.ClearContext();
packet.WriteDateTime(DateTime.Now);
client.Out.SendTCP(packet);
return 0;
}
示例2: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
//bool result = false;
if (string.IsNullOrEmpty(client.Player.PlayerCharacter.CheckCode))
return 1;
//int check = packet.ReadInt();
string check = packet.ReadString();
if (client.Player.PlayerCharacter.CheckCode.ToLower() == check.ToLower())
{
client.Player.PlayerCharacter.CheckCount = 0;
//int rewardItemID = GameServer.Instance.Configuration.CheckRewardItem;
//ItemTemplateInfo rewardItem = ItemMgr.GetSingleGoods(rewardItemID);
//ItemInfo item = ItemInfo.CreateFromTemplate(rewardItem, 1, (int)Game.Server.Statics.ItemAddType.CheckCode);
//if (item != null)
//{
// item.IsBinds = true;
// if (client.Player.AddItem(item, Game.Server.Statics.ItemAddType.CheckCode) != -1)
// {
// client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg1", item.Template.Name));
// }
// else
// {
// client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg2"));
// }
//}
int GP = LevelMgr.GetGP(client.Player.PlayerCharacter.Grade);
client.Player.AddGP(LevelMgr.IncreaseGP(client.Player.PlayerCharacter.Grade, client.Player.PlayerCharacter.GP));
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("CheckCodeHandler.Msg1", client.Player.PlayerCharacter.Grade * 12));
//result = true;
packet.ClearContext();
packet.WriteByte(1);
packet.WriteBoolean(false);
client.Out.SendTCP(packet);
}
// else if (client.Player.PlayerCharacter.CheckError < 1 && client.Player.PlayerCharacter.CheckCount < 20000)
else if (client.Player.PlayerCharacter.CheckError < 9)
{
client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg3"));
client.Player.PlayerCharacter.CheckError++;
client.Out.SendCheckCode();
}
else
{
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("CheckCodeHandler.Msg3"));
client.Disconnect();
}
return 0;
}
示例3: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
packet = packet.Clone();
packet.ClearContext();
int num = packet.ReadInt();
int num2 = packet.ReadInt();
int num3 = packet.ReadInt();
int num4 = packet.ReadInt();
int num5 = packet.ReadInt();
int num6 = packet.ReadInt();
int num7 = packet.ReadInt();
client.Player.CurrentHotSpringRoom = new HotSpringRoom(new HotSpringRoomInfo(), new TankHotSpringLogicProcessor());
client.Player.CurrentHotSpringRoom.ProcessData(client.Player, packet);
return 0;
}
示例4: HandleSysNotice
private void HandleSysNotice(GSPacketIn pkg)
{
BaseGame game = GameMgr.FindGame(pkg.ClientID);
if (game != null)
{
Player player = game.FindPlayer(pkg.Parameter1);
GSPacketIn pkg1 = new GSPacketIn((byte)eFightPackageType.SYS_NOTICE);
// int type = pkg.ReadInt();
pkg1.WriteInt(3);
pkg1.WriteString(LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg6", player.PlayerDetail.PlayerCharacter.Grade * 12, 15));
player.PlayerDetail.SendTCP(pkg1);
pkg1.ClearContext();
pkg1.WriteInt(3);
pkg1.WriteString(LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg7", player.PlayerDetail.PlayerCharacter.NickName, player.PlayerDetail.PlayerCharacter.Grade * 12, 15));
game.SendToAll(pkg1, player.PlayerDetail);
}
}