public void deliver() { StringBuilder sb1 = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); foreach (ulong id in Conversation.Participants) { Profile profile = ProfileData.getProfile(id); BasePlayer player = profile.Player; if (player == Sender) { continue; } player.ChatMessage(string.Format(PluginInstance.lang.GetMessage(msg.message.ToString(), PluginInstance), SenderName, Content)); profile.lastConversation = Conversation.ID; sb1.Append($" {player.displayName}[{player.userID}]"); sb2.Append($"\n{player.displayName}({profile.Status})"); } string logEntry = $"{DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")} {SenderName}[{SenderID}] -> [{sb1.ToString().Trim()}]: \"{Content}\""; PluginInstance.Puts(logEntry); PluginInstance.LogToFile("Messages", logEntry, PluginInstance); PluginInstance.PrintToChat(Sender, PluginInstance.lang.GetMessage(msg.messageSent.ToString(), PluginInstance, Sender.UserIDString), Content, sb2); //Sender.ChatMessage($"Message: {Content} \ndelivered to {sb2}"); }
public Hunt(Bounty bounty, BasePlayer hunter) { if (bounty.hunt != null) { PluginInstance.Puts($"Hunt Constructor: Bounty {bounty.placerName} -> {bounty.targetName} already has an ongoing hunt!"); } timestamp = DateTime.Now; this.bounty = bounty; hunterID = hunter.userID; hunterName = hunter.displayName; initTicker(); PluginInstance.sendHunterIndicator(hunter, this); PluginInstance.sendTargetIndicator(target, this); HuntData.addHunt(this); if (PluginInstance.hasPermission(hunter, permissions.mask)) { hunter.ChatMessage("<color=#00ff33>Hunt started!</color> Remember that you can use /mask and /unmask to randomize your name for some extra stealth!"); } PluginInstance.LogToFile(huntLogFileName, $"{DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")} Hunt started: {hunter.displayName}[{hunter.UserIDString}] hunting {target.displayName}[{target.UserIDString}], placed by {bounty.placerName}[{bounty.placerID}]", PluginInstance); }
public Bounty(BasePlayer placer, BasePlayer target, int reward, string reason) { timestamp = DateTime.Now; placerID = placer.userID; placerName = placer.displayName; targetID = target.userID; targetName = target.displayName; rewardAmount = reward; this.reason = reason; noteUid = giveNote(placer); if (config.showSteamImage) { PluginInstance.GetSteamUserData(targetID, (ps) => PluginInstance.guiCreator.registerImage(PluginInstance, targetID.ToString(), ps.avatarfull) ); } BountyData.AddBounty(this); PluginInstance.LogToFile(bountyLogFileName, $"{DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")} {placerName}[{placerID}] placed a bounty of {rewardAmount} {config.currency} on {targetName}[{targetID}]'s head. Reason: {reason}", PluginInstance); }