public static void QuickSendRequest <T>(int to_who, int ignore_who)
     where T : PacketProtocol, new()
 {
     if (Main.netMode == 1)
     {
         PacketProtocol.QuickRequestToServer <T>();
     }
     else if (Main.netMode == 2)
     {
         PacketProtocol.QuickRequestToClient <T>(to_who, ignore_who);
     }
 }
Ejemplo n.º 2
0
        public void OnEnterWorldClient(HamstarHelpersMod mymod, Player player)
        {
            if (this.HasUID)
            {
                PacketProtocol.QuickSendToServer <PlayerIdProtocol>();
            }
            PlayerDataProtocol.SyncToEveryone(this.PermaBuffsById, this.HasBuffIds, this.EquipSlotsToItemTypes);

            PacketProtocol.QuickRequestToServer <ModSettingsProtocol>();
            PacketProtocol.QuickRequestToServer <WorldDataProtocol>();

            mymod.ControlPanel.LoadModListAsync();
        }
 public static void QuickRequestFromServer <T>()
     where T : PacketProtocol, new()
 {
     PacketProtocol.QuickRequestToServer <T>( );
 }
Ejemplo n.º 4
0
 /// <summary>
 /// "Quick" method for syncing packets from everyone else to the current client with any PacketProtocolSyncClient class.
 /// Intended to be wrapped with a `public static` method.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="retries">Number of times to attempt to resend the packet if it fails. -1 for perpetual retries.</param>
 protected static void SyncToMe <T>(int retries) where T : PacketProtocolSyncClient
 {
     PacketProtocol.QuickRequestToServer <T>(retries);
 }