Skip to content

Commit 9b6254b

Browse files
committed
Fix rooms option in triggers, fix [unassigned] name (hopefully)
1 parent 7971f1d commit 9b6254b

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

SteamChatBot/Bot.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ private static void SubForCB()
244244
manager.Subscribe<SteamUser.LoggedOnCallback>(OnLoggedOn);
245245
manager.Subscribe<SteamUser.LoggedOffCallback>(OnLoggedOff);
246246
manager.Subscribe<SteamUser.UpdateMachineAuthCallback>(OnUpdateMachineAuth);
247+
manager.Subscribe<SteamUser.LoginKeyCallback>(OnLoginKeyCallback);
247248

248249
manager.Subscribe<SteamFriends.ChatMsgCallback>(OnChatMsg);
249250
manager.Subscribe<SteamFriends.FriendMsgCallback>(OnFriendMsg);
@@ -254,6 +255,12 @@ private static void SubForCB()
254255
Log.Instance.Silly("Callback managers subscribed");
255256
}
256257

258+
private static void OnLoginKeyCallback(SteamUser.LoginKeyCallback callback)
259+
{
260+
steamFriends.SetPersonaState(EPersonaState.Online);
261+
steamFriends.SetPersonaName(displayName);
262+
}
263+
257264
private static void OnFriendMsg(SteamFriends.FriendMsgCallback callback)
258265
{
259266
if (callback.EntryType == EChatEntryType.ChatMsg)
@@ -333,8 +340,6 @@ private static void OnLoggedOn(SteamUser.LoggedOnCallback callback)
333340
if (callback.Result == EResult.OK)
334341
{
335342
Log.Instance.Info("Logged in!");
336-
steamFriends.SetPersonaState(EPersonaState.Online);
337-
steamFriends.SetPersonaName(displayName);
338343
foreach (BaseTrigger trigger in triggers)
339344
{
340345
trigger.OnLoggedOn();

SteamChatBot/Triggers/BaseTrigger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,12 @@ protected bool CheckRoom(SteamID toID)
940940
for (int i = 0; i < rooms.Count; i++)
941941
{
942942
SteamID room = rooms[i];
943-
if (toID == room)
943+
if (toID == SteamHelper.ToChatID(room))
944944
{
945945
return true;
946946
}
947947
}
948-
return true;
948+
return false;
949949
}
950950
}
951951

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 != "") NTO.SaveTimer = Convert.ToInt32(saveTimerBox.Text);
52+
if (saveTimerBox.Text != "" || Convert.ToInt32(saveTimerBox.Text) == 0) 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)