本文整理汇总了C#中Core.Packet类的典型用法代码示例。如果您正苦于以下问题:C# Packet类的具体用法?C# Packet怎么用?C# Packet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Packet类属于Core命名空间,在下文中一共展示了Packet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Game_RequestPacketSecureSafeListedRecieved
private void Game_RequestPacketSecureSafeListedRecieved(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例2: DispatchProconPluginListLoadedRequest
private void DispatchProconPluginListLoadedRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanIssueLimitedProconPluginCommands == true) {
if (packet.Words.Count == 1) {
List<string> lstLoadedPlugins = this.GetListLoadedPlugins();
lstLoadedPlugins.Insert(0, PRoConLayerClient.RESPONSE_OK);
sender.SendResponse(packet, lstLoadedPlugins);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例3: DispatchProconPluginEnableRequest
private void DispatchProconPluginEnableRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanIssueLimitedProconPluginCommands == true) {
bool blEnabled = false;
if (packet.Words.Count >= 3 && bool.TryParse(packet.Words[2], out blEnabled) == true) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_OK);
if (blEnabled == true) {
this.m_prcClient.PluginsManager.EnablePlugin(packet.Words[1]);
}
else {
this.m_prcClient.PluginsManager.DisablePlugin(packet.Words[1]);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例4: DispatchProconBattlemapModifyZoneTagsRequest
private void DispatchProconBattlemapModifyZoneTagsRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanEditMapZones == true) {
if (packet.Words.Count >= 3) {
if (this.m_prcClient.MapGeometry.MapZones.Contains(packet.Words[1]) == true) {
this.m_prcClient.MapGeometry.MapZones[packet.Words[1]].Tags.FromString(packet.Words[2]);
}
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_OK);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例5: DispatchProconBattlemapListZonesRequest
private void DispatchProconBattlemapListZonesRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
List<string> listPacket = new List<string>() { PRoConLayerClient.RESPONSE_OK };
listPacket.Add(this.m_prcClient.MapGeometry.MapZones.Count.ToString());
foreach (MapZoneDrawing zone in this.m_prcClient.MapGeometry.MapZones) {
listPacket.Add(zone.UID);
listPacket.Add(zone.LevelFileName);
listPacket.Add(zone.Tags.ToString());
listPacket.Add(zone.ZonePolygon.Length.ToString());
listPacket.AddRange(Point3D.ToStringList(zone.ZonePolygon));
}
sender.SendResponse(packet, listPacket);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例6: DispatchProconAccountListLoggedInRequest
private void DispatchProconAccountListLoggedInRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.m_sprvPrivileges.CanIssueLimitedProconCommands == true) {
List<string> lstLoggedInAccounts = this.m_prcClient.Layer.GetLoggedInAccounts((packet.Words.Count >= 2 && String.Compare(packet.Words[1], "uids") == 0));
//List<string> lstLoggedInAccounts = this.m_prcClient.Layer.GetLoggedInAccounts();
lstLoggedInAccounts.Insert(0, PRoConLayerClient.RESPONSE_OK);
sender.SendResponse(packet, lstLoggedInAccounts);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
示例7: DispatchProconAccountSetPasswordRequest
private void DispatchProconAccountSetPasswordRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanIssueLimitedProconCommands == true) {
if (packet.Words.Count >= 3 && packet.Words[2].Length > 0) {
if (this.m_praApplication.AccountsList.Contains(packet.Words[1]) == true) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_OK);
this.m_praApplication.AccountsList[packet.Words[1]].Password = packet.Words[2];
}
else {
sender.SendResponse(packet, "AccountDoesNotExists");
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例8: OnServerForwardedResponse
public void OnServerForwardedResponse(Packet cpPacket) {
if (this.Game != null) {
if (this.m_ui32ServerInfoSequenceNumber == cpPacket.SequenceNumber && cpPacket.Words.Count >= 2) {
cpPacket.Words[1] = this.m_prcClient.Layer.LayerNameFormat.Replace("%servername%", cpPacket.Words[1]);
}
this.Game.SendResponse(cpPacket, cpPacket.Words);
}
/*
if (this.m_connection != null) {
if (this.m_ui32ServerInfoSequenceNumber == cpPacket.SequenceNumber && cpPacket.Words.Count >= 2) {
cpPacket.Words[1] = this.m_prcClient.Layer.LayerNameFormat.Replace("%servername%", cpPacket.Words[1]);
}
this.m_connection.SendAsync(cpPacket);
}
*/
}
示例9: m_prcClient_PassLayerEvent
private void m_prcClient_PassLayerEvent(PRoConClient sender, Packet packet) {
if (this.Game != null && this.IsLoggedIn == true && this.m_blEventsEnabled == true) {
this.Game.SendPacket(packet);
}
/*
if (this.m_connection != null && this.m_blEventsEnabled == true) {
this.m_connection.SendAsync(packet);
}*/
}
示例10: Game_RequestPacketAlterTextMonderationListRecieved
private void Game_RequestPacketAlterTextMonderationListRecieved(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanEditTextChatModerationList == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例11: Game_RequestPacketVarsRecieved
private void Game_RequestPacketVarsRecieved(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanAlterServerSettings == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例12: Game_RequestBanListAddRecieved
private void Game_RequestBanListAddRecieved(FrostbiteLayerClient sender, Packet packet, CBanInfo newBan) {
if (this.IsLoggedIn == true) {
if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent && this.m_sprvPrivileges.CanPermanentlyBanPlayers == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round && this.m_sprvPrivileges.CanTemporaryBanPlayers == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.m_sprvPrivileges.CanPermanentlyBanPlayers == true) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.m_sprvPrivileges.CanTemporaryBanPlayers == true) {
if (newBan.BanLength.Seconds <= this.m_prcClient.Variables.GetVariable<int>("TEMP_BAN_CEILING", 3600)) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例13: Game_RequestPacketPunkbusterRecieved
private void Game_RequestPacketPunkbusterRecieved(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (packet.Words.Count >= 2) {
bool blCommandProcessed = false;
if (this.m_sprvPrivileges.CannotIssuePunkbusterCommands == true) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
else {
Match mtcMatch = Regex.Match(packet.Words[1], "^(?=(?<pb_sv_command>pb_sv_plist))|(?=(?<pb_sv_command>pb_sv_ban))|(?=(?<pb_sv_command>pb_sv_banguid))|(?=(?<pb_sv_command>pb_sv_banlist))|(?=(?<pb_sv_command>pb_sv_getss))|(?=(?<pb_sv_command>pb_sv_kick)[ ]+?.*?[ ]+?(?<pb_sv_kick_time>[0-9]+)[ ]+)|(?=(?<pb_sv_command>pb_sv_unban))|(?=(?<pb_sv_command>pb_sv_unbanguid))|(?=(?<pb_sv_command>pb_sv_reban))", RegexOptions.IgnoreCase);
// IF they tried to issue a pb_sv_command that isn't on the safe list AND they don't have full access.
if (mtcMatch.Success == false && this.m_sprvPrivileges.CanIssueAllPunkbusterCommands == false) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
else {
if (this.m_sprvPrivileges.CanPermanentlyBanPlayers == false && (String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_ban", true) == 0 || String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_banguid", true) == 0 || String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_reban", true) == 0)) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
else if (this.m_sprvPrivileges.CanEditBanList == false && (String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_unban", true) == 0 || String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_unbanguid", true) == 0)) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
else if (String.Compare(mtcMatch.Groups["pb_sv_command"].Value, "pb_sv_kick", true) == 0) {
int iBanLength = 0;
// NOTE* Punkbuster uses minutes not seconds.
if (int.TryParse(mtcMatch.Groups["pb_sv_kick_time"].Value, out iBanLength) == true) {
// If they cannot punish players at all..
if (this.m_sprvPrivileges.CannotPunishPlayers == true) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
// If they can temporary ban but not permanently ban BUT the banlength is over an hour (default)
else if (this.m_sprvPrivileges.CanTemporaryBanPlayers == true && this.m_sprvPrivileges.CanPermanentlyBanPlayers == false && iBanLength > (this.m_prcClient.Variables.GetVariable<int>("TEMP_BAN_CEILING", 3600) / 60)) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
// If they can kick but not temp or perm ban players AND the banlength is over 0 (no ban time)
else if (this.m_sprvPrivileges.CanKickPlayers == true && this.m_sprvPrivileges.CanTemporaryBanPlayers == false && this.m_sprvPrivileges.CanPermanentlyBanPlayers == false && iBanLength > 0) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
blCommandProcessed = true;
}
// ELSE they have punkbuster access and full ban privs.. issue the command.
}
else { // Would rather stop it here than pass it on
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
blCommandProcessed = true;
}
}
// ELSE they have permission to issue this command (full or partial)
}
}
// Was not denied above, send it on to the game server.
if (blCommandProcessed == false) {
this.m_prcClient.SendProconLayerPacket(this, packet);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INVALID_ARGUMENTS);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}
示例14: Game_RequestPacketUnsecureSafeListedRecieved
private void Game_RequestPacketUnsecureSafeListedRecieved(FrostbiteLayerClient sender, Packet packet) {
if (packet.Words.Count >= 1 && String.Compare(packet.Words[0], "serverInfo", true) == 0) {
this.m_ui32ServerInfoSequenceNumber = packet.SequenceNumber;
}
this.m_prcClient.SendProconLayerPacket(this, packet);
}
示例15: DispatchProconExecRequest
private void DispatchProconExecRequest(FrostbiteLayerClient sender, Packet packet) {
if (this.IsLoggedIn == true) {
if (this.m_sprvPrivileges.CanIssueAllProconCommands == true) {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_OK);
packet.Words.RemoveAt(0);
this.m_praApplication.ExecutePRoConCommand(this.m_prcClient, packet.Words, 0);
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
}
}
else {
sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
}
}