-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from Asnivor/dev
0.5.8.0 Release
- Loading branch information
Showing
45 changed files
with
1,908 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Documents; | ||
|
||
namespace MedLaunch.Classes.MednaNet | ||
{ | ||
public class DiscordChannels | ||
{ | ||
public List<DiscordChannel> Data { get; set; } | ||
public int ActiveChannel { get; set; } | ||
|
||
public DiscordChannels() | ||
{ | ||
Data = new List<DiscordChannel>(); | ||
|
||
Data = new List<DiscordChannel> | ||
{ | ||
new DiscordChannel() | ||
{ | ||
ChannelId = 1, | ||
ChannelName = "general", | ||
Paragraph = new Paragraph() | ||
}, | ||
new DiscordChannel() | ||
{ | ||
ChannelId = 5, | ||
ChannelName = "support", | ||
Paragraph = new Paragraph() | ||
}, | ||
new DiscordChannel() | ||
{ | ||
ChannelId = 2, | ||
ChannelName = "notifications", | ||
Paragraph = new Paragraph() | ||
}, | ||
new DiscordChannel() | ||
{ | ||
ChannelId = 3, | ||
ChannelName = "netplay", | ||
Paragraph = new Paragraph() | ||
}, | ||
new DiscordChannel() | ||
{ | ||
ChannelId = 4, | ||
ChannelName = "development", | ||
Paragraph = new Paragraph() | ||
}, | ||
|
||
|
||
}; | ||
|
||
/* | ||
// temp data | ||
for (int i = 1; i < 6; i++) | ||
{ | ||
DiscordChannel d = new DiscordChannel(); | ||
d.ChannelId = i; | ||
d.ChannelName = "Dynamic Channel " + i; | ||
d.Paragraph = new Paragraph(); | ||
Data.Add(d); | ||
} | ||
*/ | ||
} | ||
|
||
/// <summary> | ||
/// Adds or Updates specific discord channel data | ||
/// </summary> | ||
/// <param name="id"></param> | ||
/// <param name="name"></param> | ||
/// <param name="paragraph"></param> | ||
public void UpdateChannel(int id, string name, Paragraph paragraph) | ||
{ | ||
var lookup = Data.Where(a => a.ChannelId == id).FirstOrDefault(); | ||
|
||
if (lookup == null) | ||
{ | ||
// channel does not exist - add it to the collection | ||
DiscordChannel dc = new DiscordChannel(); | ||
dc.ChannelId = id; | ||
dc.ChannelName = name; | ||
dc.Paragraph = new Paragraph(); | ||
Data.Add(dc); | ||
} | ||
else | ||
{ | ||
// channel already exists - update the paragraph | ||
lookup.ChannelName = name; | ||
lookup.Paragraph = paragraph; | ||
} | ||
} | ||
} | ||
|
||
public class DiscordChannel | ||
{ | ||
public int ChannelId { get; set; } | ||
public string ChannelName { get; set; } | ||
public Paragraph Paragraph { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MedLaunch.Classes.MednaNet | ||
{ | ||
public class DiscordMessage | ||
{ | ||
public int messageId { get; set; } | ||
public string code { get; set; } | ||
public string message { get; set; } | ||
public DateTime postedOn { get; set; } | ||
public string name { get; set; } | ||
public int channel { get; set; } | ||
public int userId { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MedLaunch.Classes.MednaNet | ||
{ | ||
public class DiscordUsers | ||
{ | ||
public List<DiscordUser> Users { get; set; } | ||
|
||
public DiscordUsers() | ||
{ | ||
Users = new List<DiscordUser>(); | ||
|
||
// temp data | ||
Users = new List<DiscordUser> | ||
{ | ||
new DiscordUser() | ||
{ | ||
UserId = 1, | ||
UserName = "D. Hicks", | ||
clientType = ClientType.discord, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 2, | ||
UserName = "W. Hudson", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 3, | ||
UserName = "S. Gorman", | ||
clientType = ClientType.discord, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 4, | ||
UserName = "J. Vasquez", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 100, | ||
UserName = "A. Apone", | ||
clientType = ClientType.discord, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 200, | ||
UserName = "C. Ferro", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 300, | ||
UserName = "M. Drake", | ||
clientType = ClientType.discord, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 37, | ||
UserName = "T. Crowe", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 3004, | ||
UserName = "T. Wierzbowski", | ||
clientType = ClientType.discord, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 375, | ||
UserName = "R. Frost", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
new DiscordUser() | ||
{ | ||
UserId = 37543, | ||
UserName = "D. Spunkmeyer", | ||
clientType = ClientType.medlaunch, | ||
IsOnline = true | ||
}, | ||
}; | ||
} | ||
|
||
public void UpdateUser(int userId, string userName, ClientType clientType, bool isOnline) | ||
{ | ||
var lookup = Users.Where(a => a.UserId == userId).FirstOrDefault(); | ||
|
||
if (lookup == null) | ||
{ | ||
// user does not exist - create | ||
DiscordUser du = new DiscordUser(); | ||
du.UserId = userId; | ||
du.UserName = userName; | ||
du.clientType = clientType; | ||
du.IsOnline = isOnline; | ||
Users.Add(du); | ||
} | ||
else | ||
{ | ||
// user already exists - update | ||
lookup.UserName = userName; | ||
lookup.clientType = clientType; | ||
lookup.IsOnline = isOnline; | ||
} | ||
} | ||
} | ||
|
||
public class DiscordUser | ||
{ | ||
public int UserId { get; set; } | ||
public string UserName { get; set; } | ||
public ClientType clientType { get; set; } | ||
public bool IsOnline { get; set; } | ||
} | ||
|
||
public enum ClientType | ||
{ | ||
medlaunch, | ||
discord | ||
} | ||
} |
Oops, something went wrong.