@@ -21,7 +21,8 @@ internal class ChatInputV2__CheckForServerCode
2121 [ HarmonyPrefix ]
2222 internal static bool CheckForCommands ( ChatInputV2 __instance , string text )
2323 {
24- Mod . Log . LogInfo ( text ) ;
24+ //Mod.Log.LogInfo(text);
25+ //Mod.Log.LogInfo("Came From Host?: " + Mod.Instance.cameFromHost);
2526 if ( string . IsNullOrEmpty ( text ) || text . Length > 0 && text [ 0 ] != '/' )
2627 {
2728 Mod . Log . LogInfo ( "Not a command!" ) ;
@@ -48,10 +49,18 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
4849
4950 if ( key != null )
5051 {
51- Mod . Log . LogInfo ( "Command is: " + key ) ;
52+ // Mod.Log.LogInfo("Command is: " + key);
5253 if ( key == "date" )
5354 {
54- StaticTransceivedEvent < ChatMessage . Data > . Broadcast ( new ChatMessage . Data ( "Current date: " + DateTime . Now . ToString ( ) ) ) ;
55+ if ( Mod . Instance . amIHost )
56+ {
57+ StaticTransceivedEvent < ChatMessage . Data > . Broadcast ( new ChatMessage . Data ( "Current Date of Host: " + DateTime . Now . ToString ( ) ) ) ;
58+ }
59+ else
60+ {
61+ __instance . AddChat ( "Current Date of Client: " + DateTime . Now . ToString ( ) ) ;
62+ }
63+
5564 return false ;
5665 }
5766
@@ -95,7 +104,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
95104 return false ;
96105 }
97106
98- if ( key == "playercount" && Mod . Instance . amIHost )
107+ if ( key == "playercount" && Mod . Instance . amIHost && Mod . Instance . cameFromHost )
99108 {
100109 if ( string . IsNullOrEmpty ( str ) )
101110 {
@@ -113,7 +122,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
113122 return true ;
114123 }
115124
116- if ( key == "private" && Mod . Instance . amIHost )
125+ if ( key == "private" && Mod . Instance . amIHost && Mod . Instance . cameFromHost )
117126 {
118127 if ( ! string . IsNullOrEmpty ( str ) )
119128 {
@@ -134,7 +143,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
134143 return false ;
135144 }
136145
137- if ( key == "public" && Mod . Instance . amIHost )
146+ if ( key == "public" && Mod . Instance . amIHost && Mod . Instance . cameFromHost )
138147 {
139148 G . Sys . NetworkingManager_ . password_ = "" ;
140149 G . Sys . NetworkingManager_ . privateServer_ = false ;
@@ -146,7 +155,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
146155
147156 if ( key == "server" )
148157 {
149- if ( ! string . IsNullOrEmpty ( str ) && ! flag )
158+ if ( ! string . IsNullOrEmpty ( str ) && ! flag && Mod . Instance . amIHost && Mod . Instance . cameFromHost )
150159 {
151160 G . Sys . NetworkingManager_ . serverTitle_ = str ;
152161 G . Sys . NetworkingManager_ . ReportToMasterServer ( ) ;
@@ -159,7 +168,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
159168 return false ;
160169 }
161170
162- if ( key == "shuffle" && Mod . Instance . amIHost )
171+ if ( key == "shuffle" && Mod . Instance . amIHost && Mod . Instance . cameFromHost )
163172 {
164173 if ( G . Sys . GameManager_ . ModeID_ == GameModeID . Trackmogrify )
165174 {
@@ -194,7 +203,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
194203 return false ;
195204 }
196205
197- if ( key == "timeout" && Mod . Instance . amIHost && ! Mod . Instance . allPlayersFinished )
206+ if ( key == "timeout" && Mod . Instance . amIHost && Mod . Instance . cameFromHost && ! Mod . Instance . allPlayersFinished )
198207 {
199208 int time ;
200209 if ( flag )
@@ -211,7 +220,7 @@ internal static bool CheckForCommands(ChatInputV2 __instance, string text)
211220 return false ;
212221 }
213222
214- if ( key == "canceltimeout" && Mod . Instance . amIHost && ! Mod . Instance . allPlayersFinished )
223+ if ( key == "canceltimeout" && Mod . Instance . amIHost && Mod . Instance . cameFromHost && ! Mod . Instance . allPlayersFinished )
215224 {
216225 StaticTransceivedEvent < FinalCountdownCancel . Data > . Broadcast ( new FinalCountdownCancel . Data ( ) ) ;
217226 Mod . Instance . countdownActive = false ;
0 commit comments