本文整理汇总了C#中PacketReader.ReadMuid方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadMuid方法的具体用法?C# PacketReader.ReadMuid怎么用?C# PacketReader.ReadMuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadMuid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessChat
public static void ProcessChat(Client client, PacketReader packet)
{
var uidChar = packet.ReadMuid();
var uidChan = packet.ReadMuid();
var message = packet.ReadString();
if (client.GetChannel() != null)
client.GetChannel().Chat(client, message);
}
示例2: ProcessChannelJoin
public static void ProcessChannelJoin(Client client, PacketReader packet)
{
var playerId = packet.ReadMuid();
var channelId = packet.ReadMuid();
var channel = ChannelList.Find(channelId);
if (channel != null)
{
channel.Join(client);
}
}
示例3: ProcessCreateChar
public static void ProcessCreateChar(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var index = packetReader.ReadInt32();
var name = packetReader.ReadString();
var sex = packetReader.ReadInt32();
var hair = packetReader.ReadInt32();
var face = packetReader.ReadInt32();
var costume = packetReader.ReadInt32();
var result = Results.Accepted;
if (uid != client.GetMuid() || index < 0 || index > 4 || sex < 0 || sex > 1)
{
client.Disconnect();
return;
}
if (!Globals.AcceptedString.IsMatch(name))
result = Results.CharacterEnterName;
else if (Globals.GunzDatabase.GetCharacterCount(client.ClientPlayer.PlayerAccount.AccountId) >= 4)
result = Results.CharacterNameNonExistant;
else if (Globals.GunzDatabase.CharacterExists(name))
result = Results.CharacterNameInUse;
else if (!Globals.GunzDatabase.CreateCharacter(client.ClientPlayer.PlayerAccount.AccountId, (byte)index, name, sex, hair, face, costume))
result = Results.CharacterInvalidName;
Match.ResponseCreateChar(client, result, name);
}
示例4: ProcessDeleteChar
public static void ProcessDeleteChar(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var index = packetReader.ReadInt32();
var name = packetReader.ReadString();
var result = Results.Accepted;
if (uid != client.GetMuid() || !Globals.AcceptedString.IsMatch(name) || index < 0 || index > 4)
{
client.Disconnect();
return;
}
var cid = Globals.GunzDatabase.GetCid(client.ClientPlayer.PlayerAccount.AccountId, index);
if (cid == 0)
{
result = Results.CharacterDeleteDisabled;
}
else
{
Globals.GunzDatabase.DeleteCharacter(client.ClientPlayer.PlayerAccount.AccountId, cid);
}
Match.ResponseDeleteCharacter(client, result);
}
示例5: ProcessPeerRelay
public static void ProcessPeerRelay(Client client, PacketReader packetReader)
{
if (client.GetStage() == null)
return;
var charId = packetReader.ReadMuid();
var peerId = packetReader.ReadMuid();
//Now attempt to bind them!
if (Globals.NatAgent != null)
{
AgentPackets.RelayPeer(Globals.NatAgent, new Tuple<Muid, Muid, Muid>(charId, peerId, client.GetStage().GetTraits().StageId));
Log.Write("Binding player to NAT");
}
else
{
AgentPackets.AgentError(client, 10001);
}
}
示例6: ProcessPeerReady
public static void ProcessPeerReady(Client client, PacketReader packetReader)
{
if (Globals.NatAgent == null)
return;
var charId = packetReader.ReadMuid();
var peerId = packetReader.ReadMuid();
var agentId = Globals.NatAgent.GetMuid();
var peer1 = TcpServer.GetClientFromUid(charId);
var peer2 = TcpServer.GetClientFromUid(peerId);
if (peer1 != null)
{
AgentPackets.AgentLocateToClient(peer1, agentId);
AgentPackets.ResponsePeerRelay(peer1, peerId);
}
if (peer2 != null)
{
AgentPackets.AgentLocateToClient(peer2, Globals.NatAgent.GetMuid());
AgentPackets.ResponsePeerRelay(peer2, charId);
}
}
示例7: ProcessAdminAnnounce
public static void ProcessAdminAnnounce(Client client, PacketReader packetReader)
{
var adminId = packetReader.ReadMuid();
var message = packetReader.ReadString();
if (client.ClientPlayer.PlayerAccount.Access == UGradeId.Administrator
|| client.ClientPlayer.PlayerAccount.Access == UGradeId.Developer
|| client.ClientPlayer.PlayerAccount.Access == UGradeId.EventMaster)
{
Match.Announce(client, message);
return;
}
client.Disconnect();
return;
}
示例8: ProcessGameKill
public static void ProcessGameKill(Client client, PacketReader packet)
{
if (client.GetStage() == null)
{
Log.Write("Client doesn't have a stage...?");
return;
}
var uidKiller = packet.ReadMuid();
Client killer;
lock (client.GetStage().ObjectLock)
{
killer =
client.GetStage().GetTraits().Players.Find(c => c.GetMuid() == uidKiller);
}
if (killer != null)
client.GetStage().GetTraits().Ruleset.GameKillCallback(killer, client);
else
{
Log.Write("Invalid killer");
}
}
示例9: ProcessClanInfo
public static void ProcessClanInfo(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var name = packetReader.ReadString();
ClanPackets.ClanInfo(client, name);
}
示例10: ProcessAnswerAgreement
public static void ProcessAnswerAgreement(Client client, PacketReader packetReader)
{
var request = packetReader.ReadInt32();
var masterId = packetReader.ReadMuid();
var name = packetReader.ReadString();
var answer = packetReader.ReadBoolean();
PendingClan pendingClan;
lock (Globals.PendingClans)
pendingClan = Globals.PendingClans.Find(c => c.ClanMaster.GetMuid() == masterId);
if (pendingClan == null)
return;
if (answer == false)
{
lock (Globals.PendingClans)
Globals.PendingClans.Remove(pendingClan);
return;
}
if (pendingClan.Member1.First.GetCharacter().Name == name)
{
pendingClan.Member1.Second = true;
}
if (pendingClan.Member2.First.GetCharacter().Name == name)
{
pendingClan.Member2.Second = answer;
}
if (pendingClan.Member3.First.GetCharacter().Name == name)
{
pendingClan.Member3.Second = answer;
}
if (pendingClan.Member4.First.GetCharacter().Name == name)
{
pendingClan.Member4.Second = answer;
}
if (pendingClan.Member1.Second && pendingClan.Member2.Second && pendingClan.Member3.Second && pendingClan.Member4.Second)
{
int clanId = Globals.GunzDatabase.CreateClan(pendingClan.ClanName, pendingClan.ClanMaster, pendingClan.Member1.First,
pendingClan.Member2.First, pendingClan.Member3.First,
pendingClan.Member4.First);
ClanPackets.ResponseAagreedCreateClan(pendingClan);
pendingClan.ClanMaster.GetCharacter().ClanId = clanId;
pendingClan.Member1.First.GetCharacter().ClanId = clanId;
pendingClan.Member2.First.GetCharacter().ClanId = clanId;
pendingClan.Member3.First.GetCharacter().ClanId = clanId;
pendingClan.Member4.First.GetCharacter().ClanId = clanId;
pendingClan.ClanMaster.GetCharacter().ClanName = pendingClan.ClanName;
pendingClan.Member1.First.GetCharacter().ClanName = pendingClan.ClanName;
pendingClan.Member2.First.GetCharacter().ClanName = pendingClan.ClanName;
pendingClan.Member3.First.GetCharacter().ClanName = pendingClan.ClanName;
pendingClan.Member4.First.GetCharacter().ClanName = pendingClan.ClanName;
lock (Globals.PendingClans)
Globals.PendingClans.Remove(pendingClan);
ClanPackets.SendMemberList(pendingClan.ClanMaster);
ClanPackets.SendMemberList(pendingClan.Member1.First);
ClanPackets.SendMemberList(pendingClan.Member2.First);
ClanPackets.SendMemberList(pendingClan.Member3.First);
ClanPackets.SendMemberList(pendingClan.Member4.First);
ClanPackets.UpdateClanCharInfo(pendingClan.ClanMaster);
ClanPackets.UpdateClanCharInfo(pendingClan.Member1.First);
ClanPackets.UpdateClanCharInfo(pendingClan.Member2.First);
ClanPackets.UpdateClanCharInfo(pendingClan.Member3.First);
ClanPackets.UpdateClanCharInfo(pendingClan.Member4.First);
}
}
示例11: ProcessResponseAgreement
public static void ProcessResponseAgreement(Client client, PacketReader packetReader)
{
var uidProposer = packetReader.ReadMuid();
var uidChar = packetReader.ReadMuid();
var name = packetReader.ReadString();
var proposal = packetReader.ReadInt32();
var request = packetReader.ReadInt32();
var agreement = packetReader.ReadBoolean();
PendingClanWarRequest pc = Globals.PendingClanWar.Find(p => p.ClanName == client.GetCharacter().ClanName);
if (agreement == true)
{
lock (Globals.PendingClanWar)
{
pc.Players.Find(p => p.First == client).Second = true;
}
}
lock (Globals.PendingClanWar)
{
if (pc.Players.FindAll(p => p.Second).Count == pc.Players.Count)
{
List<Client> players = new List<Client>();
foreach (var p in pc.Players)
players.Add(p.First);
players.Add(pc.Requester);
ClanPackets.SearchRival(players);
Globals.PendingClanWar.Remove(pc);
ClanWarHandler.FindMatch(players);
}
}
}
示例12: ProcessSelectChar
public static void ProcessSelectChar(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var index = packetReader.ReadInt32();
if (uid != client.GetMuid() || index < 0 || index > 4)
{
client.Disconnect();
return;
}
client.ClientFlags = PacketFlags.Character;
Globals.GunzDatabase.GetCharacter(client.ClientPlayer.PlayerAccount.AccountId, (byte)index, client.GetCharacter());
Match.ResponseSelectCharacter(client);
}
示例13: ResponseStageState
public static void ResponseStageState(Client client, PacketReader packetReader)
{
var charId = packetReader.ReadMuid();
var stageId = packetReader.ReadMuid();
var state = packetReader.ReadInt32();
if (!Enum.IsDefined(typeof(ObjectStageState), state) || client.GetStage() == null)
{
client.Disconnect();
return;
}
client.ClientPlayer.PlayerState = (ObjectStageState)state;
client.GetStage().PlayerState(client);
}
示例14: ProcessStageMap
public static void ProcessStageMap(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var map = packetReader.ReadString();
if (map.Length > 127 || client.GetStage() == null || client.GetStage().GetTraits().Master != client)
{
client.Disconnect();
return;
}
if (map != "RelayMap")
{
client.GetStage().GetTraits().RelayEnabled = false;
client.GetStage().GetTraits().Map = map;
try
{
client.GetStage().GetTraits().CurrentMap = Globals.Maps.GetMap(map);
}
catch
{
Log.Write("Unable to load map: {0}. Defaulting to Mansion", map);
client.GetStage().GetTraits().CurrentMap = Globals.Maps.GetMap("Mansion");
}
}
else
{
client.GetStage().GetTraits().RelayEnabled = true;
}
client.GetStage().Settings(client, true);
Channel.Refresh(client);
}
示例15: ProcessStageCreate
public static void ProcessStageCreate(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var name = packetReader.ReadString();
var locked = packetReader.ReadBoolean();
var password = packetReader.ReadString();
if (uid != client.GetMuid())
{
client.Disconnect();
return;
}
var traits = new StageTraits();
traits.StageId = Globals.StageCounter.GetNext();
traits.Name = name;
traits.Locked = locked;
traits.Password = password;
traits.Master = client;
client.ClientPlayer.PlayerStage = client.GetChannel().Add(traits);
client.GetStage().Join(client);
}