public void OnPacketLogin(NetClient net, PacketC2SLogin c2SLogin) { Logger.Log("OnPacketLogin " + c2SLogin.Name); GameServer.Instance.PlayerManager.SetName(net.ClientId, c2SLogin.Name); var datas = DbManager.LoadFromDB(c2SLogin.Name); net.Send(new PacketS2CLoginResult(datas.Length == 0 ? ServerInfoManager.GetPlayerPid() : 0, datas).Data); }
private LoginServer() { LoginServerHandlers Handlers = new LoginServerHandlers(); Handlers.AutoLoad(); this.Server = new BaseServer <LoginClient>(2000, 1024 * 2, Handlers); this.ServerList = new ServerInfoManager(); }
public ViewModelBase() { ListServerInfo = new List <ServerInformation>(); var serverInfo = ServerInfoManager.GetServerInfo(); serverInfo.ServiceName = "FRONT_API"; ListServerInfo.Add(serverInfo); }
private static Func <Ninject.Activation.IContext, IWurmApi> BuildWurmApiFactory(IKernel kernel) { return(context => { IWurmAssistantConfig config = kernel.Get <IWurmAssistantConfig>(); IWurmApiLoggerFactory loggerFactory = kernel.Get <IWurmApiLoggerFactory>(); IWurmApiEventMarshaller eventMarshaller = kernel.Get <IWurmApiEventMarshaller>(); IWurmAssistantDataDirectory wurmAssistantDataDirectory = kernel.Get <IWurmAssistantDataDirectory>(); if (string.IsNullOrWhiteSpace(config.WurmGameClientInstallDirectory)) { throw new InvalidOperationException("Unknown path to Wurm Game Client installation folder."); } IWurmClientInstallDirectory wurmInstallDirectory = new WurmInstallDirectoryOverride(config.WurmGameClientInstallDirectory); ServerInfoManager serverInfoManager = kernel.Get <ServerInfoManager>(); var wurmApiConfig = new WurmApiConfig { Platform = Platform.Windows, ClearAllCaches = config.DropAllWurmApiCachesToggle, WurmUnlimitedMode = config.WurmUnlimitedMode }; serverInfoManager.UpdateWurmApiConfigDictionary(wurmApiConfig.ServerInfoMap); var wurmApiDataDir = new DirectoryInfo(Path.Combine(wurmAssistantDataDirectory.DirectoryPath, "WurmApi")); var wurmApi = AldursLab.WurmApi.WurmApiFactory.Create( new WurmApiCreationOptions() { DataDirPath = wurmApiDataDir.FullName, WurmApiLogger = loggerFactory.Create(), WurmApiEventMarshaller = eventMarshaller, WurmClientInstallDirectory = wurmInstallDirectory, WurmApiConfig = wurmApiConfig }); config.DropAllWurmApiCachesToggle = false; var validator = new WurmClientValidator(wurmApi, config); if (!validator.SkipOnStart) { var issues = validator.Validate(); if (issues.Any()) { validator.ShowSummaryWindow(issues); } } return wurmApi; }); }
public ActionResult <string> Get(int pageNumber, int numberObjectPage) { var message = new Message <List <Product> >(); message.IsSuccess = true; message.Date = DateTime.Now; message.ServerInfo = ServerInfoManager.GetServerInfo(); message.ServerInfo.ServiceName = "CATALOG_API_V2"; var products = ProductBusiness.GetProducts(pageNumber, numberObjectPage).ToList(); message.Data = products; // JsonConvert.SerializeObject(); var result = JsonConvert.SerializeObject(message); return(result); }
public void Run() { Logger.Log("Server Start"); ServerInfoManager.Load(); if (!Directory.Exists("log")) { Directory.CreateDirectory("log"); } this.server.Listen(5555); while (true) { server.Oneloop(); Thread.Sleep(50); } }
void Awake() { setServerTime(Time.time); UserManager = new UserManager(this); for(int i =0; i < Users.Length; i++) { UserManager.createUser(Users[i], Users[i]+"_UserName"); } ServerInfoManager = new ServerInfoManager(this); ServerInfoManager.Start(1); LLApiServer = new LLApiServer(this, Port, 200, 500); LLApiServer.RegisterHandler(Subjects.Connect, onServerConnection); LLApiServer.RegisterHandler(Subjects.LoginRequest, ServerInfoManager.addMessageToQueue); LLApiServer.RegisterHandler(Subjects.LogOutRequest, ServerInfoManager.addMessageToQueue); LLApiServer.RegisterHandler(Subjects.ServerInfoRequest, ServerInfoManager.addMessageToQueue); LLApiServer.Start(); }