Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
Init the room before init'ing the db
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticEcho committed Feb 29, 2016
1 parent c3b1ef4 commit a0a8cd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/SOCVR.Chatbot/ChatRoom/RoomManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public void JoinRoom()
ChatBotStats.LoginDate = DateTime.Now;
cvChatRoom.StripMention = true;
cvChatRoom.InitialisePrimaryContentOnly = true;
}

public void ConnectEventDelegates()
{
cvChatRoom.EventManager.ConnectListener(EventType.MessagePosted, new Action<Message>(cvChatRoom_NewMessage));
cvChatRoom.EventManager.ConnectListener(EventType.MessageEdited, new Action<Message>(cvChatRoom_NewMessage));
}
Expand Down
7 changes: 5 additions & 2 deletions source/SOCVR.Chatbot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ static void Main(string[] args)
mng.ShutdownOrderGiven += mng_ShutdownOrderGiven;
mng.InformationMessageBroadcasted += mng_InformationMessageBroadcasted;

InitializeDatbase();

WriteToConsole("Joining room");
mng.JoinRoom();

InitializeDatbase();

WriteToConsole("Connecting chat event listeners");
mng.ConnectEventDelegates();

WriteToConsole("Starting user tracker");
var rm = mng.CvChatRoom;
using (watcher = new UserTracking(ref rm))
Expand Down

0 comments on commit a0a8cd7

Please sign in to comment.