예제 #1
0
        public void InitializeLot(string lotName, bool external)
        {
            if (lotName == "" || lotName[0] == '!')
            {
                return;
            }
            InitializeLot();

            if (!external)
            {
                if (!Downtown && ActiveFamily != null)
                {
                    ActiveFamily.SelectWholeFamily();
                    vm.TS1State.ActivateFamily(vm, ActiveFamily);
                }
                BlueprintReset(lotName, null);

                if (vm.LoadErrors.Count > 0)
                {
                    GameThread.NextUpdate((state) => ShowLoadErrors(vm.LoadErrors, true));
                }

                vm.MyUID = 1;
                var settings = GlobalSettings.Default;
                var myClient = new VMNetClient
                {
                    PersistID   = 1,
                    RemoteIP    = "local",
                    AvatarState = new VMNetAvatarPersistState()
                    {
                        Name         = settings.LastUser ?? "",
                        DefaultSuits = new VMAvatarDefaultSuits(settings.DebugGender),
                        BodyOutfit   = settings.DebugBody,
                        HeadOutfit   = settings.DebugHead,
                        PersistID    = 1,
                        SkinTone     = (byte)settings.DebugSkin,
                        Gender       = (short)(settings.DebugGender ? 1 : 0),
                        Permissions  = FSO.SimAntics.Model.TSOPlatform.VMTSOAvatarPermissions.Admin,
                        Budget       = 1000000
                    }
                };

                if (Downtown)
                {
                    var ngbh      = Content.Get().Neighborhood;
                    var crossData = ngbh.GameState;
                    var neigh     = ngbh.GetNeighborIDForGUID(crossData.DowntownSimGUID);
                    if (neigh != null)
                    {
                        var inv = ngbh.GetInventoryByNID(neigh.Value);
                        if (inv != null)
                        {
                            var hr  = inv.FirstOrDefault(x => x.Type == 2 && x.GUID == 7)?.Count ?? 0;
                            var min = inv.FirstOrDefault(x => x.Type == 2 && x.GUID == 8)?.Count ?? 0;
                            Driver.SendCommand(new VMNetSetTimeCmd()
                            {
                                Hours   = hr,
                                Minutes = min,
                            });
                        }
                    }
                }

                var server = (VMServerDriver)Driver;
                server.ConnectClient(myClient);
                LoadSurrounding(short.Parse(lotName.Substring(lotName.Length - 6, 2)));

                GameFacade.Cursor.SetCursor(CursorType.Normal);
                ZoomLevel = 1;
            }

            Frontend = new UISimitoneFrontend(this);
            this.Add(Frontend);
        }
예제 #2
0
 public void SendCommand(VMNetCommandBodyAbstract cmd)
 {
     cmd.ActorUID = MyUID;
     Driver.SendCommand(cmd);
 }
예제 #3
0
 public void SendCommand(VMNetCommandBodyAbstract cmd)
 {
     Driver.SendCommand(cmd);
 }