@@ -31,22 +31,22 @@ internal DatabaseManager()
3131
3232 private bool KeyVailed ( CDKData cdk )
3333 {
34- if ( cdk . Items != string . Empty && cdk . Amount != string . Empty )
34+ if ( cdk . Items . Length != 0 && cdk . Amount . Length != 0 )
3535 {
36- if ( cdk . Items . Split ( ',' ) . Length != cdk . Amount . Split ( ',' ) . Length )
36+ if ( cdk . Items . Length != cdk . Amount . Length )
3737 {
3838 Logger . LogError ( String . Format ( "CDK:{0} Items and Amount Column length not equal! " , cdk . CDK ) ) ;
3939 return false ;
4040 }
41- for ( int i = 0 ; i < cdk . Items . Split ( ',' ) . Length ; i ++ )
41+ for ( int i = 0 ; i < cdk . Items . Length ; i ++ )
4242 {
4343 if ( ! ushort . TryParse ( cdk . Items [ i ] . ToString ( ) , out ushort id ) )
4444 {
4545 Logger . LogError ( String . Format ( "CDK:{0} has id in Items not a ushort!" , cdk . CDK ) ) ;
4646 return false ;
4747 }
4848 }
49- for ( int i = 0 ; i < cdk . Amount . Split ( ',' ) . Length ; i ++ )
49+ for ( int i = 0 ; i < cdk . Amount . Length ; i ++ )
5050 {
5151 if ( ! byte . TryParse ( cdk . Amount [ i ] . ToString ( ) , out byte am ) )
5252 {
@@ -87,19 +87,19 @@ public RedeemCDKResult RedeemCDK(UnturnedPlayer player, string CDK)
8787 }
8888 else
8989 {
90- if ( cdkdata . Items != string . Empty && cdkdata . Amount == string . Empty )
90+ if ( cdkdata . Items . Length != 0 && cdkdata . Amount . Length == 0 )
9191 {
9292
93- var items = cdkdata . Items . Split ( ',' ) ;
93+ var items = cdkdata . Items ;
9494 for ( int i = 0 ; i < items . Length ; i ++ )
9595 {
9696 player . GiveItem ( ushort . Parse ( items [ i ] ) , 1 ) ;
9797 }
9898 }
99- else if ( cdkdata . Items != string . Empty && cdkdata . Amount != string . Empty )
99+ else if ( cdkdata . Items . Length != 0 && cdkdata . Amount . Length != 0 )
100100 {
101- var items = cdkdata . Items . Split ( ',' ) ;
102- var amount = cdkdata . Amount . Split ( ',' ) ;
101+ var items = cdkdata . Items ;
102+ var amount = cdkdata . Amount ;
103103
104104 for ( int i = 0 ; i < amount . Length ; i ++ )
105105 {
0 commit comments