コード例 #1
0
ファイル: LocalGamer.cs プロジェクト: BeauPrime/Networking
        internal void InitializeSystemPackets()
        {
            systemActions = new PacketActions();
            systemActions.isSystem = true;

            systemActions[PacketActions.PacketTypeGamerFlags] = ReadGamerFlags;
            systemActions[PacketActions.PacketTypeNetworkDiagnostics] = ReadNetworksDiagnosticsData;
            systemActions[PacketActions.PacketTypeTimeSync] = ReadTimeSync;
            systemActions[PacketActions.PacketTypeSetWinners] = ReadWinnerData;
            systemActions[PacketActions.PacketTypeSetScore] = ReadScore;
            systemActions[PacketActions.PacketTypeSetProperties] = ReadProperties;

            systemWriter = new PacketWriter();

            secureBuffer = new PacketWriter();
            fastBuffer = new PacketWriter();
            reliableBuffer = new PacketWriter();
            superfastBuffer = new PacketWriter();
        }
コード例 #2
0
ファイル: LocalGamer.cs プロジェクト: BeauPrime/Networking
 /// <summary>
 /// Removes a secondary packet action binding.
 /// </summary>
 /// <param name="action">The binding to remove.</param>
 public void RemoveActions(PacketActions action)
 {
     #if DEBUG
     if (!additionalActions.Contains(action) || action == null || action.ParentGamer != this)
         throw new Exception("Cannot remove this action");
     #endif
     action.ParentGamer = null;
     additionalActions.Remove(action);
 }
コード例 #3
0
ファイル: LocalGamer.cs プロジェクト: BeauPrime/Networking
        internal override void Clear()
        {
            base.Clear();

            if ( Actions != null )
                Actions.ClearActions();
            Actions = null;

            ClearActions();
            additionalActions = null;

            systemActions = null;

            secureBuffer.Dispose();
            secureBuffer = null;

            Writer.Dispose();
            Writer = null;

            OnUpdate = null;

            LocalNetworkGamer = null;
            SignedInGamer = null;
        }
コード例 #4
0
ファイル: LocalGamer.cs プロジェクト: BeauPrime/Networking
 /// <summary>
 /// Adds a secondary packet action binding.
 /// </summary>
 /// <param name="action">The binding to add.</param>
 public void AddActions(PacketActions action)
 {
     #if DEBUG
     if (additionalActions.Contains(action) || action == null || action.ParentGamer != null)
         throw new Exception("Cannot add this action");
     #endif
     action.ParentGamer = this;
     additionalActions.Add(action);
 }