コード例 #1
0
        public static void NotifyPlayerJoining(PlayerInfo src, Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            uint             t      = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> result = new List <Blaze.Tdf>();

            result.Add(Blaze.TdfInteger.Create("GID\0", pi.game.id));
            List <Blaze.Tdf> PDAT = new List <Blaze.Tdf>();

            PDAT.Add(Blaze.TdfInteger.Create("EXID", pi.userId));
            PDAT.Add(Blaze.TdfInteger.Create("GID\0", pi.game.id));
            PDAT.Add(Blaze.TdfInteger.Create("LOC\0", pi.loc));
            PDAT.Add(Blaze.TdfString.Create("NAME", pi.profile.name));
            PDAT.Add(Blaze.TdfInteger.Create("PID\0", pi.userId));
            PDAT.Add(BlazeHelper.CreateNETFieldUnion(pi, "PNET"));
            PDAT.Add(Blaze.TdfInteger.Create("SID\0", pi.slot));
            PDAT.Add(Blaze.TdfInteger.Create("STAT", pi.stat));
            PDAT.Add(Blaze.TdfInteger.Create("TIDX", 0xFFFF));
            PDAT.Add(Blaze.TdfInteger.Create("TIME", t));
            PDAT.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            result.Add(Blaze.TdfStruct.Create("PDAT", PDAT));
            byte[] buff = Blaze.CreatePacket(0x4, 0x15, 0, 0x2000, 0, result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
            BlazeServer.Log("[CLNT] #" + src.userId + " [0004:0015] NotifyPlayerJoining", System.Drawing.Color.Black);
        }
コード例 #2
0
        public static void Login(Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            uint             t      = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> Result = new List <Blaze.Tdf>();

            Result.Add(Blaze.TdfString.Create("LDHT", ""));
            Result.Add(Blaze.TdfInteger.Create("NTOS", 0));
            Result.Add(Blaze.TdfString.Create("PCTK", ""));
            List <Blaze.TdfStruct> playerentries = new List <Blaze.TdfStruct>();
            List <Blaze.Tdf>       PlayerEntry   = new List <Blaze.Tdf>();

            PlayerEntry.Add(Blaze.TdfString.Create("DSNM", pi.name));
            PlayerEntry.Add(Blaze.TdfInteger.Create("LAST", t));
            PlayerEntry.Add(Blaze.TdfInteger.Create("PID\0", pi.id));
            PlayerEntry.Add(Blaze.TdfInteger.Create("STAS", 2));
            PlayerEntry.Add(Blaze.TdfInteger.Create("XREF", 0));
            PlayerEntry.Add(Blaze.TdfInteger.Create("XTYP", 0));
            playerentries.Add(Blaze.TdfStruct.Create("0", PlayerEntry));
            Result.Add(Blaze.TdfList.Create("PLST", 3, 1, playerentries));
            Result.Add(Blaze.TdfString.Create("PRIV", ""));
            Result.Add(Blaze.TdfString.Create("SKEY", "some_client_key"));
            Result.Add(Blaze.TdfInteger.Create("SPAM", 1));
            Result.Add(Blaze.TdfString.Create("THST", ""));
            Result.Add(Blaze.TdfString.Create("TSUI", ""));
            Result.Add(Blaze.TdfString.Create("TURI", ""));
            Result.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, Result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
        }
コード例 #3
0
        public static void LoginPersona(Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            uint             t    = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> SESS = new List <Blaze.Tdf>();

            SESS.Add(Blaze.TdfInteger.Create("BUID", pi.userId));
            SESS.Add(Blaze.TdfInteger.Create("FRST", 0));
            SESS.Add(Blaze.TdfString.Create("KEY\0", "some_client_key"));
            SESS.Add(Blaze.TdfInteger.Create("LLOG", t));
            SESS.Add(Blaze.TdfString.Create("MAIL", ""));
            List <Blaze.Tdf> PDTL = new List <Blaze.Tdf>();

            PDTL.Add(Blaze.TdfString.Create("DSNM", pi.profile.name));
            PDTL.Add(Blaze.TdfInteger.Create("LAST", t));
            PDTL.Add(Blaze.TdfInteger.Create("PID\0", pi.userId));
            PDTL.Add(Blaze.TdfInteger.Create("STAS", 0));
            PDTL.Add(Blaze.TdfInteger.Create("XREF", 0));
            PDTL.Add(Blaze.TdfInteger.Create("XTYP", 0));
            SESS.Add(Blaze.TdfStruct.Create("PDTL", PDTL));
            SESS.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, SESS);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();

            AsyncUserSessions.NotifyUserAdded(pi, p, pi, ns);
            AsyncUserSessions.NotifyUserStatus(pi, p, pi, ns);
        }
