Skip to content

Commit 2e35e99

Browse files
committed
Bug fixes
1 parent d2b8374 commit 2e35e99

5 files changed

Lines changed: 10 additions & 12 deletions

File tree

SteamChatBot/Bot.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ private static void OnLoggedOn(SteamUser.LoggedOnCallback callback)
339339
if (callback.Result == EResult.OK)
340340
{
341341
Log.Instance.Info("Logged in!");
342+
steamFriends.SetPersonaState(EPersonaState.Online);
343+
steamFriends.SetPersonaName(displayName);
342344
foreach (BaseTrigger trigger in triggers)
343345
{
344346
trigger.OnLoggedOn();

SteamChatBot/Triggers/AcceptChatInviteTrigger.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,14 @@ public AcceptChatInviteTrigger(TriggerType type, string name, TriggerOptionsBase
1717

1818
public override bool respondToChatInvite(SteamID roomID, string roomName, SteamID inviterId)
1919
{
20-
if(Options.TriggerLists.Rooms == null)
20+
if (Options.TriggerLists.Rooms.Contains(roomID) || Options.TriggerLists.Rooms == null || Options.TriggerLists.Rooms.Count == 0)
2121
{
2222
Bot.steamFriends.JoinChat(roomID);
2323
return true;
2424
}
2525
else
2626
{
27-
if (Options.TriggerLists.Rooms.Contains(roomID))
28-
{
29-
Bot.steamFriends.JoinChat(roomID);
30-
return true;
31-
}
32-
else
33-
{
34-
return false;
35-
}
27+
return false;
3628
}
3729
}
3830
}

SteamChatBot/Triggers/NoteTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private void SaveNoteTimer_Elapsed(object sender, ElapsedEventArgs e)
2626
{
2727
string json = JsonConvert.SerializeObject(Options.NoteTriggerOptions.Notes);
2828
File.WriteAllText(Options.NoteTriggerOptions.NoteFile, json);
29-
Log.Instance.Silly("{0}/{1}: Wrote notes to {0}/notes.json", Bot.username, Name);
29+
Log.Instance.Silly("{0}/{1}: Wrote notes to {2}", Bot.username, Name, Options.NoteTriggerOptions.NoteFile);
3030
}
3131

3232
public override bool onLoggedOn()

SteamChatBot/Triggers/NotificationTrigger.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public override bool onLoggedOn()
3636
{
3737
try
3838
{
39+
if (Options.NotificationOptions.DBFile == AppDomain.CurrentDomain.BaseDirectory + "/notification.json")
40+
{
41+
Options.NotificationOptions.DBFile = Bot.username + "/notification.json";
42+
}
3943
Options.NotificationOptions.DB = JsonConvert.DeserializeObject<Dictionary<ulong, DB>>(File.ReadAllText(Options.NotificationOptions.DBFile));
4044
Log.Instance.Silly("{0}/{1}: Read db from {2}", Bot.username, Name, Options.NotificationOptions.DBFile);
4145
}

SteamChatBot/Triggers/TriggerOptions/Windows/NoteTriggerOptionsWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void doneButton_Click(object sender, RoutedEventArgs e)
4949
if (noteCommandBox.Text != "") NTO.NoteCommand = noteCommandBox.Text;
5050
if (infoCommandBox.Text != "") NTO.InfoCommand = infoCommandBox.Text;
5151
if (deleteCommandBox.Text != "") NTO.DeleteCommand = deleteCommandBox.Text;
52-
if (saveTimerBox.Text != "" || Convert.ToInt32(saveTimerBox.Text) == 0) NTO.SaveTimer = Convert.ToInt32(saveTimerBox.Text);
52+
if (saveTimerBox.Text != "") NTO.SaveTimer = Convert.ToInt32(saveTimerBox.Text);
5353
if (noteFileBox.Text != "") NTO.NoteFile = noteFileBox.Text;
5454
if (notesCommandBox.Text != "") NTO.NotesCommand = notesCommandBox.Text;
5555

0 commit comments

Comments
 (0)