本文整理汇总了C#中BaseClient.SendPacket方法的典型用法代码示例。如果您正苦于以下问题:C# BaseClient.SendPacket方法的具体用法?C# BaseClient.SendPacket怎么用?C# BaseClient.SendPacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseClient
的用法示例。
在下文中一共展示了BaseClient.SendPacket方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CL_CHECK
static public void CL_CHECK(BaseClient client, PacketIn packet)
{
Client cclient = client as Client;
uint Version = packet.GetUint32();
Log.Debug("CL_CHECK", "Launcher Version : " + Version);
PacketOut Out = new PacketOut((byte)Opcodes.LCR_CHECK);
if (Version != Program.Version)
{
Out.WriteByte((byte)CheckResult.LAUNCHER_VERSION); // Version incorrect + message
Out.WriteString(Program.Message);
client.SendPacket(Out);
cclient.Disconnect();
return;
}
byte File = packet.GetUint8();
UInt64 Len = 0;
if (File >= 1)
Len = packet.GetUint64();
if ((long)Len != Program.Info.Length)
{
Out.WriteByte((byte)CheckResult.LAUNCHER_FILE);
Out.WriteString(Program.StrInfo);
}
else
Out.WriteByte((byte)CheckResult.LAUNCHER_OK);
cclient.SendPacket(Out);
}
示例2: F_DUMP_ARENAS_LARGE
static public void F_DUMP_ARENAS_LARGE(BaseClient client, PacketIn packet)
{
GameClient cclient = client as GameClient;
if (!cclient.HasAccount())
{
cclient.Disconnect();
return;
}
if (Program.Rm.OnlinePlayers >= Program.Rm.MaxPlayers)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_LOGINQUEUE);
client.SendPacket(Out);
return;
}
byte CharacterSlot = packet.GetUint8();
Character Char = CharMgr.GetAccountChar(cclient._Account.AccountId).GetCharacterBySlot(CharacterSlot);
if (Char == null)
{
Log.Error("F_DUMP_ARENAS_LARGE", "Can not find character on slot : " + CharacterSlot);
cclient.Disconnect();
return;
}
{
if (cclient.Plr == null)
cclient.Plr = Player.CreatePlayer(cclient, Char);
PacketOut Out = new PacketOut((byte)Opcodes.F_WORLD_ENTER);
Out.WriteUInt16(0x0608); // TODO
Out.Fill(0, 20);
Out.WriteString("38699", 5);
Out.WriteString("38700", 5);
Out.WriteString("0.0.0.0", 20);
cclient.SendPacket(Out);
}
}