void Bot_OnKick(Network network, Murphy.Irc.KickEventArgs e) { if (e.Data.Nick == network.Nickname) { Console.WriteLine("Rejoining " + e.Channel + " on " + network.Name + "."); network.RfcJoin(e.Channel); } }
internal static void SpawnMurphy(GameLocation location) { if (location is IslandSouthEast) { murphyNPC = new Murphy(new AnimatedSprite(ModResources.murphyTexturePath, 0, 16, 32), new Vector2(12.05f, 39.5f) * 64f, 2, i18n.Get("etc.murphy_name"), ModResources.murphyPortraitTexture); } else { murphyNPC = new Murphy(new AnimatedSprite(ModResources.murphyTexturePath, 0, 16, 32), new Vector2(89f, 38.5f) * 64f, 2, i18n.Get("etc.murphy_name"), ModResources.murphyPortraitTexture); } }
void Bot_OnPrivateMessage(Network n, Murphy.Irc.IrcEventArgs e) { if (e.Data.Message.StartsWith(BOT_CONTROL_SEQ)) { string mes = e.Data.Message.Substring(1).Split(' ')[0].ToLower(); bool isadmin = false; //Process Admin Commands if (Bot.isAdmin(e.Data.Nick)) { switch (mes) { case "ping": isadmin = true; break; } } //Process Normal Commands if (!isadmin) { switch (mes) { case "set": validate(n, e); break; default: //Answer(n, e, "I do not know that command, " + e.Data.Nick); break; } } } }
void Bot_OnChannelMessage(Network n, Murphy.Irc.IrcEventArgs e) { if (e.Data.Message.StartsWith(BOT_CONTROL_SEQ)) { string mes = e.Data.Message.Substring(1).Split(' ')[0].ToLower(); bool isadmin = false; //Process Admin Commands if (Bot.isAdmin(e.Data.Nick)) { switch (mes) { case "ping": isadmin = true; break; } } //Process Normal Commands if (!isadmin) { switch (mes) { case "help": help(n, e); break; case "infotypes": infotypes(n, e); break; case "set": Answer(n, e, "OOPS!, " + e.Data.Nick +" you really should do that in private! (try adding /msg to the beginning)"); break; default: //Answer(n, e, "I do not know that command, " + e.Data.Nick); break; } } } }
protected void validate(Network n, Murphy.Irc.IrcEventArgs e) { if (Bot.isLoggedIn(e.Data.Nick)) { if (IsMatch("^set (?<infotype>.*?) (?<info>.*?)$", e.Data.Message.Substring(BOT_CONTROL_SEQ.Length))) { //TODO! Check the InfoType is valid - for now accept invalis ones DataRow user = getAccount(e.Data.Nick); string encdata=enc.Encrypt(Matches["info"].Value); Dictionary<String, String> account = new Dictionary<string, string>(); account.Add("account_id", user["ID"].ToString()); account.Add("validation_type", Matches["infotype"].Value); account.Add("validation", encdata); db.Insert("validation", account); AnswerWithNotice(n, e, String.Format("Your information for "+ FormatBold("{0}")+" was successfully set. A moderator will validate this information shortly. Your registered email will be used as a point of contact for the validation process.", Matches["infotype"].Value)); } else { AnswerWithNotice(n, e, FormatBold(String.Format("Command Usage: {0}set <INFOTYPE> <VALUE>", BOT_CONTROL_SEQ))); } } else { AnswerWithNotice(n, e, FormatBold(String.Format("{0}set can only be performed by a logged user. Command Usage: {0}set <INFOTYPE> <VALUE>", BOT_CONTROL_SEQ))); } }
protected void infotypes(Network n, Murphy.Irc.IrcEventArgs e) { DataTable types; String query = "SELECT id \"ID\", validation_type \"TYPE\", description \"DESCRIPTION\" FROM validation_type;"; types = db.GetDataTable(query); AnswerWithNotice(n, e, FormatBold("____________________________ ACCEPTED INFORMATION TYPES ____________________________ ")); AnswerWithNotice(n, e, String.Format(" <INFOTYPE> <DESCRIPTION>",BOT_CONTROL_SEQ)); foreach (DataRow type in types.Rows) { AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}") + " {1}", type["TYPE"], type["DESCRIPTION"])); } }
protected void help(Network n, Murphy.Irc.IrcEventArgs e) { AnswerWithNotice(n, e, FormatBold(String.Format("_______________________________________________________________________________________", BOT_CONTROL_SEQ))); AnswerWithNotice(n, e, FormatBold(String.Format(" W3LCOME TO THE BITCOIN REPUTATION MANAGEMENT SYSTEM ", BOT_CONTROL_SEQ))); //AnswerWithNotice(n, e, String.Format(" ", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" After registering your Business and GpG key with the system, you may login and manage the information used to provide a trust rating for your business.", BOT_CONTROL_SEQ)); //AnswerWithNotice(n, e, FormatBold(String.Format(" ", BOT_CONTROL_SEQ))); AnswerWithNotice(n, e, String.Format(" " + FormatUnderlined("WHY REGISTER YOUR INFORMATION?"), BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" Each piece of verifiable, identifying information that you provide is used by our system to generate an overall 'Trust Rating' for your business. The more information you provide, the more accurately the Trust Rating we calculate will represent you.", BOT_CONTROL_SEQ)); //AnswerWithNotice(n, e, String.Format(" ", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" Members of the Bitcoin community will be able to request your trust rating and view a profile of your business that ONLY REVEALS which types of information you have or", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" have not provided. This, coupled with our Trust Rating (which also utilises infoavailable to the public such as Domain Registration) will allow users to decide their own trust ratings amongst businesses and peers.", BOT_CONTROL_SEQ)); //AnswerWithNotice(n, e, String.Format(" ", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold(FormatUnderlined("Commands:")), BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}help") + " - Shows this help screen", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}set <INFOTYPE> <VALUE>") + " - registers a piece of info to your account of the type <INFOTYPE> ***PRIVATE MESSAGE", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}del <INFOTYPE>") + " - deletes a piece of info from your account of the type <INFOTYPE>", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}infotypes") + " - Lists all of the available information types accepted", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}profile") + " - Shows your complete profile to you via Private notice", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}profile <name>") + " - Shows the public profile for <name>", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}rank <name>") + " - Calculates the Trust Ranking for <name>", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, FormatBold(String.Format("_______________________________________________________________________________________", BOT_CONTROL_SEQ))); }
protected void help(Network n, Murphy.Irc.IrcEventArgs e) { AnswerWithNotice(n, e, FormatBold(String.Format("_______________________________________________________________________________________", BOT_CONTROL_SEQ))); AnswerWithNotice(n, e, FormatBold(String.Format(" IDENTITY VERIFICATION COMMANDS ", BOT_CONTROL_SEQ))); AnswerWithNotice(n, e, String.Format(" " + FormatBold(FormatUnderlined("Commands:")), BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}help") + " - Shows this help screen", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}register <BusinessNick> <GpGKey>") + " - registers a business nick as having the GpG key specified", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}eauth <?BusinessNick>") + " - authenticates you as the (optional) nick by creating a One-Time pawword for you to decrypt with your GpG key", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}setemail <email>") + " - sets the registered email for your logged in nick", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}email") + " - performs a pseudo-2-factor login via email", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}bizident <?name>") + " - Shows the login details for (optional) <name> or the requestor", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, String.Format(" " + FormatBold("{0}logout") + " - logs your identity out of the system", BOT_CONTROL_SEQ)); AnswerWithNotice(n, e, FormatBold(String.Format("_______________________________________________________________________________________", BOT_CONTROL_SEQ))); }
void Bot_OnDeop(Network n, Murphy.Irc.DeopEventArgs e) { Op(n, GetFullUser(n, e.Whom), e.Whom, e.Data.Channel); }
internal static void SpawnMurphy() { murphyNPC = new Murphy(new AnimatedSprite(ModResources.murphyTexturePath, 0, 16, 32), new Vector2(89f, 38.5f) * 64f, 2, "Murphy", ModResources.murphyPortraitTexture); }