本文整理汇总了C#中Game.Base.Packets.GSPacketIn.ReadPacket方法的典型用法代码示例。如果您正苦于以下问题:C# GSPacketIn.ReadPacket方法的具体用法?C# GSPacketIn.ReadPacket怎么用?C# GSPacketIn.ReadPacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game.Base.Packets.GSPacketIn
的用法示例。
在下文中一共展示了GSPacketIn.ReadPacket方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleSendToPlayer
protected void HandleSendToPlayer(GSPacketIn pkg)
{
int playerId = pkg.ClientID;
try
{
GSPacketIn inner = pkg.ReadPacket();
m_server.SendToUser(playerId, inner);
}
catch (Exception ex)
{
log.Error(string.Format("pkg len:{0}", pkg.Length), ex);
log.Error(Marshal.ToHexDump("pkg content:", pkg.Buffer, 0, pkg.Length));
}
}
示例2: HandleSendToRoom
protected void HandleSendToRoom(GSPacketIn pkg)
{
int roomId = pkg.ClientID;
GSPacketIn inner = pkg.ReadPacket();
m_server.SendToRoom(roomId, inner, pkg.Parameter1, pkg.Parameter2);
}
示例3: HanleSendToGame
public void HanleSendToGame(GSPacketIn pkg)
{
BaseGame game = GameMgr.FindGame(pkg.ClientID);
if (game != null)
{
GSPacketIn inner = pkg.ReadPacket();
game.ProcessData(inner);
}
}