├── .gitattributes
├── .gitignore
├── CustomRPC.sln
├── CustomRPC
├── CustomRPC.Designer.cs
├── CustomRPC.cs
├── CustomRPC.csproj
├── CustomRPC.resx
└── Program.cs
├── CustomRPCCL
├── CustomRPCCL.csproj
└── Program.cs
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | .idea/
39 | # Uncomment if you have tasks that create the project's static files in wwwroot
40 | #wwwroot/
41 |
42 | # Visual Studio 2017 auto generated files
43 | Generated\ Files/
44 |
45 | # MSTest test Results
46 | [Tt]est[Rr]esult*/
47 | [Bb]uild[Ll]og.*
48 |
49 | # NUnit
50 | *.VisualState.xml
51 | TestResult.xml
52 | nunit-*.xml
53 |
54 | # Build Results of an ATL Project
55 | [Dd]ebugPS/
56 | [Rr]eleasePS/
57 | dlldata.c
58 |
59 | # Benchmark Results
60 | BenchmarkDotNet.Artifacts/
61 |
62 | # .NET Core
63 | project.lock.json
64 | project.fragment.lock.json
65 | artifacts/
66 |
67 | # ASP.NET Scaffolding
68 | ScaffoldingReadMe.txt
69 |
70 | # StyleCop
71 | StyleCopReport.xml
72 |
73 | # Files built by Visual Studio
74 | *_i.c
75 | *_p.c
76 | *_h.h
77 | *.ilk
78 | *.meta
79 | *.obj
80 | *.iobj
81 | *.pch
82 | *.pdb
83 | *.ipdb
84 | *.pgc
85 | *.pgd
86 | *.rsp
87 | *.sbr
88 | *.tlb
89 | *.tli
90 | *.tlh
91 | *.tmp
92 | *.tmp_proj
93 | *_wpftmp.csproj
94 | *.log
95 | *.vspscc
96 | *.vssscc
97 | .builds
98 | *.pidb
99 | *.svclog
100 | *.scc
101 |
102 | # Chutzpah Test files
103 | _Chutzpah*
104 |
105 | # Visual C++ cache files
106 | ipch/
107 | *.aps
108 | *.ncb
109 | *.opendb
110 | *.opensdf
111 | *.sdf
112 | *.cachefile
113 | *.VC.db
114 | *.VC.VC.opendb
115 |
116 | # Visual Studio profiler
117 | *.psess
118 | *.vsp
119 | *.vspx
120 | *.sap
121 |
122 | # Visual Studio Trace Files
123 | *.e2e
124 |
125 | # TFS 2012 Local Workspace
126 | $tf/
127 |
128 | # Guidance Automation Toolkit
129 | *.gpState
130 |
131 | # ReSharper is a .NET coding add-in
132 | _ReSharper*/
133 | *.[Rr]e[Ss]harper
134 | *.DotSettings.user
135 |
136 | # TeamCity is a build add-in
137 | _TeamCity*
138 |
139 | # DotCover is a Code Coverage Tool
140 | *.dotCover
141 |
142 | # AxoCover is a Code Coverage Tool
143 | .axoCover/*
144 | !.axoCover/settings.json
145 |
146 | # Coverlet is a free, cross platform Code Coverage Tool
147 | coverage*.json
148 | coverage*.xml
149 | coverage*.info
150 |
151 | # Visual Studio code coverage results
152 | *.coverage
153 | *.coveragexml
154 |
155 | # NCrunch
156 | _NCrunch_*
157 | .*crunch*.local.xml
158 | nCrunchTemp_*
159 |
160 | # MightyMoose
161 | *.mm.*
162 | AutoTest.Net/
163 |
164 | # Web workbench (sass)
165 | .sass-cache/
166 |
167 | # Installshield output folder
168 | [Ee]xpress/
169 |
170 | # DocProject is a documentation generator add-in
171 | DocProject/buildhelp/
172 | DocProject/Help/*.HxT
173 | DocProject/Help/*.HxC
174 | DocProject/Help/*.hhc
175 | DocProject/Help/*.hhk
176 | DocProject/Help/*.hhp
177 | DocProject/Help/Html2
178 | DocProject/Help/html
179 |
180 | # Click-Once directory
181 | publish/
182 |
183 | # Publish Web Output
184 | *.[Pp]ublish.xml
185 | *.azurePubxml
186 | # Note: Comment the next line if you want to checkin your web deploy settings,
187 | # but database connection strings (with potential passwords) will be unencrypted
188 | *.pubxml
189 | *.publishproj
190 |
191 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
192 | # checkin your Azure Web App publish settings, but sensitive information contained
193 | # in these scripts will be unencrypted
194 | PublishScripts/
195 |
196 | # NuGet Packages
197 | *.nupkg
198 | # NuGet Symbol Packages
199 | *.snupkg
200 | # The packages folder can be ignored because of Package Restore
201 | **/[Pp]ackages/*
202 | # except build/, which is used as an MSBuild target.
203 | !**/[Pp]ackages/build/
204 | # Uncomment if necessary however generally it will be regenerated when needed
205 | #!**/[Pp]ackages/repositories.config
206 | # NuGet v3's project.json files produces more ignorable files
207 | *.nuget.props
208 | *.nuget.targets
209 |
210 | # Microsoft Azure Build Output
211 | csx/
212 | *.build.csdef
213 |
214 | # Microsoft Azure Emulator
215 | ecf/
216 | rcf/
217 |
218 | # Windows Store app package directories and files
219 | AppPackages/
220 | BundleArtifacts/
221 | Package.StoreAssociation.xml
222 | _pkginfo.txt
223 | *.appx
224 | *.appxbundle
225 | *.appxupload
226 |
227 | # Visual Studio cache files
228 | # files ending in .cache can be ignored
229 | *.[Cc]ache
230 | # but keep track of directories ending in .cache
231 | !?*.[Cc]ache/
232 |
233 | # Others
234 | ClientBin/
235 | ~$*
236 | *~
237 | *.dbmdl
238 | *.dbproj.schemaview
239 | *.jfm
240 | *.pfx
241 | *.publishsettings
242 | orleans.codegen.cs
243 |
244 | # Including strong name files can present a security risk
245 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
246 | #*.snk
247 |
248 | # Since there are multiple workflows, uncomment next line to ignore bower_components
249 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
250 | #bower_components/
251 |
252 | # RIA/Silverlight projects
253 | Generated_Code/
254 |
255 | # Backup & report files from converting an old project file
256 | # to a newer Visual Studio version. Backup files are not needed,
257 | # because we have git ;-)
258 | _UpgradeReport_Files/
259 | Backup*/
260 | UpgradeLog*.XML
261 | UpgradeLog*.htm
262 | ServiceFabricBackup/
263 | *.rptproj.bak
264 |
265 | # SQL Server files
266 | *.mdf
267 | *.ldf
268 | *.ndf
269 |
270 | # Business Intelligence projects
271 | *.rdl.data
272 | *.bim.layout
273 | *.bim_*.settings
274 | *.rptproj.rsuser
275 | *- [Bb]ackup.rdl
276 | *- [Bb]ackup ([0-9]).rdl
277 | *- [Bb]ackup ([0-9][0-9]).rdl
278 |
279 | # Microsoft Fakes
280 | FakesAssemblies/
281 |
282 | # GhostDoc plugin setting file
283 | *.GhostDoc.xml
284 |
285 | # Node.js Tools for Visual Studio
286 | .ntvs_analysis.dat
287 | node_modules/
288 |
289 | # Visual Studio 6 build log
290 | *.plg
291 |
292 | # Visual Studio 6 workspace options file
293 | *.opt
294 |
295 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
296 | *.vbw
297 |
298 | # Visual Studio LightSwitch build output
299 | **/*.HTMLClient/GeneratedArtifacts
300 | **/*.DesktopClient/GeneratedArtifacts
301 | **/*.DesktopClient/ModelManifest.xml
302 | **/*.Server/GeneratedArtifacts
303 | **/*.Server/ModelManifest.xml
304 | _Pvt_Extensions
305 |
306 | # Paket dependency manager
307 | .paket/paket.exe
308 | paket-files/
309 |
310 | # FAKE - F# Make
311 | .fake/
312 |
313 | # CodeRush personal settings
314 | .cr/personal
315 |
316 | # Python Tools for Visual Studio (PTVS)
317 | __pycache__/
318 | *.pyc
319 |
320 | # Cake - Uncomment if you are using it
321 | # tools/**
322 | # !tools/packages.config
323 |
324 | # Tabs Studio
325 | *.tss
326 |
327 | # Telerik's JustMock configuration file
328 | *.jmconfig
329 |
330 | # BizTalk build output
331 | *.btp.cs
332 | *.btm.cs
333 | *.odx.cs
334 | *.xsd.cs
335 |
336 | # OpenCover UI analysis results
337 | OpenCover/
338 |
339 | # Azure Stream Analytics local run output
340 | ASALocalRun/
341 |
342 | # MSBuild Binary and Structured Log
343 | *.binlog
344 |
345 | # NVidia Nsight GPU debugger configuration file
346 | *.nvuser
347 |
348 | # MFractors (Xamarin productivity tool) working folder
349 | .mfractor/
350 |
351 | # Local History for Visual Studio
352 | .localhistory/
353 |
354 | # BeatPulse healthcheck temp database
355 | healthchecksdb
356 |
357 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
358 | MigrationBackup/
359 |
360 | # Ionide (cross platform F# VS Code tools) working folder
361 | .ionide/
362 |
363 | # Fody - auto-generated XML schema
364 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/CustomRPC.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31205.134
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomRPCCL", "CustomRPCCL\CustomRPCCL.csproj", "{F5934B1D-88F1-42C8-910B-3E2FE74B8D06}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomRPC", "CustomRPC\CustomRPC.csproj", "{F7819934-450F-4D85-98F7-78DF03243C31}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {F5934B1D-88F1-42C8-910B-3E2FE74B8D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {F5934B1D-88F1-42C8-910B-3E2FE74B8D06}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {F5934B1D-88F1-42C8-910B-3E2FE74B8D06}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {F5934B1D-88F1-42C8-910B-3E2FE74B8D06}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {F7819934-450F-4D85-98F7-78DF03243C31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {F7819934-450F-4D85-98F7-78DF03243C31}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {F7819934-450F-4D85-98F7-78DF03243C31}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {F7819934-450F-4D85-98F7-78DF03243C31}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {E03A567F-214A-4292-99FA-27EBF7804301}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/CustomRPC/CustomRPC.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace CustomRPC
3 | {
4 | partial class CustomRPC
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.textBox1 = new System.Windows.Forms.TextBox();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.label3 = new System.Windows.Forms.Label();
37 | this.label4 = new System.Windows.Forms.Label();
38 | this.label5 = new System.Windows.Forms.Label();
39 | this.label6 = new System.Windows.Forms.Label();
40 | this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
41 | this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
42 | this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
43 | this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
44 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
45 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
46 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
47 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
48 | this.SuspendLayout();
49 | //
50 | // textBox1
51 | //
52 | this.textBox1.Location = new System.Drawing.Point(100, 9);
53 | this.textBox1.Name = "textBox1";
54 | this.textBox1.Size = new System.Drawing.Size(169, 23);
55 | this.textBox1.TabIndex = 0;
56 | //
57 | // label1
58 | //
59 | this.label1.AutoSize = true;
60 | this.label1.Location = new System.Drawing.Point(12, 12);
61 | this.label1.Name = "label1";
62 | this.label1.Size = new System.Drawing.Size(84, 15);
63 | this.label1.TabIndex = 1;
64 | this.label1.Text = "Application Id:";
65 | //
66 | // label2
67 | //
68 | this.label2.AutoSize = true;
69 | this.label2.Location = new System.Drawing.Point(12, 46);
70 | this.label2.Name = "label2";
71 | this.label2.Size = new System.Drawing.Size(36, 15);
72 | this.label2.TabIndex = 3;
73 | this.label2.Text = "Time:";
74 | //
75 | // button1
76 | //
77 | this.button1.Location = new System.Drawing.Point(13, 221);
78 | this.button1.Name = "button1";
79 | this.button1.Size = new System.Drawing.Size(75, 23);
80 | this.button1.TabIndex = 4;
81 | this.button1.Text = "Update";
82 | this.button1.UseVisualStyleBackColor = true;
83 | this.button1.Click += new System.EventHandler(this.button1_Click);
84 | //
85 | // label3
86 | //
87 | this.label3.AutoSize = true;
88 | this.label3.Location = new System.Drawing.Point(12, 80);
89 | this.label3.Name = "label3";
90 | this.label3.Size = new System.Drawing.Size(35, 15);
91 | this.label3.TabIndex = 5;
92 | this.label3.Text = "Days:";
93 | //
94 | // label4
95 | //
96 | this.label4.AutoSize = true;
97 | this.label4.Location = new System.Drawing.Point(13, 111);
98 | this.label4.Name = "label4";
99 | this.label4.Size = new System.Drawing.Size(42, 15);
100 | this.label4.TabIndex = 6;
101 | this.label4.Text = "Hours:";
102 | //
103 | // label5
104 | //
105 | this.label5.AutoSize = true;
106 | this.label5.Location = new System.Drawing.Point(12, 141);
107 | this.label5.Name = "label5";
108 | this.label5.Size = new System.Drawing.Size(53, 15);
109 | this.label5.TabIndex = 7;
110 | this.label5.Text = "Minutes:";
111 | //
112 | // label6
113 | //
114 | this.label6.AutoSize = true;
115 | this.label6.Location = new System.Drawing.Point(13, 170);
116 | this.label6.Name = "label6";
117 | this.label6.Size = new System.Drawing.Size(54, 15);
118 | this.label6.TabIndex = 8;
119 | this.label6.Text = "Seconds:";
120 | //
121 | // numericUpDown1
122 | //
123 | this.numericUpDown1.Location = new System.Drawing.Point(100, 78);
124 | this.numericUpDown1.Maximum = new decimal(new int[] {
125 | -1,
126 | -1,
127 | -1,
128 | 0});
129 | this.numericUpDown1.Name = "numericUpDown1";
130 | this.numericUpDown1.Size = new System.Drawing.Size(120, 23);
131 | this.numericUpDown1.TabIndex = 9;
132 | //
133 | // numericUpDown2
134 | //
135 | this.numericUpDown2.Location = new System.Drawing.Point(100, 109);
136 | this.numericUpDown2.Maximum = new decimal(new int[] {
137 | -1,
138 | -1,
139 | -1,
140 | 0});
141 | this.numericUpDown2.Name = "numericUpDown2";
142 | this.numericUpDown2.Size = new System.Drawing.Size(120, 23);
143 | this.numericUpDown2.TabIndex = 10;
144 | //
145 | // numericUpDown3
146 | //
147 | this.numericUpDown3.Location = new System.Drawing.Point(100, 139);
148 | this.numericUpDown3.Maximum = new decimal(new int[] {
149 | -1,
150 | -1,
151 | -1,
152 | 0});
153 | this.numericUpDown3.Name = "numericUpDown3";
154 | this.numericUpDown3.Size = new System.Drawing.Size(120, 23);
155 | this.numericUpDown3.TabIndex = 11;
156 | //
157 | // numericUpDown4
158 | //
159 | this.numericUpDown4.Location = new System.Drawing.Point(100, 168);
160 | this.numericUpDown4.Maximum = new decimal(new int[] {
161 | -1,
162 | -1,
163 | -1,
164 | 0});
165 | this.numericUpDown4.Name = "numericUpDown4";
166 | this.numericUpDown4.Size = new System.Drawing.Size(120, 23);
167 | this.numericUpDown4.TabIndex = 12;
168 | //
169 | // CustomRPC
170 | //
171 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
172 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
173 | this.ClientSize = new System.Drawing.Size(329, 270);
174 | this.Controls.Add(this.numericUpDown4);
175 | this.Controls.Add(this.numericUpDown3);
176 | this.Controls.Add(this.numericUpDown2);
177 | this.Controls.Add(this.numericUpDown1);
178 | this.Controls.Add(this.label6);
179 | this.Controls.Add(this.label5);
180 | this.Controls.Add(this.label4);
181 | this.Controls.Add(this.label3);
182 | this.Controls.Add(this.button1);
183 | this.Controls.Add(this.label2);
184 | this.Controls.Add(this.label1);
185 | this.Controls.Add(this.textBox1);
186 | this.Name = "CustomRPC";
187 | this.Text = "CustomRPC";
188 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
189 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
190 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
191 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
192 | this.ResumeLayout(false);
193 | this.PerformLayout();
194 |
195 | }
196 |
197 | #endregion
198 |
199 | private System.Windows.Forms.TextBox textBox1;
200 | private System.Windows.Forms.Label label1;
201 | private System.Windows.Forms.Label label2;
202 | private System.Windows.Forms.Button button1;
203 | private System.Windows.Forms.Label label3;
204 | private System.Windows.Forms.Label label4;
205 | private System.Windows.Forms.Label label5;
206 | private System.Windows.Forms.Label label6;
207 | private System.Windows.Forms.NumericUpDown numericUpDown1;
208 | private System.Windows.Forms.NumericUpDown numericUpDown2;
209 | private System.Windows.Forms.NumericUpDown numericUpDown3;
210 | private System.Windows.Forms.NumericUpDown numericUpDown4;
211 | }
212 | }
213 |
214 |
--------------------------------------------------------------------------------
/CustomRPC/CustomRPC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace CustomRPC
12 | {
13 | public partial class CustomRPC : Form
14 | {
15 | public CustomRPC()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void button1_Click(object sender, EventArgs e)
21 | {
22 | Program.UpdateRPC(textBox1.Text, numericUpDown1.Value, numericUpDown2.Value, numericUpDown3.Value, numericUpDown4.Value);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/CustomRPC/CustomRPC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net5.0-windows
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/CustomRPC/CustomRPC.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | text/microsoft-resx
50 |
51 |
52 | 2.0
53 |
54 |
55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
56 |
57 |
58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
59 |
60 |
--------------------------------------------------------------------------------
/CustomRPC/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 | using DiscordRPC;
7 |
8 | namespace CustomRPC
9 | {
10 | static class Program
11 | {
12 | public static DiscordRpcClient Client { get; private set; }
13 |
14 | ///
15 | /// The main entry point for the application.
16 | ///
17 | [STAThread]
18 | static void Main()
19 | {
20 | Application.SetHighDpiMode(HighDpiMode.SystemAware);
21 | Application.EnableVisualStyles();
22 | Application.SetCompatibleTextRenderingDefault(false);
23 | Application.Run(new CustomRPC());
24 | }
25 |
26 | public static void UpdateRPC(string appId, decimal days, decimal hours, decimal minutes, decimal seconds)
27 | {
28 | if (Client != null)
29 | Client.Dispose();
30 |
31 | Client = new DiscordRpcClient(appId);
32 |
33 | Client.Initialize();
34 |
35 | var activity = new RichPresence()
36 | {
37 | Timestamps = new Timestamps(DateTime.UtcNow - new TimeSpan((int)days, (int)hours, (int)minutes, (int)seconds)),
38 | };
39 |
40 | Client.SetPresence(activity);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/CustomRPCCL/CustomRPCCL.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CustomRPCCL/Program.cs:
--------------------------------------------------------------------------------
1 | using DiscordRPC;
2 |
3 | namespace CustomRPCCL;
4 |
5 | public class Program
6 | {
7 | public static DiscordRpcClient? Client { get; private set; }
8 |
9 | public static void Main(string[] args)
10 | {
11 | if (args.Length < 1)
12 | throw new ArgumentException("Not enough parameters provided.");
13 |
14 | if (args[0] == "set")
15 | {
16 | if (args.Length < 2)
17 | throw new ArgumentException("Not enough parameters provided.");
18 |
19 | if (!ulong.TryParse(args[1], out _))
20 | throw new ArgumentException("Cannot parse application id.");
21 | File.WriteAllText("appid.txt", args[1]);
22 | Console.WriteLine($"Set default application id to {args[1]}");
23 | return;
24 | }
25 |
26 | if (!File.Exists("appid.txt"))
27 | throw new InvalidOperationException("No application id set. Set it with the set command.");
28 |
29 | var appId = File.ReadAllText("appid.txt");
30 | if (!decimal.TryParse(args[0], out var days))
31 | throw new ArgumentException("Cannot parse day count.");
32 |
33 | if (args.Length > 1)
34 | {
35 | if (!decimal.TryParse(args[1], out var hours))
36 | throw new ArgumentException("Cannot parse hour count.");
37 |
38 | if (args.Length > 2)
39 | {
40 | if (!decimal.TryParse(args[2], out var minutes))
41 | throw new ArgumentException("Cannot parse minute count.");
42 |
43 | if (args.Length > 3)
44 | {
45 | if (!decimal.TryParse(args[3], out var seconds))
46 | throw new ArgumentException("Cannot parse second count.");
47 |
48 | UpdateRPC(appId, days, hours, minutes, seconds);
49 | }
50 | else
51 | UpdateRPC(appId, days, hours, minutes);
52 | }
53 | else
54 | UpdateRPC(appId, days, hours);
55 | }
56 | else
57 | UpdateRPC(appId, days);
58 |
59 | Console.WriteLine("Started. Press any key to terminate.");
60 |
61 | Console.Read();
62 | Console.WriteLine("Terminated.");
63 | }
64 |
65 | public static void UpdateRPC(string appId, decimal days, decimal hours = 0, decimal minutes = 0, decimal seconds = 0)
66 | {
67 | if (Client != null)
68 | Client.Dispose();
69 |
70 | Client = new DiscordRpcClient(appId);
71 |
72 | Client.Initialize();
73 |
74 | var activity = new RichPresence()
75 | {
76 | Timestamps = new Timestamps(DateTime.UtcNow - new TimeSpan((int)days, (int)hours, (int)minutes, (int)seconds)),
77 | };
78 |
79 | Client.SetPresence(activity);
80 | }
81 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CustomRPC
2 | Basically lets you do this
3 |
4 | 
5 |
6 | Uses https://github.com/Lachee/discord-rpc-csharp.
7 |
8 | # How to use
9 |
10 | ## Windows (with GUI)
11 |
12 | Install the latest release from the releases tab, unzip it and double click "CustomRPC.exe".
13 |
14 | To get an application id:
15 | * Go to https://discord.com/developers/applications.
16 | * Create a new application.
17 | * Set the icon and app name to whatever you want in your status.
18 | * Copy the application id and paste it in the "Application Id" field.
19 |
20 | Then:
21 | * Set the time to the time you want to display.
22 | * Click "Update".
23 |
24 | ## Linux and MacOS (command line)
25 |
26 | * Clone the repository.
27 | * Follow the steps given above to get an application id.
28 | * Publish the CustomRPCCL project to wherever you feel convenient.
29 | * On a terminal, run the binary with the `set` command with the application id to set the default one.
30 | * Run the binary with the following arguments: [days] \ \ \ (arguments wrapped in <> are optional.)
31 |
--------------------------------------------------------------------------------