1- using Rocket . Components ;
2- using Rocket . RocketAPI ;
3- using Rocket . Logging ;
1+ using Rocket . API ;
2+ using Rocket . Unturned ;
3+ using Rocket . Unturned . Logging ;
4+ using Rocket . Unturned . Player ;
45using SDG ;
56using Steamworks ;
67using UnityEngine ;
@@ -52,17 +53,15 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
5253 else
5354 {
5455 // Either not an admin or they don't get special wait restrictions.
55- List < Group > hg = player . Groups ;
56+ List < Rocket . Core . Permissions . Group > hg = player . GetGroups ( true ) ;
5657 if ( hg . Count <= 0 )
5758 {
58- Group group = new Group ( ) ;
59- group . Id = "default" ;
60- hg . Add ( group ) ;
59+ Logger . Log ( "There was an error as a player has no groups!" ) ;
6160 }
6261 byte [ ] time2 = new byte [ hg . Count ] ;
6362 for ( byte g = 0 ; g < hg . Count ; g ++ )
6463 {
65- Group hgr = hg [ g ] ;
64+ Rocket . Core . Permissions . Group hgr = hg [ g ] ;
6665 HomeCommand . Instance . WaitGroups . TryGetValue ( hgr . Id , out time2 [ g ] ) ;
6766 if ( time2 [ g ] <= 0 )
6867 {
@@ -77,11 +76,11 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
7776 if ( this . movementrestricted )
7877 {
7978 this . LastCalledHomePos = this . transform . position ;
80- RocketChatManager . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . CharacterName , this . waittime ) ) ;
79+ RocketChat . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . CharacterName , this . waittime ) ) ;
8180 }
8281 else
8382 {
84- RocketChatManager . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . CharacterName , this . waittime ) ) ;
83+ RocketChat . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . CharacterName , this . waittime ) ) ;
8584 }
8685 }
8786 else
@@ -94,7 +93,7 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
9493 private void DoGoHome ( )
9594 {
9695 if ( ! this . cangohome ) return ;
97- RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . TeleportMsg , this . p . CharacterName ) ) ;
96+ RocketChat . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . TeleportMsg , this . p . CharacterName ) ) ;
9897 this . p . Teleport ( this . bedPos , this . bedRot ) ;
9998 this . cangohome = false ;
10099 this . GoingHome = false ;
@@ -105,7 +104,7 @@ public void FixedUpdate()
105104 if ( this . p . Dead )
106105 {
107106 // Abort teleport, they died.
108- RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . NoTeleportDiedMsg , this . p . CharacterName ) ) ;
107+ RocketChat . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . NoTeleportDiedMsg , this . p . CharacterName ) ) ;
109108 this . GoingHome = false ;
110109 this . cangohome = false ;
111110 return ;
@@ -115,7 +114,7 @@ public void FixedUpdate()
115114 if ( Vector3 . Distance ( this . p . Position , this . LastCalledHomePos ) > 0.1 )
116115 {
117116 // Abort teleport, they moved.
118- RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . UnableMoveSinceMoveMsg , this . p . CharacterName ) ) ;
117+ RocketChat . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . UnableMoveSinceMoveMsg , this . p . CharacterName ) ) ;
119118 this . GoingHome = false ;
120119 this . cangohome = false ;
121120 return ;
0 commit comments