Beispiel #1
0
 private void Multiplayer_ModMessageReceived(object sender, ModMessageReceivedEventArgs e)
 {
     if (e.FromModID == ModManifest.UniqueID && e.Type == "SyncedLocationData")
     {
         syncedLocationData = e.ReadAs <SyncedNpcLocationData>();
     }
 }
Beispiel #2
0
        private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            activeWarpLocators = new Dictionary <string, LocatorScroller>();
            syncedLocationData = new SyncedNpcLocationData();
            GetLocationContexts();

            // Log warning if host does not have mod installed
            if (Context.IsMultiplayer)
            {
                var hostHasMod = false;

                foreach (IMultiplayerPeer peer in this.Helper.Multiplayer.GetConnectedPlayers())
                {
                    if (peer.GetMod("Bouhm.LocationCompass") != null && peer.IsHost)
                    {
                        hostHasMod = true;
                        break;
                    }
                }

                if (!hostHasMod)
                {
                    Monitor.Log("Since the server host does not have LocationCompass installed, NPC locations cannot be synced and updated.", LogLevel.Warn);
                }
            }
        }