Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Guilds V1 * Removed partial guild classes and merged with existing base engine classes. * Make the lowest rank Newbie instead of Probationary so it fits in the guild guild ui * Fix demotion options showing up for users * Fixed a bug where clients would crash trying to pickup/gather items when inventories were full
- Loading branch information
Showing
66 changed files
with
5,012 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Intersect.Config.Guilds | ||
{ | ||
/// <summary> | ||
/// Contains all options pertaining to guilds | ||
/// </summary> | ||
public class GuildOptions | ||
{ | ||
/// <summary> | ||
/// Denotes the minimum amount of characters a guild name must contain before being accepted. | ||
/// </summary> | ||
public int MinimumGuildNameSize { get; set; } = 3; | ||
|
||
/// <summary> | ||
/// Denotes the maximum amount of characters a guild name can contain before being rejected. | ||
/// </summary> | ||
public int MaximumGuildNameSize { get; set; } = 25; | ||
|
||
/// <summary> | ||
/// Configures whether or not to allow guild members to attack eachother. | ||
/// </summary> | ||
public bool AllowGuildMemberPvp { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Configured whether the guild name should be rendered above player sprites as a tag | ||
/// </summary> | ||
public bool ShowGuildNameTagsOverMembers { get; set; } = true; | ||
|
||
/// <summary> | ||
/// How often to send guild updates to members, these updates are alongside updates whenever people log in or out | ||
/// </summary> | ||
public int GuildUpdateInterval = 10000; | ||
|
||
/// <summary> | ||
/// If set to a value > 0 then upon server boot any guilds with only 1 member that hasn't played in this number of days will be deleted | ||
/// </summary> | ||
public int DeleteStaleGuildsAfterDays { get; set; } = -1; | ||
|
||
/// <summary> | ||
/// Default number of storage slots in guild banks | ||
/// </summary> | ||
public int GuildBankSlots { get; set; } = 50; | ||
|
||
/// <summary> | ||
/// Array of guild ranks that are available in this game | ||
/// </summary> | ||
public GuildRank[] Ranks { get; set; } = new GuildRank[] | ||
{ | ||
new GuildRank() | ||
{ | ||
Title = "Master", | ||
Limit = 1, | ||
Permissions = new GuildPermissions() | ||
{ | ||
Invite = true, | ||
Kick = true, | ||
Demote = true, | ||
Promote = true, | ||
BankDeposit = true, | ||
BankMove = true, | ||
BankRetrieve = true | ||
} | ||
}, | ||
new GuildRank() | ||
{ | ||
Title = "Officer", | ||
Limit = 10, | ||
Permissions = new GuildPermissions() | ||
{ | ||
Invite = true, | ||
Kick = true, | ||
Demote = true, | ||
Promote = true, | ||
BankDeposit = true, | ||
BankMove = true, | ||
BankRetrieve = true | ||
} | ||
}, | ||
new GuildRank() | ||
{ | ||
Title = "Member", | ||
Limit = -1, | ||
Permissions = new GuildPermissions() | ||
{ | ||
Invite = false, | ||
Kick = false, | ||
Demote = false, | ||
Promote = false, | ||
BankDeposit = true, | ||
BankMove = false, | ||
BankRetrieve = false | ||
} | ||
}, | ||
new GuildRank() | ||
{ | ||
Title = "Newbie", | ||
Limit = -1, | ||
Permissions = new GuildPermissions() | ||
{ | ||
Invite = false, | ||
Kick = false, | ||
Demote = false, | ||
Promote = false, | ||
BankDeposit = false, | ||
BankMove = false, | ||
BankRetrieve = false | ||
} | ||
} | ||
|
||
}; | ||
|
||
[OnDeserialized] | ||
internal void OnDeserializedMethod(StreamingContext context) | ||
{ | ||
Validate(); | ||
} | ||
|
||
public void Validate() | ||
{ | ||
if (Ranks.Length < 2) | ||
{ | ||
throw new Exception("Must have at least 2 guild ranks defined!"); | ||
} | ||
|
||
if (Ranks[0].Limit != 1) | ||
{ | ||
throw new Exception(Ranks[0].Title + " is considered a guild leader (first rank) so the limit should be 1."); | ||
} | ||
|
||
//Leader is always going to be the first rank, just make sure they can invite or kick | ||
Ranks[0].Permissions.Invite = true; | ||
Ranks[0].Permissions.Kick = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace Intersect.Config.Guilds | ||
{ | ||
public class GuildPermissions | ||
{ | ||
/// <summary> | ||
/// Defines whether or not this guild member can invite new members | ||
/// </summary> | ||
public bool Invite { get; set; } | ||
|
||
/// <summary> | ||
/// Defines whether or not this guild member can kick members (under their rank of course) | ||
/// </summary> | ||
public bool Kick { get; set; } | ||
|
||
/// <summary> | ||
/// Defines whether or not this guild member can promote other guilds members to ranks below this one | ||
/// </summary> | ||
public bool Promote { get; set; } | ||
|
||
/// <summary> | ||
/// Defined whether or not this guild member can demote other members who are below this rank | ||
/// </summary> | ||
public bool Demote { get; set; } | ||
|
||
/// <summary> | ||
/// Determines whether or not guild members of this rank can withdraw items from the guild bank | ||
/// </summary> | ||
public bool BankRetrieve { get; set; } | ||
|
||
/// <summary> | ||
/// Determines whether or not guild members of this rank can deposit items into the guild bank | ||
/// </summary> | ||
public bool BankDeposit { get; set; } | ||
|
||
/// <summary> | ||
/// Determines whether or not guild members of this rank can move items around within the guild bank | ||
/// </summary> | ||
public bool BankMove { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Intersect.Config.Guilds | ||
{ | ||
/// <summary> | ||
/// Name and options for individual guild ranks | ||
/// </summary> | ||
public class GuildRank | ||
{ | ||
/// <summary> | ||
/// Name of this rank | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Maximum number of guild members with this title | ||
/// </summary> | ||
public int Limit { get; set; } | ||
|
||
/// <summary> | ||
/// Permissions that this rank holds for the guild and the actions they can take | ||
/// </summary> | ||
public GuildPermissions Permissions { get; set; } = new GuildPermissions(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ public enum ChatMessageType | |
|
||
Admin, | ||
|
||
Guild, | ||
|
||
// Player Messages | ||
Experience = 20, | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ public enum ChatboxTab | |
|
||
Party, | ||
|
||
Guild, | ||
|
||
Global, | ||
|
||
System, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,12 @@ public enum CommonEventTrigger | |
|
||
ServerVariableChange, | ||
|
||
GuildMemberJoined, | ||
|
||
GuildMemberLeft, | ||
|
||
GuildMemberKicked | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Intersect.Enums | ||
{ | ||
public enum GuildMemberUpdateActions | ||
{ | ||
Invite = 0, | ||
Remove, | ||
Promote, | ||
Demote, | ||
Transfer | ||
} | ||
} |
Oops, something went wrong.