summaryrefslogtreecommitdiff
path: root/DSACore
diff options
context:
space:
mode:
Diffstat (limited to 'DSACore')
-rw-r--r--DSACore/Auxiliary/WeaponImporter.cs2
-rw-r--r--DSACore/DSA_Game/Dsa.cs9
-rw-r--r--DSACore/Hubs/ChatHub.cs15
3 files changed, 17 insertions, 9 deletions
diff --git a/DSACore/Auxiliary/WeaponImporter.cs b/DSACore/Auxiliary/WeaponImporter.cs
index 7a5a182..8ed2b3f 100644
--- a/DSACore/Auxiliary/WeaponImporter.cs
+++ b/DSACore/Auxiliary/WeaponImporter.cs
@@ -21,7 +21,7 @@ namespace DSACore.Auxiliary
- for (int i = 18; i <= 25; i++)
+ for (int i = 1; i <= 25; i++)
{
var responseString = await client.GetStringAsync("http://diarium.eu/dsa4-forge/ajax/categoryChanged/" + i);
diff --git a/DSACore/DSA_Game/Dsa.cs b/DSACore/DSA_Game/Dsa.cs
index 9602791..3b2e4aa 100644
--- a/DSACore/DSA_Game/Dsa.cs
+++ b/DSACore/DSA_Game/Dsa.cs
@@ -15,8 +15,11 @@ namespace DSACore.DSA_Game
public static class Dsa
{
+#if DEBUG
public const string rootPath = "C:\\Users\\Dennis\\Source\\Repos\\DiscoBot\\DSACore\\";//"DiscoBot\\DSACore\\";
-
+#else
+ public const string rootPath = "";//"DiscoBot\\DSACore\\";
+#endif
private static Session s_session;
public static List<ICharacter> Chars { get; set; } = new List<ICharacter>(); // list of all characters
@@ -48,7 +51,7 @@ namespace DSACore.DSA_Game
//new .Auxiliary.Calculator.StringSolver("1d100 - (1d200 + 1) * -50000").Solve();
/*Session = new Session();*/
// relation.Add("Papo", "Pump aus der Gosse");
- foreach (var filename in Directory.GetFiles(rootPath + "helden", "*.xml"))
+ /*foreach (var filename in Directory.GetFiles(rootPath + "helden", "*.xml"))
{
Chars.Add(new Character(filename));
(Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0))
@@ -56,9 +59,11 @@ namespace DSACore.DSA_Game
(Chars.Last() as Character)?.Zauber.Select(x => new Zauber(x.Name, x.Probe, 0, x.Complexity))
.Where(c => !Zauber.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Zauber.Add(v));
}
+*/
Properties.Deserialize(rootPath+"Properties");
Properties.Serialize(rootPath + "Properties");
+
Talente = Talente.OrderBy(x => x.Name).ToList();
Zauber = Zauber.OrderBy(x => x.Name).ToList();
diff --git a/DSACore/Hubs/ChatHub.cs b/DSACore/Hubs/ChatHub.cs
index 42e6d91..3e83a34 100644
--- a/DSACore/Hubs/ChatHub.cs
+++ b/DSACore/Hubs/ChatHub.cs
@@ -15,6 +15,8 @@ namespace DSACore.Hubs
public class ChatHub : Hub
{
//private static Dictionary<string, User> UserGroup = new Dictionary<string, User>();
+
+ private const string receiveMethod = "ReceiveMessage";//receiveMethod;
private static List<Group> DSAGroups = new List<Group>();
@@ -42,7 +44,7 @@ namespace DSACore.Hubs
}
catch (InvalidOperationException e)
{
- //await Clients.Caller.SendCoreAsync("RecieveMessage",
+ //await Clients.Caller.SendCoreAsync(receiveMethod,
// new object[] { "Nutzer ist in keiner Gruppe. Erst joinen!" });
}
@@ -50,6 +52,7 @@ namespace DSACore.Hubs
{
var args = message.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList();
+ bool Timon = args.Any(x => x == "hallo");
var ident = args.First().Replace("/", "");
if (args.Count > 0)
@@ -69,7 +72,7 @@ namespace DSACore.Hubs
{
case ResponseType.Caller:
case ResponseType.Error:
- await Clients.Caller.SendAsync("RecieveMessage", ret.message);
+ await Clients.Caller.SendAsync(receiveMethod, ret.message);
break;
case ResponseType.Broadcast:
await SendToGroup(ret.message);
@@ -90,12 +93,12 @@ namespace DSACore.Hubs
try
{
string group = getGroup(Context.ConnectionId).Name;
- return Clients.Group(group).SendCoreAsync("RecieveMessage",
+ return Clients.Group(group).SendCoreAsync(receiveMethod,
new object[] {getUser(Context.ConnectionId).Name, message});
}
catch (InvalidOperationException e)
{
- return Clients.Caller.SendCoreAsync("RecieveMessage",
+ return Clients.Caller.SendCoreAsync(receiveMethod,
new object[] { "Nutzer ist in keiner Gruppe. Erst joinen!" });
}
}
@@ -131,7 +134,7 @@ namespace DSACore.Hubs
DSAGroups.Add(new Group(group, password));
var Dgroup = new DSACore.Models.Database.Group { Name = group, Id = DSAGroups.Count - 1 };
//Database.AddGroup(Dgroup);
- await Clients.Caller.SendCoreAsync("RecieveMessage", new[] { $"group {@group} sucessfully added" });
+ await Clients.Caller.SendCoreAsync(receiveMethod, new[] { $"group {@group} sucessfully added" });
//throw new NotImplementedException("add database call to add groups");
}
@@ -166,7 +169,7 @@ namespace DSACore.Hubs
else
{
await Clients.Caller.SendAsync("LoginResponse", 2);
- //await Clients.Caller.SendAsync("RecieveMessage", "Falsches Passwort!");
+ //await Clients.Caller.SendAsync(receiveMethod, "Falsches Passwort!");
}
}