private static void LoadPacket(byte[] buffer) { ReceiveGPacket p = new ReceiveGPacket(buffer); short num1 = p.readH(); try { switch (num1) { case 1: Net_Room_Pass_Portal.Load(p); break; case 2: Net_Room_C4.Load(p); break; case 3: Net_Room_Death.Load(p); break; case 4: Net_Room_HitMarker.Load(p); break; case 5: Net_Room_Sabotage_Sync.Load(p); break; case 10: Account account1 = AccountManager.getAccount(p.readQ(), true); if (account1 == null) { break; } account1.SendPacket((SendPacket) new AUTH_ACCOUNT_KICK_PAK(1)); account1.SendPacket((SendPacket) new SERVER_MESSAGE_ERROR_PAK(2147487744U)); account1.Close(1000, false); break; case 11: int num2 = (int)p.readC(); int num3 = (int)p.readC(); Account account2 = AccountManager.getAccount(p.readQ(), 0); if (account2 == null) { break; } Account account3 = AccountManager.getAccount(p.readQ(), true); if (account3 == null) { break; } FriendState friendState = num3 == 1 ? FriendState.Online : FriendState.Offline; if (num2 == 0) { int index = -1; Friend friend = account3.FriendSystem.GetFriend(account2.player_id, out index); if (index == -1 || friend == null || friend.state != 0) { break; } account3.SendPacket((SendPacket) new FRIEND_UPDATE_PAK(FriendChangeState.Update, friend, friendState, index)); break; } account3.SendPacket((SendPacket) new CLAN_MEMBER_INFO_CHANGE_PAK(account2, friendState)); break; case 13: long id1 = p.readQ(); byte num4 = p.readC(); byte[] data = p.readB((int)p.readUH()); Account account4 = AccountManager.getAccount(id1, true); if (account4 == null) { break; } if (num4 == (byte)0) { account4.SendPacket(data); break; } account4.SendCompletePacket(data); break; case 15: int id2 = p.readD(); int num5 = p.readD(); GameServerModel server = ServersXML.getServer(id2); if (server == null) { break; } server._LastCount = num5; break; case 16: Net_Clan_Sync.Load(p); break; case 17: Net_Friend_Sync.Load(p); break; case 18: Net_Inventory_Sync.Load(p); break; case 19: Net_Player_Sync.Load(p); break; case 20: Net_Server_Warning.LoadGMWarning(p); break; case 21: Net_Clan_Servers_Sync.Load(p); break; case 22: Net_Server_Warning.LoadShopRestart(p); break; case 23: Net_Server_Warning.LoadServerUpdate(p); break; case 24: Net_Server_Warning.LoadShutdown(p); break; case 31: EventLoader.ReloadEvent((int)p.readC()); Logger.warning("[Game_SyncNet] Evento re-carregado."); break; case 32: ServerConfigSyncer.GenerateConfig((int)p.readC()); Logger.warning("[Game_SyncNet] Configurações (DB) resetadas."); break; default: Logger.warning("[Game_SyncNet] Tipo de conexão não encontrada: " + (object)num1); break; } } catch (Exception ex) { Logger.error("[Crash/Game_SyncNet] Tipo: " + (object)num1 + "\r\n" + ex.ToString()); if (p == null) { return; } Logger.error("COMP: " + BitConverter.ToString(p.getBuffer())); } }
/// <summary> /// </summary> /// <param name="events"> </param> public EventView(EventCollection <T> events) // NEED A SPECIFIC VIEW TYPE SERVED UP (WEB, WINFORMS, ETC) : base(events) { Events = events; _loader = new EventLoader <T>(); }
private static void LoadPacket(byte[] buffer) { ReceiveGPacket p = new ReceiveGPacket(buffer); short num1 = p.readH(); switch (num1) { case 11: int num2 = (int)p.readC(); int num3 = (int)p.readC(); Account account1 = AccountManager.getInstance().getAccount(p.readQ(), true); if (account1 == null) { break; } Account account2 = AccountManager.getInstance().getAccount(p.readQ(), true); if (account2 == null) { break; } FriendState friendState = num3 == 1 ? FriendState.Online : FriendState.Offline; if (num2 == 0) { int index = -1; Friend friend = account2.FriendSystem.GetFriend(account1.player_id, out index); if (index == -1 || friend == null) { break; } account2.SendPacket((SendPacket) new FRIEND_UPDATE_PAK(FriendChangeState.Update, friend, friendState, index)); break; } account2.SendPacket((SendPacket) new CLAN_MEMBER_INFO_CHANGE_PAK(account1, friendState)); break; case 13: long id1 = p.readQ(); byte num4 = p.readC(); byte[] data = p.readB((int)p.readUH()); Account account3 = AccountManager.getInstance().getAccount(id1, true); if (account3 == null) { break; } if (num4 == (byte)0) { account3.SendPacket(data); break; } account3.SendCompletePacket(data); break; case 15: int id2 = p.readD(); int num5 = p.readD(); GameServerModel server = ServersXML.getServer(id2); if (server == null) { break; } server._LastCount = num5; break; case 16: Net_Clan_Sync.Load(p); break; case 17: Net_Friend_Sync.Load(p); break; case 19: Net_Player_Sync.Load(p); break; case 20: Net_Server_Warning.LoadGMWarning(p); break; case 22: Net_Server_Warning.LoadShopRestart(p); break; case 23: Net_Server_Warning.LoadServerUpdate(p); break; case 24: Net_Server_Warning.LoadShutdown(p); break; case 31: EventLoader.ReloadEvent((int)p.readC()); Logger.warning("[Auth_SyncNet] Evento re-carregado."); break; case 32: ServerConfigSyncer.GenerateConfig((int)p.readC()); Logger.warning("[Auth_SyncNet] Configurações (DB) resetadas."); break; default: Logger.warning("[Auth_SyncNet] Tipo de conexão não encontrada: " + (object)num1); break; } }
public static void Main(string[] args) { Printf.blue("[Licença de uso]", false); Printf.blue("[+] Esta é uma versão compilada para Project Bloodi!!!", false); Printf.blue("[+] https://github.com/luisfeliperm", false); Printf.info("\n\n\n Iniciando servidor...", false); Thread.Sleep(5000); Console.Clear(); TimeStarted = DateTime.Now; SaveLog.aplication = "game"; Console.Title = "PointBlank - Game"; header(true); // Validações System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location); if (!Compatible.Check(fileVersion.FileVersion, "game") || !ServerLicense.check() || !ServerPasswd.Compare(args)) { Console.ReadKey(); return; } SaveLog.checkDirectorys(); ConfigGS.Load(); WelcomeXML.Load(); BasicInventoryXML.Load(); ServerConfig.Load(); ServersXML.Load(); ChannelsXML.Load(ConfigGS.serverId); EventLoader.LoadAll(); RankUp.load(); TitlesXML.Load(); TitleAwardsXML.Load(); ClanManager.Load(); NickFilter.Load(); MissionCardXML.LoadBasicCards(1); BattleServerJSON.Load(); RankXML.Load(); RankXML.LoadAwards(); ClanRankXML.Load(); MissionAwards.Load(); MissionsXML.Load(); Translation.Load(); ShopManager.Load(1); ClassicModeManager.LoadList(); RandomBoxXML.LoadBoxes(); CupomEffectManager.LoadCupomFlags(); Game_SyncNet.Start(); bool started = GameManager.Start(); if (started) { cpuMonitor.updateRAM(); } header(false); while (true) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("[SHELL]# "); Console.ForegroundColor = ConsoleColor.White; String input = Console.ReadLine(); if (string.IsNullOrEmpty(input)) { continue; } Comandos.checkCmd(input); } //Process.GetCurrentProcess().WaitForExit(); }
public void Dispose() { EventLoader.Of(this._client).Unload(this); }
static void Main(string[] args) { Console.WindowHeight = Console.LargestWindowHeight >= 40 ? 40 : Console.LargestWindowHeight; Console.Title = "Ski jumping points calculator tester"; Console.WriteLine("Ski jumping points calculator tester!"); //Load event information, parameters and competitors from a file Event competitionEvent = EventLoader.LoadXML("../../../../Testevent.xml"); Console.WriteLine("\nEvent:{0}", competitionEvent.ToString()); Console.WriteLine("\nEvent parameters:\n{0}", competitionEvent.Parameters.ToString()); Console.WriteLine("\nEvent competitors:"); foreach (EventCompetitor c in competitionEvent.Competitors) { Console.WriteLine("\nCompetitor:{0}", c.ToString()); } //Test data Random rng = new Random(); EventCompetitor testCompetitor = new EventCompetitor("0000", "Test", "Jumper", "FIN"); double length = 124; double windCorrection = 1.4; double platformCorrection = -1.4; IList <double> stylePoints = new List <double>() { 18, 18.5, 18.5, 19, 19 }; JumpData singleJumpData = new JumpData(length, windCorrection, platformCorrection, stylePoints); //Make and score a single test jump Jump singleJump = new Jump(testCompetitor); singleJump.ScoreJump(singleJumpData, competitionEvent.Parameters); Console.WriteLine("\nSingle jump test:\n{0}", singleJump.ToString()); //Event starts //Event has 1..n EventRound(s) and has 1 EventResult(s) //EventRound has 1..n Jumps that have 1 Competitor, 1 Jump data and 1 Jump score //Event.Parameters are used together with Jump data to calculate Jump score //This is not necessarily the best approach, depending on the application type //Alternative handle rounds in application and set round data to the Event, after the round has been completed //Alternatively, update round jump data at the Event after each jump //First round EventRound firstRound = competitionEvent.GetFirstRound(); //Now done by Event in previous step /* * //Add competitors to the round * //Competitors are simply ordered according to their order in the Event * //Could be potentially hidden from application by Event and EventRound methods * foreach (EventCompetitor c in competitionEvent.Competitors) * { * firstRound.AddJump(new Jump(c)); * } */ //Make first round test jumps, set data about jump and calculate and set score //Could be potentially partially hidden from application by an Event method //Consider during application design foreach (Jump jump in firstRound.Jumps) { JumpData jumpData = new JumpData(rng.Next(100, 130 + 1), windCorrection, platformCorrection, stylePoints); jump.ScoreJump(jumpData, competitionEvent.Parameters); //Previous implementation, not compatible with library changes //competitionEvent.AddResult(jump.Competitor, jump.Score); //New implementation, update result, following library changes competitionEvent.UpdateResult(jump.Competitor, jump.Score); //Console.WriteLine("\nFirst round jump:\nCompetitor:{0}\nJump:{1}\nScore: {2:F2}", jump.Competitor.ToString(), jump.Data.ToString(), jump.Score); } /* * //Display first round results * //Could be potentially partially hidden from application by an Event method * foreach (EventResult r in competitionEvent.Results) * { * Console.WriteLine("\nFirst round results:\nCompetitor:{0}\nScore: {1:F2}", r.Competitor.ToString(), r.Score); * } */ //Second round //Second round is currently not fully supported after library changes, see below //EventRound secondRound = competitionEvent.GetNextRound(); //Now done by Event in previous step /* * //Add competitors to the round, based on their first round score, in reverse order * foreach (EventResult r in competitionEvent.Results.Reverse().ToList()) * { * secondRound.AddJump(new Jump(r.Competitor)); * } */ //Previous implementation, not compatible with library changes //Current update method just updates the existing score with the new one, instead of incrementing the score //If suppport for multiple rounds is later required, increment functionality can be added to the library /* * //Make second round test jumps, set data about jump and calculate and set score * foreach (Jump j in secondRound.Jumps) * { * JumpData jumpData = new JumpData(rng.Next(100, 130 + 1), windCorrection, platformCorrection, stylePoints); * j.ScoreJump(jumpData, competitionEvent.Parameters); * competitionEvent.UpdateResult(j.Competitor, j.Score); * //Console.WriteLine("\nSecond round jump:\nCompetitor:{0}\nJump:{1}\nScore: {2:F2}", j.Competitor.ToString(), j.Data.ToString(), j.Score); * } */ //Display jumps by round foreach (EventRound r in competitionEvent.Rounds) { Console.WriteLine("\n{0} jumps:", r.RoundName); foreach (Jump j in r.Jumps) { //Console.WriteLine("\nCompetitor:{0}\nJump:{1}\nScore: {2}", j.Competitor.ToString(), j.Data.ToString(), j.Score); Console.WriteLine("{0}", j.ToString()); } } //Display event final results Console.WriteLine("\nFinal results:"); foreach (EventResult r in competitionEvent.Results) { Console.WriteLine("\n{0}\nScore: {1:F2}", r.Competitor.ToString(), r.Score); } Console.ReadLine(); }
private void FormMainView_Shown(object sender, EventArgs e) { try { //Display empty event information EventInformationName.Text = "No event information"; EventInformationVenue.Text = String.Empty; EventInformationHill.Text = String.Empty; EventInformationDate.Text = String.Empty; //Display empty event parameters EventParametersText.Text = "No event parameters"; //Load event configuration file and create Event OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Choose event configuration file"; dialog.Filter = "XML files | *.xml"; dialog.Multiselect = false; if (dialog.ShowDialog() == DialogResult.OK) { //File selected, attempt to load and create event String path = dialog.FileName; _event = EventLoader.LoadXML(path); } else { //No file selected, exit Application.Exit(); return; } //Display event information EventInformationName.Text = _event.Name; EventInformationVenue.Text = String.Format("Venue: {0}", _event.Venue); EventInformationHill.Text = String.Format("Hill: {0}", _event.Hill); EventInformationDate.Text = String.Format("Date: {0}", _event.Date.ToShortDateString()); //Display event parameters EventParametersText.Text = _event.Parameters.ToString(); //Initialize and populate event round datagrid _eventRound = _event.GetFirstRound(); _eventRoundBindingList = new BindingList <Jump>(_eventRound.Jumps); _eventRoundBindingSource = new BindingSource(_eventRoundBindingList, null); MainEventRoundDataGrid.AutoGenerateColumns = false; MainEventRoundDataGrid.AutoSize = true; MainEventRoundDataGrid.DefaultCellStyle.BackColor = Color.LightYellow; MainEventRoundDataGrid.DataSource = _eventRoundBindingSource; DataGridViewColumn column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFisCode"; column.Name = "FIS Code"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorLastName"; column.Name = "Last Name"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFirstName"; column.Name = "First Name"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorNation"; column.Name = "Nation"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "Score"; column.Name = "Score"; column.DefaultCellStyle.Format = "F2"; MainEventRoundDataGrid.Columns.Add(column); DataGridViewButtonColumn btncolumn = new DataGridViewButtonColumn(); btncolumn.Name = "Score Jump"; btncolumn.Text = "Score Jump"; btncolumn.UseColumnTextForButtonValue = true; MainEventRoundDataGrid.Columns.Add(btncolumn); //Initialize and populate event results datagrid _eventResultsBindingList = new BindingList <EventResult>(_event.Results); _eventResultsBindingSource = new BindingSource(_eventResultsBindingList, null); MainEventResultsDataGrid.AutoGenerateColumns = false; MainEventResultsDataGrid.AutoSize = true; MainEventResultsDataGrid.DefaultCellStyle.BackColor = Color.LightYellow; MainEventResultsDataGrid.DataSource = _eventResultsBindingSource; column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFisCode"; column.Name = "FIS Code"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorLastName"; column.Name = "Last Name"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFirstName"; column.Name = "First Name"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorNation"; column.Name = "Nation"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "Score"; column.Name = "Score"; column.DefaultCellStyle.Format = "F2"; MainEventResultsDataGrid.Columns.Add(column); //Select event round tab MainTabControl.SelectTab("MainTabRound"); } catch (Exception exception) { MessageBox.Show(String.Format("{0}", exception.Message), "EKoodi - Ski jumping points calculator", MessageBoxButtons.OK); Application.Exit(); } }
private static void Main(string[] args) { { Application.Run((Form) new ip()); } Console.Clear(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Programm.CurrentDomainOnUnhandledException); Console.Title = "Iniciando o Point Blank Auth Server..."; Logger.StartedFor = "auth"; Logger.checkDirectorys(); StringUtil stringUtil = new StringUtil(); stringUtil.AppendLine(" ________ _____ __ ______ _______ "); stringUtil.AppendLine(" / ____/ |/ / / / / / / / / / / / "); stringUtil.AppendLine(" / __/ / /|_/ / / / / / /__/_/ /__/ / "); stringUtil.AppendLine(" / /___/ / / / /_/ / _ / / / / / / "); stringUtil.AppendLine(" "); DateTime dateTime1 = ComDiv.GetLinkerTime(Assembly.GetExecutingAssembly(), (TimeZoneInfo)null); string str = dateTime1.ToString("dd/MM/yyyy HH:mm"); stringUtil.AppendLine(" Data de Inicialização: " + str + " "); Logger.info(stringUtil.getString()); ConfigGA.Load(); ConfigMaps.Load(); ServerConfigSyncer.GenerateConfig(ConfigGA.configId); EventLoader.LoadAll(); DirectXML.Start(); BasicInventoryXML.Load(); ServersXML.Load(); MissionCardXML.LoadBasicCards(2); MapsXML.Load(); RegionXML.Load(); ShopManager.Load(2); CupomEffectManager.LoadCupomFlags(); MissionsXML.Load(); bool flag1 = true; foreach (string text in args) { // if (ComDiv.gen5(text) == "e5cb4b8a5474496fb2f2cddb5dbb07a7") if (ComDiv.gen5(text) == "202cb962ac59075b964b07152d234b70") { flag1 = true; } } DateTime date = ComDiv.GetDate(); DateTime dateTime2 = date; dateTime1 = new DateTime(); DateTime dateTime3 = dateTime1; bool flag2 = dateTime2 == dateTime3 || long.Parse(date.ToString("yyMMddHHmmss")) >= 181024000000L; Auth_SyncNet.Start(); if (flag1) { bool flag3 = LoginManager.Start(); Logger.warning("[Servidor] Hospedado: " + ConfigGB.EncodeText.EncodingName); Logger.warning("[Servidor] Modo: " + (ConfigGA.isTestMode ? "Testes" : "Público")); Logger.warning(Programm.StartSuccess()); if (flag3) { LoggerGA.updateRAM2(); } } Process.GetCurrentProcess().WaitForExit(); }