forked from barrenechea/AutoDice
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJsonClases.cs
468 lines (443 loc) · 16.2 KB
/
JsonClases.cs
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace AutoDice
{
#region Da Dice Classes
#region Da Dice Ajax Classes
public class DaDiceAjaxRoll
{
#region Atributos
public bool status { get; set; }
public List<string> message { get; set; }
public DaDiceAjaxRollData roll { get; set; }
public DaDiceAjaxBalance balance { get; set; }
#endregion
}
public class DaDiceAjaxRollData
{
#region Atributos
public string id { get; set; }
public string flag { get; set; }
public string status { get; set; }
public string status_message { get; set; }
public string seed { get; set; }
public long nonce { get; set; }
public string user_a { get; set; }
public double roll_chance { get; set; }
public string roll_bet { get; set; }
public double roll_result { get; set; }
public double amount { get; set; }
public double payout { get; set; }
public long micro_stamp { get; set; }
public string unix_stamp { get; set; }
public long profit { get; set; }
public string username { get; set; }
public double roll_chance_payout { get; set; }
public string hms_stamp { get; set; }
public double roll_bet_number { get; set; }
public long stx_amount { get; set; }
public long stx_payout { get; set; }
public string hash { get; set; }
#endregion
}
public class DaDiceAjaxBalance
{
#region Atributos
public long stx { get; set; }
public double btc { get; set; }
public int transaction { get; set; }
#endregion
}
#endregion
#region Da Dice API Classes
public class DaDiceAPIBalance
{
#region Atributos
public bool status { get; set; }
public double balance { get; set; }
public string error { get; set; }
#endregion
}
public class DaDiceAPIRoll
{
#region Atributos
public bool status { get; set; }
public double balance { get; set; }
public string error { get; set; }
public DaDiceAPIRollData roll { get; set; }
#endregion
}
public class DaDiceAPIRollData
{
#region Atributos
public string id { get; set; }
public string status { get; set; }
public double amount { get; set; }
public double payout { get; set; }
public int nonce { get; set; }
public double result { get; set; }
public string bet { get; set; }
public double chance { get; set; }
public string timestamp { get; set; }
#endregion
}
#endregion
#region Da Dice Generic Classes
public class DaDiceTip
{
#region Atributos
public bool status { get; set; }
public string error { get; set; }
public List<string> message { get; set; }
#endregion
}
#endregion
#endregion
#region BetterBets Classes
#region BetterBets API Classes
#region Balance
public class BetterBetsAPIBalance
{
public string error { get; set; }
public string errorCode { get; set; }
public string errorMsg { get; set; }
public string id { get; set; }
public string api_enable { get; set; }
public string active_bet_dice { get; set; }
public string active_bet_horse { get; set; }
public string active_bet_plinko { get; set; }
public string balance { get; set; }
public string alias { get; set; }
public string vip_level { get; set; }
public string vip_granted { get; set; }
public string time_created { get; set; }
public string time_last_active { get; set; }
public string access_token_api { get; set; }
public string conf_token_mp_hash { get; set; }
public string login_ip { get; set; }
public string client_seed { get; set; }
public string client_seed_sequence { get; set; }
public string client_seed_date { get; set; }
public string server_seed { get; set; }
public string last_server_seed { get; set; }
public string weekly_bets { get; set; }
public string weekly_wagered { get; set; }
public string weekly_he_amount { get; set; }
public string total_bets { get; set; }
public string total_wagered { get; set; }
public string total_wagered_lf { get; set; }
public string total_wins { get; set; }
public string total_profit { get; set; }
}
#endregion
#region Roll
public class BetterBetsAPIRoll
{
public string error { get; set; }
public string errorCode { get; set; }
public string errorMsg { get; set; }
public string win { get; set; }
public string balanceOrig { get; set; }
public string balance { get; set; }
public string wager { get; set; }
public string profit { get; set; }
public string lfNotified { get; set; }
public string lfActive { get; set; }
public string lfMaxBetAmt { get; set; }
public string lfMaturityPercent { get; set; }
public string lfActivePercent { get; set; }
public string version { get; set; }
public string maintenance { get; set; }
public string happyHour { get; set; }
public string direction { get; set; }
public string target { get; set; }
public string result { get; set; }
public string clientSeed { get; set; }
public string serverSeed { get; set; }
public string nextServerSeed { get; set; }
public string betId { get; set; }
public string betIdMP { get; set; }
}
#endregion
#region Tip
public class BetterBetsAPITip
{
public int error { get; set; }
public string errorCode { get; set; }
public string errorMsg { get; set; }
public int success { get; set; }
public string balance { get; set; }
public float version { get; set; }
public int maintenance { get; set; }
public int happyHour { get; set; }
}
#endregion
#region Seed
public class BetterBetsAPISeed
{
public string error { get; set; }
public string errorCode { get; set; }
public string errorMsg { get; set; }
public string newSeed { get; set; }
}
#endregion
#endregion
#endregion
#region Primedice Classes
#region Login Class
public class PrimediceAPILogin
{
public object privilege { get; set; }
public string access_token { get; set; }
}
#endregion
#region Userdata Class
public class PrimeDiceAPIUserdata
{
public PrimeDiceAPIUserdataUser user { get; set; }
public PrimeDiceAPIUserDataMeta meta { get; set; }
}
public class PrimeDiceAPIUserdataUser
{
public long id { get; set; }
public string userid { get; set; }
public string username { get; set; }
public double balance { get; set; }
public bool password { get; set; }
public string address { get; set; }
public DateTime registered { get; set; }
public bool otp_enabled { get; set; }
public bool email_enabled { get; set; }
public bool address_enabled { get; set; }
public int wagered { get; set; }
public double profit { get; set; }
public int bets { get; set; }
public int wins { get; set; }
public int losses { get; set; }
public int win_risk { get; set; }
public int lose_risk { get; set; }
public int messages { get; set; }
public int referred { get; set; }
public int affiliate_total { get; set; }
public int nonce { get; set; }
public string client { get; set; }
public string previous_server { get; set; }
public string previous_client { get; set; }
public string previous_server_hashed { get; set; }
public string next_seed { get; set; }
public string server { get; set; }
public string otp_token { get; set; }
public string otp_qr { get; set; }
}
public class PrimeDiceAPIUserDataMeta
{
public bool blocked { get; set; }
}
#endregion
#region Roll Class
public class PrimeDiceAPIRoll
{
public PrimeDiceAPIRollBet bet { get; set; }
public PrimeDiceAPIUserdataUser user { get; set; }
}
public class PrimeDiceAPIRollBet
{
public long id { get; set; }
public string player { get; set; }
public string player_id { get; set; }
public double amount { get; set; }
public double target { get; set; }
public double profit { get; set; }
public bool win { get; set; }
public string condition { get; set; }
public double roll { get; set; }
public long nonce { get; set; }
public string client { get; set; }
public double multiplier { get; set; }
public DateTime timestamp { get; set; }
public bool jackpot { get; set; }
public string server { get; set; }
public bool revealed { get; set; }
}
#endregion
#endregion
#region Generic Classes
public class GenericCheck
{
public bool status { get; set; }
public string error { get; set; }
public string username { get; set; }
}
public class GenericBalance
{
public bool status { get; set; }
public string error { get; set; }
public double balance { get; set; }
}
public class GenericRoll
{
public bool status { get; set; }
public string error { get; set; }
public double balance { get; set; }
public GenericRollData data { get; set; }
}
public class GenericRollData
{
#region Atributos
public string status { get; set; }
public double amount { get; set; }
public double payout { get; set; }
public double profit { get; set; }
public double result { get; set; }
public string bet { get; set; }
public double chance { get; set; }
public string id { get; set; }
#endregion
}
public class GenericDataGrid
{
#region Atributos
public string status { get; set; }
public string amount { get; set; }
public string payout { get; set; }
public string profit { get; set; }
public double result { get; set; }
public string bet { get; set; }
public string chance { get; set; }
public string id { get; set; }
public string hour { get; set; }
#endregion
}
#endregion
#region Strat Database Classes
public class Strats
{
public Strategy[] strategies { get; set; }
}
public class Strategy
{
public string name { get; set; }
public string description { get; set; }
public string author { get; set; }
public string minbalance { get; set; }
public string totalbets { get; set; }
public string profit { get; set; }
public string biggestwinstreak { get; set; }
public string biggestlossstreak { get; set; }
public override string ToString()
{
return $"{System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(name))} [by {author}]";
}
}
#endregion
#region UIHelper
public static class UIHelpers
{
#region find parent
/// <summary>
/// Finds a parent of a given item on the visual tree.
/// </summary>
/// <typeparam name="T">The type of the queried item.</typeparam>
/// <param name="child">A direct or indirect child of the
/// queried item.</param>
/// <returns>The first parent item that matches the submitted
/// type parameter. If not matching item can be found, a null
/// reference is being returned.</returns>
public static T TryFindParent<T>(DependencyObject child)
where T : DependencyObject
{
//get parent item
DependencyObject parentObject = GetParentObject(child);
//we've reached the end of the tree
if (parentObject == null) return null;
//check if the parent matches the type we're looking for
T parent = parentObject as T;
if (parent != null)
{
return parent;
}
else
{
//use recursion to proceed with next level
return TryFindParent<T>(parentObject);
}
}
/// <summary>
/// This method is an alternative to WPF's
/// <see cref="VisualTreeHelper.GetParent"/> method, which also
/// supports content elements. Do note, that for content element,
/// this method falls back to the logical tree of the element.
/// </summary>
/// <param name="child">The item to be processed.</param>
/// <returns>The submitted item's parent, if available. Otherwise
/// null.</returns>
public static DependencyObject GetParentObject(DependencyObject child)
{
if (child == null) return null;
ContentElement contentElement = child as ContentElement;
if (contentElement != null)
{
DependencyObject parent = ContentOperations.GetParent(contentElement);
if (parent != null) return parent;
FrameworkContentElement fce = contentElement as FrameworkContentElement;
return fce != null ? fce.Parent : null;
}
//if it's not a ContentElement, rely on VisualTreeHelper
return VisualTreeHelper.GetParent(child);
}
#endregion
#region update binding sources
/// <summary>
/// Recursively processes a given dependency object and all its
/// children, and updates sources of all objects that use a
/// binding expression on a given property.
/// </summary>
/// <param name="obj">The dependency object that marks a starting
/// point. This could be a dialog window or a panel control that
/// hosts bound controls.</param>
/// <param name="properties">The properties to be updated if
/// <paramref name="obj"/> or one of its childs provide it along
/// with a binding expression.</param>
public static void UpdateBindingSources(DependencyObject obj,
params DependencyProperty[] properties)
{
foreach (DependencyProperty depProperty in properties)
{
//check whether the submitted object provides a bound property
//that matches the property parameters
BindingExpression be = BindingOperations.GetBindingExpression(obj, depProperty);
if (be != null) be.UpdateSource();
}
int count = VisualTreeHelper.GetChildrenCount(obj);
for (int i = 0; i < count; i++)
{
//process child items recursively
DependencyObject childObject = VisualTreeHelper.GetChild(obj, i);
UpdateBindingSources(childObject, properties);
}
}
#endregion
/// <summary>
/// Tries to locate a given item within the visual tree,
/// starting with the dependency object at a given position.
/// </summary>
/// <typeparam name="T">The type of the element to be found
/// on the visual tree of the element at the given location.</typeparam>
/// <param name="reference">The main element which is used to perform
/// hit testing.</param>
/// <param name="point">The position to be evaluated on the origin.</param>
public static T TryFindFromPoint<T>(UIElement reference, Point point)
where T : DependencyObject
{
DependencyObject element = reference.InputHitTest(point)
as DependencyObject;
if (element == null) return null;
else if (element is T) return (T)element;
else return TryFindParent<T>(element);
}
}
#endregion
}