本文整理汇总了C#中FrameWork.PacketOut.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# PacketOut.WriteString方法的具体用法?C# PacketOut.WriteString怎么用?C# PacketOut.WriteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameWork.PacketOut
的用法示例。
在下文中一共展示了PacketOut.WriteString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: CL_START
static public void CL_START(BaseClient client, PacketIn packet)
{
Client cclient = client as Client;
string Username = packet.GetString();
UInt32 Len = packet.GetUint32();
byte[] Password = packet.Read((int)Len);
bool result = Program.AcctMgr.CheckAccount(Username, Password);
Log.Debug("CL_START", "Lancement du client : " + Username + " " + result);
PacketOut Out = new PacketOut((byte)Opcodes.LCR_START);
if (result == true)
{
Out.WriteByte(0);
Out.WriteString(Program.AcctMgr.GenerateToken(Username));
}
else
Out.WriteByte(1);
cclient.SendPacket(Out);
}
示例3: CL_INFO
public static void CL_INFO(BaseClient client, PacketIn packet)
{
Client cclient = client as Client;
if (cclient.LastInfoRequest == 0 || cclient.LastInfoRequest <= TCPServer.GetTimeStampMS()+10000)
{
cclient.LastInfoRequest = TCPServer.GetTimeStampMS();
List<Realm> Rms = Program.AcctMgr.GetRealms();
PacketOut Out = new PacketOut((byte)Opcodes.LCR_INFO);
Out.WriteByte((byte)Rms.Count);
foreach (Realm Rm in Rms)
{
Out.WriteByte(Convert.ToByte(Rm.Info != null));
Out.WriteString(Rm.Name);
Out.WriteUInt32(Rm.OnlinePlayers);
Out.WriteUInt32(Rm.OrderCount);
Out.WriteUInt32(Rm.DestructionCount);
}
cclient.SendTCP(Out);
}
}
示例4: 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);
}
}
示例5: F_DELETE_NAME
static public void F_DELETE_NAME(BaseClient client, PacketIn packet)
{
GameClient cclient = client as GameClient;
string CharName = packet.GetString(30);
string UserName = packet.GetString(20);
byte Bad = 0;
if (CharName.Length <= 0 || CharMgr.NameIsUsed(CharName))
Bad = 1;
Log.Debug("F_DELETE_NAME", "Bad=" + Bad + ",Name=" + CharName);
PacketOut Out = new PacketOut((byte)Opcodes.F_CHECK_NAME);
Out.WriteString(CharName, 30);
Out.WriteString(UserName, 20);
Out.WriteByte(Bad);
Out.WriteByte(0);
Out.WriteByte(0);
Out.WriteByte(0);
cclient.SendPacket(Out);
}