-
Notifications
You must be signed in to change notification settings - Fork 2
/
Messaging.cs
56 lines (47 loc) · 1.68 KB
/
Messaging.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
//using System;
//using System.Collections.Generic;
//using System.Text;
//using System.Net;
//namespace TreeStats
//{
// public static class Messaging
// {
// public static void SendEncrypted(string original)
// {
// Logging.LogMessage("SendEncrypted() Called");
// // Take in message
// // Verify it is a string with a closing }
// // Encrypt it
// // Send it
// int curly_position = original.LastIndexOf("}");
// Logging.LogMessage("Curly position is " + curly_position);
// if (curly_position == original.Length - 1)
// {
// Logging.LogMessage("position is at length - 1");
// }
// else
// {
// Logging.LogMessage("position is not at length -1");
// }
// string encrypted = Encryption.encrypt(original);
// Logging.LogMessage("Encrypted string...");
// Logging.LogMessage(encrypted);
// Logging.LogMessage("Sending encrypted message");
// using (var client = new WebClient())
// {
// client.UploadStringCompleted += (s, e) =>
// {
// if (e.Error != null)
// {
// Util.WriteToChat("Upload Error: " + e.Error.Message);
// }
// else
// {
// Util.WriteToChat(e.Result);
// }
// };
// client.UploadStringAsync(new Uri("http://treestats-staging.herokuapp.com/message"), "POST", encrypted);
// }
// }
// }
//}