Example #1
0
        private byte[] m_10023()
        {
            byte[] array;
            using (var ms = new MemoryStream())
            {
                Serializer.Serialize(ms, new sc_10023
                {
                    result        = 0,//0은 튜토리얼 보내기.
                    user_id       = 67751892,
                    server_ticket = "16144400104a8afc841fb14e8dd3b1448782f03472",
                    server_load   = 0,
                    db_load       = 0,
                });
                array = ms.ToArray();
            }
            var packStream = new PackStream(15 + array.Length);

            packStream.WriteUint16((uint)(9 + array.Length));
            packStream.WriteUint8(0);
            packStream.WriteUint16(10023);
            packStream.WriteUint16(0);
            packStream.WriteUint8(8);
            packStream.WriteUint8(0);
            packStream.WriteUint8(16);
            packStream.WriteUint8(0);
            packStream.WriteBuffer(array);

            return(packStream.ToArray());
        }
Example #2
0
        private static byte[] _GetHashCode()
        {
            IniFile ini = new IniFile();

            ini.Load(Directory.GetCurrentDirectory() + "\\config\\gatewaysvr.ini");

            List <string> m_version = new List <string>
            {
                ini["Hash"]["azhash"].ToString(),
                ini["Hash"]["cvhash"].ToString(),
                "",
                "",
                ini["Hash"]["l2dhash"].ToString(),
                ini["Hash"]["pichash"].ToString(),
                ini["Hash"]["bgmhash"].ToString()
            };

            byte[] array;
            using (var ms = new MemoryStream())
            {
                Serializer.Serialize(ms, new sc_10801
                {
                    gateway_ip   = ini["GateWay"]["ip"].ToString(),
                    gateway_port = Convert.ToUInt16(ini["GateWay"]["port"].ToInt()),
                    url          = ini["GateWay"]["url"].ToString(),
                    version      = m_version,
                    proxy_ip     = ini["GateWay"]["proxy_ip"].ToString(),
                    proxy_port   = Convert.ToUInt16(ini["GateWay"]["proxy_port"].ToInt()),
                    is_ts        = Convert.ToUInt16(ini["GateWay"]["is_ts"].ToInt())
                });
                array = ms.ToArray();
            }

            PackStream packStream = new PackStream(15 + array.Length);

            packStream.WriteUint16((uint)(9 + array.Length));
            packStream.WriteUint8(0);
            packStream.WriteUint16(10801);
            packStream.WriteUint16(0);
            packStream.WriteBuffer(array);
            packStream.WriteUint8(48);
            packStream.WriteUint16(56);
            packStream.WriteUint8(0);

            return(packStream.ToArray());
        }
Example #3
0
        static byte[] BuildCS10800(string channelId = "0", uint state = 21)
        {
            MemoryStream memoryStream = new MemoryStream();

            Serializer.Serialize <CS10800>(memoryStream, new CS10800
            {
                State    = state,
                Platform = channelId
            });
            byte[] array = memoryStream.ToArray();
            memoryStream.Close();
            PackStream packStream = new PackStream(7 + array.Length);

            packStream.WriteUint16((uint)(5 + array.Length));
            packStream.WriteUint8(0u);
            packStream.WriteUint16(10800u);
            packStream.WriteUint16(0u);
            packStream.WriteBuffer(array);
            return(packStream.ToArray());
        }
Example #4
0
        private byte[] Ma_10021()////////////Tutorial Packet!!!!!!!
        {
            var m_Serverlist = new List <ServerInfo>();

            for (int i = 0; i < server_cnt; ++i)
            {
                m_Serverlist.Add(new ServerInfo
                {
                    ids        = (uint)i + 1,
                    ip         = m_ip[i],
                    port       = (uint)m_port[i],
                    state      = (uint)m_state[i],
                    name       = m_name[i],
                    tag_state  = (uint)m_tag_state[i],
                    sort       = (uint)m_sort[i],
                    proxy_ip   = m_proxy_ip[i],
                    proxy_port = (uint)m_proxy_port[i]
                });
            }

            NoticeInfo m_Notice = new NoticeInfo
            {
                id      = 0,
                title   = m_title,
                content = m_content
            };
            MemoryStream memoryStream = new MemoryStream();

            if (!is_on)
            {
                Serializer.Serialize(memoryStream, new sc_10021
                {
                    result        = 0,
                    serverlist    = m_Serverlist,
                    account_id    = 643028,
                    server_ticket = "16144395894052053e156363ef7d3bdd0ff3fcfdba",
                    device        = 11
                });
            }
            else
            {
                Serializer.Serialize(memoryStream, new sc_10021
                {
                    result        = 0,
                    serverlist    = m_Serverlist,
                    account_id    = 643028,
                    server_ticket = "16144395894052053e156363ef7d3bdd0ff3fcfdba",
                    device        = 11,
                    notice_list   = m_Notice
                });
            }
            byte[] Array = memoryStream.ToArray();
            memoryStream.Close();
            PackStream packStream = new PackStream(Array.Length + 15);

            packStream.WriteUint8(0);
            packStream.WriteUint8((uint)(Array.Length + 5));
            packStream.WriteUint8(0);
            packStream.WriteUint16(10021);
            packStream.WriteUint16(0);
            packStream.WriteUint8(8);
            packStream.WriteUint8(0);
            packStream.WriteBuffer(Array);
            return(packStream.ToArray());
        }