當前位置: 首頁>>代碼示例>>C#>>正文


C# Remote.Packet類代碼示例

本文整理匯總了C#中PRoCon.Core.Remote.Packet的典型用法代碼示例。如果您正苦於以下問題:C# Packet類的具體用法?C# Packet怎麽用?C# Packet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Packet類屬於PRoCon.Core.Remote命名空間,在下文中一共展示了Packet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DispatchPlayerOnSpawnRequest

 protected override void DispatchPlayerOnSpawnRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 9) {
         if (this.PlayerSpawned != null) {
             FrostbiteConnection.RaiseEvent(this.PlayerSpawned.GetInvocationList(), this, cpRequestPacket.Words[1], cpRequestPacket.Words[2], cpRequestPacket.Words.GetRange(3, 3), cpRequestPacket.Words.GetRange(6, 3)); // new Inventory(cpRequestPacket.Words[3], cpRequestPacket.Words[4], cpRequestPacket.Words[5], cpRequestPacket.Words[6], cpRequestPacket.Words[7], cpRequestPacket.Words[8]));
         }
     }
 }
開發者ID:ratdart,項目名稱:Procon-1,代碼行數:7,代碼來源:BFClient.cs

示例2: DispatchVarsRoundStartReadyPlayersNeeded

        protected virtual void DispatchVarsRoundStartReadyPlayersNeeded(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 1) {
                var handler = this.RoundStartReadyPlayersNeeded;

                if (handler != null) {
                    if (cpRecievedPacket.Words.Count == 2) {
                        handler(this, Convert.ToInt32(cpRecievedPacket.Words[1]));
                    }
                    else if (cpRequestPacket.Words.Count >= 2) {
                        handler(this, Convert.ToInt32(cpRequestPacket.Words[1]));
                    }
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:14,代碼來源:BFHLClient.cs

示例3: SendAsync

        public void SendAsync(Packet cpPacket) {
            try {
                byte[] a_bBytePacket = cpPacket.EncodePacket();

                this.m_tcpStream.BeginWrite(a_bBytePacket, 0, a_bBytePacket.Length, this.SendAsyncCallback, cpPacket);

            }
            catch (SocketException) {
                // TO DO: Error reporting, possibly in a log file.
                this.Shutdown();
            }
            catch (Exception) {
                this.Shutdown();
            }
        }
開發者ID:ratdart,項目名稱:Procon-1,代碼行數:15,代碼來源:FrostbiteLayerConnection.cs

示例4: DispatchRequestPacket

 // Events
 public virtual void DispatchRequestPacket(FrostbiteConnection sender, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 1) {
         if (RequestDelegates.ContainsKey(cpRequestPacket.Words[0]) == true) {
             RequestDelegates[cpRequestPacket.Words[0]](sender, cpRequestPacket);
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:8,代碼來源:FrostbiteClient.cs

示例5: DispatchServerOnRoundOverTeamScoresRequest

 protected virtual void DispatchServerOnRoundOverTeamScoresRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 2) {
         cpRequestPacket.Words.RemoveAt(0);
         if (RoundOverTeamScores != null) {
             this.RoundOverTeamScores(this, TeamScore.GetTeamScores(cpRequestPacket.Words));
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:8,代碼來源:FrostbiteClient.cs

示例6: DispatchServerOnRoundOverRequest

        protected virtual void DispatchServerOnRoundOverRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 2) {
                int iTeamID = 0;

                if (int.TryParse(cpRequestPacket.Words[1], out iTeamID) == true) {
                    if (RoundOver != null) {
                        this.RoundOver(this, iTeamID);
                    }
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:11,代碼來源:FrostbiteClient.cs

示例7: DispatchServerOnLevelLoadedRequest

        protected virtual void DispatchServerOnLevelLoadedRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 5) {
                if (LevelLoaded != null) {
                    int iRoundsPlayed = 0, iRoundsTotal = 0;

                    if (int.TryParse(cpRequestPacket.Words[3], out iRoundsPlayed) == true && int.TryParse(cpRequestPacket.Words[4], out iRoundsTotal) == true) {
                        this.LevelLoaded(this, cpRequestPacket.Words[1], cpRequestPacket.Words[2], iRoundsPlayed, iRoundsTotal);
                    }
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:11,代碼來源:FrostbiteClient.cs

示例8: DispatchPlayerOnSquadChangeRequest

        protected virtual void DispatchPlayerOnSquadChangeRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 4) {
                int iTeamID = 0, iSquadID = 0;

                if (int.TryParse(cpRequestPacket.Words[2], out iTeamID) == true && int.TryParse(cpRequestPacket.Words[3], out iSquadID) == true) {
                    if (PlayerChangedSquad != null) {
                        this.PlayerChangedSquad(this, cpRequestPacket.Words[1], iTeamID, iSquadID);
                    }
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:11,代碼來源:FrostbiteClient.cs

示例9: DispatchPlayerOnKickedRequest

 protected virtual void DispatchPlayerOnKickedRequest(FrostbiteConnection sender, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 3) {
         if (PlayerKicked != null) {
             this.PlayerKicked(this, cpRequestPacket.Words[1], cpRequestPacket.Words[2]);
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:7,代碼來源:FrostbiteClient.cs

示例10: DispatchLevelVarsEvaluateResponse

        protected virtual void DispatchLevelVarsEvaluateResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) {
                var request = new LevelVariable(new LevelVariableContext(String.Empty, String.Empty), cpRequestPacket.Words[1], cpRecievedPacket.Words[1]);

                if (LevelVariablesEvaluate != null) {
                    this.LevelVariablesEvaluate(this, request, null);
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:9,代碼來源:FrostbiteClient.cs

示例11: DispatchLevelVarsGetResponse

        protected virtual void DispatchLevelVarsGetResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) {
                LevelVariable request = LevelVariable.ExtractContextVariable(false, cpRequestPacket.Words.GetRange(1, cpRequestPacket.Words.Count - 1));

                request.RawValue = cpRecievedPacket.Words[1];

                if (LevelVariablesGet != null) {
                    this.LevelVariablesGet(this, request, null);
                }
            }
        }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:11,代碼來源:FrostbiteClient.cs

示例12: DispatchVarsTextChatModerationModeResponse

 protected virtual void DispatchVarsTextChatModerationModeResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 1) {
         if (TextChatModerationMode != null) {
             if (cpRecievedPacket.Words.Count == 2) {
                 this.TextChatModerationMode(this, TextChatModerationEntry.GetServerModerationLevelType(cpRecievedPacket.Words[1]));
             }
             else if (cpRequestPacket.Words.Count >= 2) {
                 this.TextChatModerationMode(this, TextChatModerationEntry.GetServerModerationLevelType(cpRequestPacket.Words[1]));
             }
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:12,代碼來源:FrostbiteClient.cs

示例13: DispatchVarsTextChatSpamCoolDownTimeResponse

 protected virtual void DispatchVarsTextChatSpamCoolDownTimeResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 1) {
         if (TextChatSpamCoolDownTime != null) {
             if (cpRecievedPacket.Words.Count == 2) {
                 this.TextChatSpamCoolDownTime(this, Convert.ToInt32(cpRecievedPacket.Words[1]));
             }
             else if (cpRequestPacket.Words.Count >= 2) {
                 this.TextChatSpamCoolDownTime(this, Convert.ToInt32(cpRequestPacket.Words[1]));
             }
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:12,代碼來源:FrostbiteClient.cs

示例14: DispatchVarsServerNameResponse

 protected virtual void DispatchVarsServerNameResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 1) {
         if (ServerName != null) {
             if (cpRecievedPacket.Words.Count == 2) {
                 this.ServerName(this, cpRecievedPacket.Words[1]);
             }
             else if (cpRequestPacket.Words.Count >= 2) {
                 this.ServerName(this, cpRequestPacket.Words[1]);
             }
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:12,代碼來源:FrostbiteClient.cs

示例15: DispatchVarsProfanityFilterResponse

 protected virtual void DispatchVarsProfanityFilterResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
     if (cpRequestPacket.Words.Count >= 1) {
         if (ProfanityFilter != null) {
             if (cpRecievedPacket.Words.Count == 2) {
                 this.ProfanityFilter(this, Convert.ToBoolean(cpRecievedPacket.Words[1]));
             }
             else if (cpRequestPacket.Words.Count >= 2) {
                 this.ProfanityFilter(this, Convert.ToBoolean(cpRequestPacket.Words[1]));
             }
         }
     }
 }
開發者ID:markrlomas,項目名稱:Procon-1,代碼行數:12,代碼來源:FrostbiteClient.cs


注:本文中的PRoCon.Core.Remote.Packet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。