コード例 #4
0
        private static void Ping(Blaze.Packet p, NetworkStream ns)
        {
            List <Blaze.Tdf> Result = new List <Blaze.Tdf>();

            Result.Add(Blaze.TdfInteger.Create("STIM", Blaze.GetUnixTimeStamp()));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, Result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
        }
コード例 #5
0
        public static void Login(Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            if (!pi.isServer)
            {
                List <Blaze.Tdf> input = Blaze.ReadPacketContent(p);
                Blaze.TdfString  TOKN  = (Blaze.TdfString)input[3];
                long             id    = Convert.ToInt32(TOKN.Value);
                foreach (Profile profile in Profiles.profiles)
                {
                    if (profile.id == id)
                    {
                        pi.profile = profile;
                        break;
                    }
                }
                if (pi.profile == null)
                {
                    BlazeServer.Log("[CLNT] #" + pi.userId + " Could not find player profile!", System.Drawing.Color.Red);
                    return;
                }
                else
                {
                    BlazeServer.Log("[CLNT] #" + pi.userId + " Client Playername = \"" + pi.profile.name + "\"", System.Drawing.Color.Blue);
                }
            }
            uint             t      = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> Result = new List <Blaze.Tdf>();

            Result.Add(Blaze.TdfString.Create("LDHT", ""));
            Result.Add(Blaze.TdfInteger.Create("NTOS", 0));
            Result.Add(Blaze.TdfString.Create("PCTK", ""));
            List <Blaze.TdfStruct> playerentries = new List <Blaze.TdfStruct>();
            List <Blaze.Tdf>       PlayerEntry   = new List <Blaze.Tdf>();

            PlayerEntry.Add(Blaze.TdfString.Create("DSNM", pi.profile.name));
            PlayerEntry.Add(Blaze.TdfInteger.Create("LAST", t));
            PlayerEntry.Add(Blaze.TdfInteger.Create("PID\0", pi.userId));
            PlayerEntry.Add(Blaze.TdfInteger.Create("STAS", 2));
            PlayerEntry.Add(Blaze.TdfInteger.Create("XREF", 0));
            PlayerEntry.Add(Blaze.TdfInteger.Create("XTYP", 0));
            playerentries.Add(Blaze.TdfStruct.Create("0", PlayerEntry));
            Result.Add(Blaze.TdfList.Create("PLST", 3, 1, playerentries));
            Result.Add(Blaze.TdfString.Create("PRIV", ""));
            Result.Add(Blaze.TdfString.Create("SKEY", "some_client_key"));
            Result.Add(Blaze.TdfInteger.Create("SPAM", 1));
            Result.Add(Blaze.TdfString.Create("THST", ""));
            Result.Add(Blaze.TdfString.Create("TSUI", ""));
            Result.Add(Blaze.TdfString.Create("TURI", ""));
            Result.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, Result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
        }
コード例 #6
0
        public static Blaze.TdfStruct MakePROSEntry(int idx, PlayerInfo pi)
        {
            uint             t      = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> result = new List <Blaze.Tdf>();

            result.Add(Blaze.TdfInteger.Create("EXID", pi.userId));
            result.Add(Blaze.TdfInteger.Create("GID\0", pi.game.id));
            result.Add(Blaze.TdfInteger.Create("LOC\0", pi.loc));
            result.Add(Blaze.TdfString.Create("NAME", pi.profile.name));
            result.Add(Blaze.TdfInteger.Create("PID\0", pi.userId));
            result.Add(BlazeHelper.CreateNETFieldUnion(pi, "PNET"));
            result.Add(Blaze.TdfInteger.Create("SID\0", pi.slot));
            result.Add(Blaze.TdfInteger.Create("STAT", pi.stat));
            result.Add(Blaze.TdfInteger.Create("TIDX", 0xFFFF));
            result.Add(Blaze.TdfInteger.Create("TIME", t));
            result.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            return(Blaze.TdfStruct.Create(idx.ToString(), result));
        }
