darkstar-afterhours: The FFXIAH Clone

Applications/Tools written to make running DarkStar easier for the rest of us.
User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

darkstar-afterhours: The FFXIAH Clone

Post by krynn » Wed Nov 02, 2016 11:51 pm

WARNING: Currently this is being directly developed for the AfterHours server I am currently running. If you have issues setting this up on your own private server please respond in to the post with said issues and I will do my best to help you sort it out. If you have encountered a bug in the software, please report it to Github under Issues. Please understand however I am currently in a stage of high development activity and I am likely to change things on a daily basis that may or may not break your install.

Image darkstar-afterhours
An FFXIAH Clone for the Darkstar FFXI Server Emulator

This project is an attempt to make a usable clone of FFXIAH for people running the Darkstar FFXI Server Emulator. Built specifically for the AfterHours private server, but can be utilized anywhere.

Features:
  • Users Online List / Full User List
  • Character Profiles (Stats/Jobs/Crafts/Missions/AH History)
  • Armor/Weapon Tooltips (Item Mods/Info pulled from the Darkstar Database)
  • Descriptive Item Tooltips use information from the FFXIAH Item XML.
  • Auction House Category Listings
  • Auction House Item Information
  • Auction House Item Search
  • Crafting Recipe Lists
  • Custom Shop Listings
  • Remastered In-game Icons
  • Help/FAQ Section
Please reference the project README on Github for the current project goals and completed milestones.

https://github.com/kyau/darkstar-afterhours

Live Demo: https://ffxi.kyau.net:4444/
  • Thanks to Run_Away and Velo for help in getting many things working.
  • Also a big thanks to everyone in #darkstarproject on Rizon.
Last edited by krynn on Wed Nov 09, 2016 4:11 pm, edited 5 times in total.

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Wed Nov 02, 2016 11:55 pm

Adding Login/Logout to Audit Log

FILE: src/map/map.cpp
Add to the top of the file at the end of the includes.

Code: Select all

#include "packets/chat_message.h"
Then inside the `map_cleanup` function after the lines:

Code: Select all

                        PChar->status = STATUS_SHUTDOWN;
                        PacketParser[0x00D](map_session_data, PChar, 0);
Add the following code:

Code: Select all

                        int8 packetData[4]{};
                        WBUFL(packetData, 0) = PChar->id;
                        std::string bStr = ("* ");
                        bStr += PChar->GetName();
                        bStr += " has logged out.";
                        CHAT_MESSAGE_TYPE messageType = MESSAGE_LOGON;
                        message::send(MSG_CHAT_SERVMES, 0, 0, new CChatMessagePacket(PChar, messageType, (int8*)bStr.c_str()));
                        std::string qStr = ("INSERT into audit_chat (speaker,type,message,datetime) VALUES('");
                        qStr += "AfterHours";
                        qStr += "','SAY','* ";
                        qStr += PChar->GetName();
                        qStr += " has logged out.";
                        qStr += "',current_timestamp());";
                        const char * cC = qStr.c_str();
                        Sql_QueryStr(SqlHandle, cC);
This will handle when a user disconnects without using `/logout`.

FILE: src/map/packet_system.cpp
Now for the /logout function.
Next search for the function `SmallPacket0x0E7` and add the following right before the `return;` line that ends the function:

Code: Select all

    int8 packetData[4]{};
    WBUFL(packetData, 0) = PChar->id;
    std::string bStr = ("* ");
    bStr += PChar->GetName();
    bStr += " has logged out.";
    CHAT_MESSAGE_TYPE messageType = MESSAGE_LOGON;
    message::send(MSG_CHAT_SERVMES, 0, 0, new CChatMessagePacket(PChar, messageType, (int8*)bStr.c_str()));
    std::string qStr = ("INSERT into audit_chat (speaker,type,message,datetime) VALUES('");
    qStr += "AfterHours";
    qStr += "','SAY','* ";
    qStr += PChar->GetName();
    qStr += " has logged out.";
    qStr += "',current_timestamp());";
    const char * cC = qStr.c_str();
    Sql_QueryStr(SqlHandle, cC);
FILE: src/map/lua/luautil.cpp
Search for the `OnGameIn` function and after the line:

Code: Select all

        lua_pushboolean(LuaHandle, PChar->GetPlayTime(false) == 0); // first login
Add the following code:

Code: Select all

        if (!zoning)
        {
            std::string qStr = ("INSERT into audit_chat (speaker,type,message,datetime) VALUES('");
            qStr += "AfterHours";
            qStr += "','SAY','* ";
            qStr += PChar->GetName();
            qStr += " has logged on.";
            qStr += "',current_timestamp());";
            const char * cC = qStr.c_str();
            Sql_QueryStr(SqlHandle, cC);
        }
FILE: src/map/packets/chat_message.h
Near the top of the file there is a `CHAT_MESSAGE_TYPE` enum, add the following line inside the braces:

Code: Select all

    MESSAGE_LOGON       = 0x1C,
This last part is my personal preference I use the green linkshell color for the in-game login/logout messages.
Last edited by krynn on Mon Nov 21, 2016 5:24 pm, edited 2 times in total.

Avatarati
Posts: 53
Joined: Mon Jun 30, 2014 2:51 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by Avatarati » Fri Nov 04, 2016 1:42 am

Very nice work!
Last edited by Avatarati on Mon Apr 03, 2017 11:39 pm, edited 1 time in total.

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Fri Nov 04, 2016 2:18 am

Well by all means, there is no reason we cannot collaborate. :twisted:

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Wed Nov 09, 2016 4:09 pm


bluesolarflare
Posts: 127
Joined: Wed May 27, 2015 4:23 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by bluesolarflare » Mon Nov 14, 2016 6:20 pm

I am actually using this now on my server though I haven't programmed everything yet. I was using another dashboard, but this is by far much more advanced and cleaner looking. I have already gone thru and added my own tweaks to the dashboard including showing players names as blue with their jobs as [ / ] whenever they go anon and a Notorious Monster Tracker showing if the NM's window is open or if it has been killed along with the window spawn time. Also, when the NM name is clicked takes players to BG as reference.

Image

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Mon Nov 14, 2016 8:31 pm

Cheers, nice to see some more people playing around with this^^

I borrowed your supported client version idea already. I also really like the NM Tracker, great idea!

Heads up too, might want to check out the repo as I made a ton of changes/additions recently.

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Tue Nov 15, 2016 2:25 pm

Did some heavy work on this last night and this morning. Recipes should be completely working now (lists and on item pages). I also added Bazaar's to character profiles and individual item pages. I will probably be adding a Master Bazaar List as well.

Next I will be trying to finish item tooltips (latents/onuse) and then start working on the search filter.

bluesolarflare
Posts: 127
Joined: Wed May 27, 2015 4:23 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by bluesolarflare » Sun Nov 20, 2016 3:18 pm

Krynn

Sent you a PM in regards to auditing logins for chat.

User avatar
krynn
Posts: 16
Joined: Mon Jun 03, 2013 3:04 pm

Re: darkstar-afterhours: The FFXIAH Clone

Post by krynn » Mon Nov 21, 2016 5:25 pm

Put the response to your PM in the first reply of this thread so others have access to the information as well.

P.S. Let me know if you have any issues implementing it.

Post Reply