本文整理汇总了C#中Guild类的典型用法代码示例。如果您正苦于以下问题:C# Guild类的具体用法?C# Guild怎么用?C# Guild使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Guild类属于命名空间,在下文中一共展示了Guild类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GuildTitlePrompt
public GuildTitlePrompt( Mobile from, Mobile target, Guild g )
: base(from)
{
m_Mobile = from;
m_Target = target;
m_Guild = g;
}
示例2: Page_Load
//public static GuildRoster ooj = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
if(ooj == null){
RequestXml.basePath = MapPath("./armory/");
RequestData.SqlConnectionString = ""; // Omitted for GitHub
ooj = new Guild("Terenas", "Overlords of Justice");
}
}
//OOJ Roster
//http://www.wowarmory.com/guild-info.xml?r=Terenas&gn=Overlords+of+Justice&rhtml=n
BodyText.Text = ooj.roster.ReturnRoster();
try
{
//BodyText.Text = ooj.ReturnRoster();
}catch
{
BodyText.Text = "Roster is currently loading...";
}
if (this.IsPostBack)
{
}
else { }
}
示例3: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_Guild = reader.ReadGuild() as Guild;
goto case 0;
}
case 0:
{
break;
}
}
if ( m_Guild == null )
{
this.Delete();
}
}
示例4: GuildAllyPrompt
public GuildAllyPrompt( Mobile leader, Guild target, Guild g )
: base(leader)
{
m_Leader = leader;
m_Target = target;
m_Guild = g;
}
示例5: CreateGuild
Guild CreateGuild(CmdTrigger<RealmServerCmdArgs> trigger, string name, CharacterRecord record)
{
var guild = new Guild(record, name);
trigger.Reply("Guild created");
return guild;
}
示例6: SendMessageToGuild
/// <summary>
/// Send message to a guild
/// </summary>
/// <param name="message">The message</param>
/// <param name="guild">The guild</param>
public static void SendMessageToGuild(string message, Guild guild)
{
if (guild == null)
return;
message = "[Guild] [" + message + "]";
guild.SendMessageToGuildMembers(message, eChatType.CT_Guild, eChatLoc.CL_ChatWindow);
}
示例7: GuildEventLogEntry
public GuildEventLogEntry(Guild guild, GuildEventLogEntryType type, int character1LowId, int character2LowId, int newRankId, DateTime timeStamp)
{
GuildId = guild.Id;
Type = type;
Character1LowId = character1LowId;
Character2LowId = character2LowId;
NewRankId = newRankId;
TimeStamp = timeStamp;
}
示例8: ChangeGuild
public Guild ChangeGuild(Account acc, int guildid, int rank, int fame, bool renounce)
{
Guild guild;
if (renounce)
{
guild = new Guild
{
Name = "",
Id = 0,
Rank = 0,
Fame = 0
};
MySqlCommand cmd = CreateQuery();
cmd.CommandText = "UPDATE accounts SET guild=0, guildRank=0, guildFame=0 WHERE [email protected]";
cmd.Parameters.AddWithValue("@aid", acc.AccountId);
if (cmd.ExecuteNonQuery() == 0)
{
throw new Exception("Could not change player's guild in the SQL!");
}
UpdateGuild(guildid);
return guild;
}
else
{
guild = new Guild
{
Id = guildid,
Name = GetGuildName(guildid),
Rank = rank,
Fame = fame
};
if (guild.Name == "")
{
throw new Exception("Guild not found!");
}
MySqlCommand cmd = CreateQuery();
cmd.CommandText = "UPDATE accounts SET [email protected], [email protected], [email protected] WHERE [email protected]";
cmd.Parameters.AddWithValue("@gid", guildid);
cmd.Parameters.AddWithValue("@gr", rank);
cmd.Parameters.AddWithValue("@gf", fame);
cmd.Parameters.AddWithValue("@aid", acc.AccountId);
if (cmd.ExecuteNonQuery() == 0)
{
throw new Exception("Could not change player's guild in the SQL!");
}
UpdateGuild(guildid);
return guild;
}
}
示例9: GuildInfoNoGuild
/// <summary>
/// Sends GuildInfoNoGuild to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="guild"></param>
public static void GuildInfoNoGuild(Creature creature, Guild guild)
{
var packet = new Packet(Op.GuildInfoNoGuild, creature.EntityId);
packet.PutLong(guild.Id);
packet.PutString(guild.Name);
packet.PutString(guild.LeaderName);
packet.PutInt(guild.MemberCount);
packet.PutString(guild.IntroMessage);
creature.Client.Send(packet);
}
示例10: GuildInfoApplied
/// <summary>
/// Sends GuildInfoApplied to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="guild"></param>
public static void GuildInfoApplied(Creature creature, Guild guild)
{
// The fields of this packet were guessed, something might be missing.
var packet = new Packet(Op.GuildInfoApplied, creature.EntityId);
packet.PutLong(guild.Id);
packet.PutString(guild.Server);
packet.PutLong(creature.EntityId);
packet.PutString(guild.Name);
creature.Client.Send(packet);
}
示例11: GuildEventLog
internal GuildEventLog(Guild guild, bool isNew)
: this(guild)
{
if (!isNew)
{
var entries = GuildEventLogEntry.FindAllByProperty("m_GuildId", (int)guild.Id);
foreach (var entry in entries)
{
m_entries.Enqueue(entry);
}
}
}
示例12: GuildPanel
/// <summary>
/// Sends GuildPanel to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="guild"></param>
public static void GuildPanel(Creature creature, Guild guild)
{
var packet = new Packet(Op.GuildPanel, creature.EntityId);
packet.PutLong(guild.Id);
packet.PutByte(creature.GuildMember.IsLeader);
if (creature.GuildMember.IsLeader)
{
packet.PutInt(guild.WithdrawMaxAmount);
packet.PutLong(guild.WithdrawDeadline);
packet.PutInt(guild.MaxMembers);
}
packet.PutByte(0);
packet.PutByte(0); // 1: Go To Guild Hall, 2: Go To Guild Stone
creature.Client.Send(packet);
}
示例13: GuildMember
public GuildMember(CharacterRecord chr, Guild guild, GuildRank rank)
: this()
{
var zoneId = (int)chr.Zone;
Guild = guild;
CharacterLowId = (int)chr.EntityLowId;
_rankId = rank.RankIndex;
_name = chr.Name;
_lastLevel = chr.Level;
_lastLogin = DateTime.Now;
_lastZoneId = zoneId;
_class = (int)chr.Class;
_publicNote = string.Empty;
_officerNote = string.Empty;
}
示例14: ForOnlineMembers
/// <summary>
/// Executes the given action for all members of guild that are online.
/// </summary>
/// <param name="guild"></param>
/// <param name="action"></param>
public static void ForOnlineMembers(Guild guild, Action<User> action)
{
var members = guild.GetMembers();
foreach (var member in members)
{
// Applicants aren't full members and shouldn't receive
// "broadcasts" yet.
if (member.Rank > GuildMemberRank.Member)
continue;
var user = MsgrServer.Instance.UserManager.GetUserByCharacterId(member.CharacterId);
if (user == null)
continue;
action(user);
}
}
示例15: LoadGuilds
private void LoadGuilds()
{
MySqlCommand mysqlCmd = new MySqlCommand("SELECT * FROM Guilds", Program.DatabaseManager.GetClient().GetConnection());
int GuildCount = 0;
MySqlDataReader GuildReader = mysqlCmd.ExecuteReader();
{
for (int i = 0; i < GuildReader.FieldCount; i++)
{
while (GuildReader.Read())
{
Guild g = new Guild(Program.DatabaseManager.GetClient().GetConnection(), GuildReader);
GuildManager.AddGuildToList(g);
GuildCount++;
}
}
}
GuildReader.Close();
Log.WriteLine(LogLevel.Info, "Load {0} Guilds", GuildCount);
}