示例#1
0
        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
 /// <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
        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
 /// <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);
 }