コード例 #7
0
        public static void ListPersonas(Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            List <Blaze.Tdf>       result  = new List <Blaze.Tdf>();
            List <Blaze.TdfStruct> entries = new List <Blaze.TdfStruct>();
            List <Blaze.Tdf>       e       = new List <Blaze.Tdf>();

            e.Add(Blaze.TdfString.Create("DSNM", pi.profile.name));
            e.Add(Blaze.TdfInteger.Create("LAST", Blaze.GetUnixTimeStamp()));
            e.Add(Blaze.TdfInteger.Create("PID\0", pi.profile.id));
            e.Add(Blaze.TdfInteger.Create("STAS", 2));
            e.Add(Blaze.TdfInteger.Create("XREF", 0));
            e.Add(Blaze.TdfInteger.Create("XTYP", 0));
            entries.Add(Blaze.TdfStruct.Create("0", e));
            result.Add(Blaze.TdfList.Create("PINF", 3, 1, entries));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
        }
コード例 #8
0
        public static void LoginPersona(Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            uint             t    = Blaze.GetUnixTimeStamp();
            List <Blaze.Tdf> SESS = new List <Blaze.Tdf>();

            SESS.Add(Blaze.TdfInteger.Create("BUID", 1));
            SESS.Add(Blaze.TdfInteger.Create("FRST", 0));
            SESS.Add(Blaze.TdfString.Create("KEY\0", "some_client_key"));
            SESS.Add(Blaze.TdfInteger.Create("LLOG", t));
            SESS.Add(Blaze.TdfString.Create("MAIL", ""));
            List <Blaze.Tdf> PDTL = new List <Blaze.Tdf>();

            PDTL.Add(Blaze.TdfString.Create("DSNM", pi.name));
            PDTL.Add(Blaze.TdfInteger.Create("LAST", t));
            PDTL.Add(Blaze.TdfInteger.Create("PID\0", pi.id));
            PDTL.Add(Blaze.TdfInteger.Create("STAS", 0));
            PDTL.Add(Blaze.TdfInteger.Create("XREF", 0));
            PDTL.Add(Blaze.TdfInteger.Create("XTYP", 0));
            SESS.Add(Blaze.TdfStruct.Create("PDTL", PDTL));
            SESS.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, SESS);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
            List <Blaze.Tdf> Result = new List <Blaze.Tdf>();
            List <Blaze.Tdf> USER   = new List <Blaze.Tdf>();

            USER.Add(Blaze.TdfInteger.Create("AID\0", pi.id));
            USER.Add(Blaze.TdfInteger.Create("ALOC", 0x656E5553));
            USER.Add(Blaze.TdfInteger.Create("ID\0\0", pi.id));
            USER.Add(Blaze.TdfString.Create("NAME", pi.name));
            Result.Add(Blaze.TdfStruct.Create("USER", USER));
            buff = Blaze.CreatePacket(0x7802, 2, 0, 0x2000, 0, Result);
            ns.Write(buff, 0, buff.Length);                                           //TODO!!
            ns.Flush();                                                               //TODO!!
            Result = new List <Blaze.Tdf>();
            Result.Add(Blaze.TdfInteger.Create("FLGS", 3));
            Result.Add(Blaze.TdfInteger.Create("ID\0\0", pi.userId));
            buff = Blaze.CreatePacket(0x7802, 5, 0, 0x2000, 0, Result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
        }
