초기 커밋.
This commit is contained in:
81
lck_cl_data_solution/GameDataViewer/Form1.Designer.cs
generated
Normal file
81
lck_cl_data_solution/GameDataViewer/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,81 @@
|
||||
namespace GameDataViewer
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.treeView1 = new System.Windows.Forms.TreeView();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// treeView1
|
||||
//
|
||||
this.treeView1.Location = new System.Drawing.Point(304, 136);
|
||||
this.treeView1.Name = "treeView1";
|
||||
this.treeView1.Size = new System.Drawing.Size(563, 658);
|
||||
this.treeView1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(12, 687);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(286, 107);
|
||||
this.button1.TabIndex = 1;
|
||||
this.button1.Text = "button1";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(12, 658);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(286, 23);
|
||||
this.textBox1.TabIndex = 2;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(925, 864);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.treeView1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private TreeView treeView1;
|
||||
private Button button1;
|
||||
private TextBox textBox1;
|
||||
}
|
||||
}
|
||||
107
lck_cl_data_solution/GameDataViewer/Form1.cs
Normal file
107
lck_cl_data_solution/GameDataViewer/Form1.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using MongoDB.Driver;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace GameDataViewer
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
//public static string MONGODBÁÖ¼Ò = "mongodb://root:veryhardpassword123@211.53.30.8:50003";
|
||||
public static string MONGODBÁÖ¼Ò = "mongodb://root:veryhardpassword123@211.42.188.8:50003";
|
||||
|
||||
private void DisplayTreeView(JToken root, string rootName)
|
||||
{
|
||||
treeView1.BeginUpdate();
|
||||
try
|
||||
{
|
||||
treeView1.Nodes.Clear();
|
||||
var tNode = treeView1.Nodes[treeView1.Nodes.Add(new TreeNode(rootName))];
|
||||
tNode.Tag = root;
|
||||
|
||||
|
||||
AddNode(root, tNode);
|
||||
|
||||
treeView1.ExpandAll();
|
||||
}
|
||||
finally
|
||||
{
|
||||
treeView1.EndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private bool AddNode(JToken token, TreeNode inTreeNode)
|
||||
{
|
||||
if (token == null)
|
||||
return false;
|
||||
if (token is JValue)
|
||||
{
|
||||
var childNode = inTreeNode.Nodes[inTreeNode.Nodes.Add(new TreeNode(token.ToString()))];
|
||||
childNode.Tag = token;
|
||||
}
|
||||
else if (token is JObject)
|
||||
{
|
||||
var obj = (JObject)token;
|
||||
foreach (var property in obj.Properties())
|
||||
{
|
||||
var childNode = inTreeNode.Nodes[inTreeNode.Nodes.Add(new TreeNode(property.Name))];
|
||||
childNode.Tag = property;
|
||||
AddNode(property.Value, childNode);
|
||||
}
|
||||
}
|
||||
else if (token is JArray)
|
||||
{
|
||||
var array = (JArray)token;
|
||||
for (int i = 0; i < array.Count; i++)
|
||||
{
|
||||
var childNode = inTreeNode.Nodes[inTreeNode.Nodes.Add(new TreeNode(i.ToString()))];
|
||||
childNode.Tag = array[i];
|
||||
AddNode(array[i], childNode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.WriteLine(string.Format("{0} not implemented", token.Type)); // JConstructor, JRaw
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
internal MongoClient mDBClient = null;
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
mDBClient = new MongoClient(MONGODBÁÖ¼Ò);
|
||||
|
||||
var database = mDBClient.GetDatabase("datalol");
|
||||
|
||||
var filter = Builders<BsonDocument>.Filter.Eq("RequestGameID", textBox1.Text);
|
||||
|
||||
var projection = Builders<BsonDocument>.Projection
|
||||
.Exclude("_id")
|
||||
.Include("eventDocument");
|
||||
|
||||
List<BsonDocument> documents = database.GetCollection<BsonDocument>("stats_update")
|
||||
.Find(filter)
|
||||
.SortByDescending(x => x["sequenceIndex"])
|
||||
.Project(projection)
|
||||
.Limit(1)
|
||||
.ToList();
|
||||
|
||||
|
||||
JToken root = (JToken)documents[0]["eventDocument"].ToString();
|
||||
DisplayTreeView(root, "root");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
60
lck_cl_data_solution/GameDataViewer/Form1.resx
Normal file
60
lck_cl_data_solution/GameDataViewer/Form1.resx
Normal file
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
16
lck_cl_data_solution/GameDataViewer/GameDataViewer.csproj
Normal file
16
lck_cl_data_solution/GameDataViewer/GameDataViewer.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.12.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
17
lck_cl_data_solution/GameDataViewer/Program.cs
Normal file
17
lck_cl_data_solution/GameDataViewer/Program.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace GameDataViewer
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user