@@ -22,9 +22,9 @@ public class CrossplayPlugin : TerrariaPlugin
2222 public override string Name => "Crossplay" ;
2323 public override string Author => "Moneylover3246" ;
2424 public override string Description => "Enables crossplay for terraria" ;
25- public override Version Version => new Version ( "1.6 .0" ) ;
25+ public override Version Version => new Version ( "1.7 .0" ) ;
2626
27- private readonly List < int > AllowedVersions = new List < int > ( ) { 230 , 233 , 234 , 235 , 236 , 237 , 238 , 242 } ;
27+ private readonly List < int > AllowedVersions = new List < int > ( ) { 230 , 233 , 234 , 235 , 236 , 237 , 238 , 242 , 243 } ;
2828
2929 public static string ConfigPath => Path . Combine ( "tshock" , "Crossplay.json" ) ;
3030
@@ -41,6 +41,7 @@ public class CrossplayPlugin : TerrariaPlugin
4141 { 237 , 666 } ,
4242 { 238 , 667 } ,
4343 { 242 , 669 } ,
44+ { 243 , 669 } ,
4445 } ;
4546 public static readonly Dictionary < int , int > MaxTileType = new Dictionary < int , int > ( )
4647 {
@@ -52,6 +53,7 @@ public class CrossplayPlugin : TerrariaPlugin
5253 { 237 , 623 } ,
5354 { 238 , 623 } ,
5455 { 242 , 624 } ,
56+ { 243 , 624 } ,
5557 } ;
5658 public static readonly Dictionary < int , int > MaxBuffType = new Dictionary < int , int > ( )
5759 {
@@ -63,6 +65,7 @@ public class CrossplayPlugin : TerrariaPlugin
6365 { 237 , 329 } ,
6466 { 238 , 329 } ,
6567 { 242 , 335 } ,
68+ { 243 , 335 } ,
6669 } ;
6770 public static readonly Dictionary < int , int > MaxProjectileType = new Dictionary < int , int > ( )
6871 {
@@ -74,6 +77,7 @@ public class CrossplayPlugin : TerrariaPlugin
7477 { 237 , 955 } ,
7578 { 238 , 955 } ,
7679 { 242 , 970 } ,
80+ { 243 , 970 } ,
7781 } ;
7882 public static readonly Dictionary < int , int > MaxItemType = new Dictionary < int , int > ( )
7983 {
@@ -85,6 +89,7 @@ public class CrossplayPlugin : TerrariaPlugin
8589 { 237 , 5087 } ,
8690 { 238 , 5087 } ,
8791 { 242 , 5124 } ,
92+ { 243 , 5124 } ,
8893 } ;
8994
9095 public CrossplayPlugin ( Main game ) : base ( game )
@@ -274,7 +279,7 @@ private void SendBytes(SendBytesEventArgs args)
274279 byte [ ] bytes = reader . ReadBytes ( 22 ) ;
275280 string worldName = reader . ReadString ( ) ;
276281 byte [ ] bytes2 = reader . ReadBytes ( 103 ) ;
277- reader . ReadByte ( ) ; // Main.tenthAnniversaryWorld
282+ reader . BaseStream . Position ++ ; // bitFlags[8]
278283 byte [ ] bytes3 = reader . ReadBytes ( 27 ) ;
279284 byte [ ] worldInfo = new PacketFactory ( )
280285 . SetType ( 7 )
@@ -436,7 +441,7 @@ private void SendBytes(SendBytesEventArgs args)
436441 }
437442 Log ( $ "/ ProjectileUpdate - swapped type from { old } -> { projType } from previously exceeded maxType", true , ConsoleColor . DarkGreen ) ;
438443 }
439- if ( playerVersion < 237 )
444+ if ( playerVersion > 236 )
440445 {
441446 return ;
442447 }
@@ -462,14 +467,14 @@ private void SendBytes(SendBytesEventArgs args)
462467 break ;
463468 case PacketTypes . NpcUpdate :
464469 {
465- reader . ReadBytes ( 20 ) ;
470+ reader . BaseStream . Position += 20 ;
466471 BitsByte npcFlags = reader . ReadByte ( ) ;
467- reader . ReadByte ( ) ;
472+ reader . BaseStream . Position ++ ;
468473 for ( int i = 2 ; i < 6 ; i ++ )
469474 {
470475 if ( npcFlags [ i ] )
471476 {
472- reader . ReadSingle ( ) ;
477+ reader . BaseStream . Position += 4 ;
473478 }
474479 }
475480 int type = reader . ReadInt16 ( ) ;
@@ -484,7 +489,6 @@ private void SendBytes(SendBytesEventArgs args)
484489 case PacketTypes . PlayerBuff :
485490 {
486491 var playerId = reader . ReadByte ( ) ;
487-
488492 var buffWrite = new PacketFactory ( ) ;
489493 buffWrite . SetType ( 50 ) ;
490494 buffWrite . PackByte ( playerId ) ;
@@ -615,6 +619,8 @@ private string Convert(int version)
615619 return "v1.4.3" ;
616620 case "Terraria243" :
617621 return "v1.4.3.1" ;
622+ case "Terraria244" :
623+ return "v1.4.3.2" ;
618624 }
619625 return $ "Unknown{ version } ";
620626 }
0 commit comments