- Published on
Devlog #31 - Guilds - *UPDATED 9/11/23*
Fisherman Gorton back in business. Buffed the pointy stick.
The Collector has opened up shop! He accepts all Armor and Weapons for now.
Before quest chat now enabled.
Alert window working and added to the reset stat points button.
Ok, on to guilds. I will be using the Smartfoxserver Room to handle guild related messages.
https://smartfoxserver.com/blog/creating-rooms-from-server-side/
When you log in and you're in a guild you will automatically join the guild's room. Once in this room, the client will receive messages about users joining, leaving, sending chat messages, etc.
This is an example of the Dev Guild room that is created when I log in with Gamer. Smartfoxserver has a nice dashboard for monitoring zones, rooms, users, etc.
Ok, with that code up and running, let's add the guild chat.
And then there was guild chat.
Usage: /g stuff and things are neat
Guild ranks are as follows:
Initiate
Member
Veteran
Officer
Leader
When you join a guild you are automatically an Initiate.
When you create a guild you are automatically a Leader.
/guildkick time!
This takes a bit of work as it needs to work both when the player is online and offline.
First we check that the player issuing the command is above the rank of Member.
Then we check if the player who issued the command is in the same guild as the target player and we also check if the player's rank is above the target player's rank.
And lastly we remove the target player from the guild and kick the target player from the server if they're online. Just for a little dramatic effect.
And tada, /guildkick is now fully functional.
Usage: /guildkick Hazlitt
/guildinvite is next!
This command requires a response from the target player so it will take a bit of work as well.
First, the target player must be online.
Then we send a guild invite message to the target player's client.
If the client responds with accept then a message is sent to the server and the target player is added to the guild!
Usage: /guildinvite MrPickles
And here are some of the guild system messages from /guildkick and /guildinvite in action.
I took a little break and had a chat with Fisherman Gorton. He's open to the idea of teaching noobs to fish. He's going to develop a plan for teaching his skills and he thinks he'll be able to share his knowledge with everyone late next year.
And back to guilds!
/guildpromote and /guilddemote time!
You cannot be promoted to Leader and you can't be demoted below Initiate.
You must be above the rank of Member to use these commands, like most administrative guild commands.
And I ran out of time. These commands will be completed in the future.
/guildcreate time!
First we make sure the player isn't already in a guild.
Then we sanitize the guild name, validate it for only alphanumeric and space characters, and validate it's between 4 and 18 characters.
Then we make sure the player has a Guild Registration Form in one of their bags.
Then we query the database to make sure this guild name does not exist.
Finally we insert the guild into the database, assign it to the character, and delete the guild form.
Usage: /guildcreate "Crabs Anonymous"
/guilddisband time!
First we make sure we're in a guild and that we're the leader.
Then we check the database to make sure we're the only member left in the guild.
Then we update the character, delete the guild, and we're done!
Usage: /guilddisband
/guildleave time!
First we make sure we're in a guild and that we're NOT the leader.
Then we return donations and leave the guild!
Usage: /guildleave
And finally /guilddonate time!
First we make sure we're in a guild.
Then we attempt to take the coins.
Then we update the character and the guild donation numbers and update the guild level.
Usage: /guilddonate 1234
Added some instructions to the Guild Registration Form and added a few guild chat notifications.
WHOA! I just checked the database and several guilds have already been formed! I haven't even announced that the guild commands were on the main server yet!
In the coming week I will be working on the character window. I'll be adding outfit slots, outfit tab, and converting it to look a lot like the mockup below.
All Patreon exclusive items will also be converted to outfit items!
I'll also be looking at the memory leak in the GUI, fixing any guild bugs that pop up, adding the Banana Box, delivering Gem rewards to active patrons, and more! You must be an active patron on September 15th to get Gem rewards! I will make a post about it in the middle of next week.
See you soon!
Have Fun & Keep Gaming!
P.S. - I have hair sprites so I might also get to moving the body, eyes, hair selection from the buggy website into the game. We'll see. Maybe the week after.
P.P.S - Guild window and leaderboards will be in a future update.