コード例 #9
0
        public static void NotifyServerGameSetup(PlayerInfo src, Blaze.Packet p, PlayerInfo pi, NetworkStream ns)
        {
            List <Blaze.Tdf> input = Blaze.ReadPacketContent(p);
            uint             t     = Blaze.GetUnixTimeStamp();

            pi.game.GNAM = ((Blaze.TdfString)input[2]).Value;
            pi.game.GSET = ((Blaze.TdfInteger)input[3]).Value;
            pi.game.VOIP = ((Blaze.TdfInteger)input[21]).Value;
            pi.game.VSTR = ((Blaze.TdfString)input[22]).Value;
            List <Blaze.Tdf> result = new List <Blaze.Tdf>();
            List <Blaze.Tdf> GAME   = new List <Blaze.Tdf>();

            GAME.Add(Blaze.TdfList.Create("ADMN", 0, 1, new List <long>(new long[] { pi.userId })));
            GAME.Add(Blaze.TdfList.Create("CAP\0", 0, 2, new List <long>(new long[] { 0x20, 0 })));
            GAME.Add(Blaze.TdfInteger.Create("GID\0", pi.game.id));
            GAME.Add(Blaze.TdfString.Create("GNAM", pi.game.GNAM));
            GAME.Add(Blaze.TdfInteger.Create("GPVH", 666));
            GAME.Add(Blaze.TdfInteger.Create("GSET", pi.game.GSET));
            GAME.Add(Blaze.TdfInteger.Create("GSID", 1));
            GAME.Add(Blaze.TdfInteger.Create("GSTA", pi.game.GSTA));
            GAME.Add(Blaze.TdfString.Create("GTYP", "AssaultStandard"));
            GAME.Add(BlazeHelper.CreateNETField(pi, "HNET"));
            GAME.Add(Blaze.TdfInteger.Create("HSES", 13666));
            GAME.Add(Blaze.TdfInteger.Create("IGNO", 0));
            GAME.Add(Blaze.TdfInteger.Create("MCAP", 0x20));
            GAME.Add(BlazeHelper.CreateNQOSField(pi, "NQOS"));
            GAME.Add(Blaze.TdfInteger.Create("NRES", 0));
            GAME.Add(Blaze.TdfInteger.Create("NTOP", 1));
            GAME.Add(Blaze.TdfString.Create("PGID", ""));
            List <Blaze.Tdf> PHST = new List <Blaze.Tdf>();

            PHST.Add(Blaze.TdfInteger.Create("HPID", pi.userId));
            GAME.Add(Blaze.TdfStruct.Create("PHST", PHST));
            GAME.Add(Blaze.TdfInteger.Create("PRES", 1));
            GAME.Add(Blaze.TdfString.Create("PSAS", "wv"));
            GAME.Add(Blaze.TdfInteger.Create("QCAP", 0x10));
            GAME.Add(Blaze.TdfInteger.Create("SEED", 0x2CF2048F));
            GAME.Add(Blaze.TdfInteger.Create("TCAP", 0x10));
            List <Blaze.Tdf> THST = new List <Blaze.Tdf>();

            THST.Add(Blaze.TdfInteger.Create("HPID", pi.userId));
            GAME.Add(Blaze.TdfStruct.Create("THST", THST));
            GAME.Add(Blaze.TdfList.Create("TIDS", 0, 2, new List <long>(new long[] { 1, 2 })));
            GAME.Add(Blaze.TdfString.Create("UUID", "f5193367-c991-4429-aee4-8d5f3adab938"));
            GAME.Add(Blaze.TdfInteger.Create("VOIP", pi.game.VOIP));
            GAME.Add(Blaze.TdfString.Create("VSTR", pi.game.VSTR));
            result.Add(Blaze.TdfStruct.Create("GAME", GAME));
            List <Blaze.TdfStruct> PROS = new List <Blaze.TdfStruct>();
            List <Blaze.Tdf>       ee0  = new List <Blaze.Tdf>();

            ee0.Add(Blaze.TdfInteger.Create("EXID", pi.userId));
            ee0.Add(Blaze.TdfInteger.Create("GID\0", pi.game.id));
            ee0.Add(Blaze.TdfInteger.Create("LOC\0", pi.loc));
            ee0.Add(Blaze.TdfString.Create("NAME", pi.profile.name));
            ee0.Add(Blaze.TdfInteger.Create("PID\0", pi.userId));
            ee0.Add(BlazeHelper.CreateNETFieldUnion(pi, "PNET"));
            ee0.Add(Blaze.TdfInteger.Create("SID\0", pi.slot));
            ee0.Add(Blaze.TdfInteger.Create("SLOT", 0));
            ee0.Add(Blaze.TdfInteger.Create("STAT", 2));
            ee0.Add(Blaze.TdfInteger.Create("TIDX", 0xFFFF));
            ee0.Add(Blaze.TdfInteger.Create("TIME", t));
            ee0.Add(Blaze.TdfInteger.Create("UID\0", pi.userId));
            PROS.Add(Blaze.TdfStruct.Create("0", ee0));
            result.Add(Blaze.TdfList.Create("PROS", 3, 1, PROS));
            List <Blaze.Tdf> VALU = new List <Blaze.Tdf>();

            VALU.Add(Blaze.TdfInteger.Create("DCTX", 0));
            result.Add(Blaze.TdfUnion.Create("REAS", 0, Blaze.TdfStruct.Create("VALU", VALU)));
            byte[] buff = Blaze.CreatePacket(p.Component, 0x14, 0, 0x2000, 0, result);
            ns.Write(buff, 0, buff.Length);
            ns.Flush();
            BlazeServer.Log("[CLNT] #" + src.userId + " [0004:0014] NotifyServerGameSetup", System.Drawing.Color.Black);
        }