الموقع العربي الاول للعبة Silkroad Online

الموقع العربي الاول للعبة Silkroad Online (https://silkroad4arab.com/vb/index.php)
-   قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة (https://silkroad4arab.com/vb/forumdisplay.php?f=226)
-   -   مشكله فى CustomCertificationServer (https://silkroad4arab.com/vb/showthread.php?t=543591)

mksl 03-01-2014 02:19 AM

مشكله فى CustomCertificationServer
 
انا كنت شغال بالسيرفر تمام وكل حاجه زى الفل قفلتو جيت افتحو من شويه لقيت
3 - CustomCertificationServer
مش بيفتح مع العلم دى مش اول مره انا كل ما بيعمل معايا كده اسهل حل بعملو بمسح السيرفر او بغير نسخة ويندوز وبعمل سيرفر من جديد وبيشتغل ياخد يومين او تلت ايام بالكتير شغال بس وبعدين بيجيب الصوره دى

http://www5.0zz0.com/2014/01/02/23/849533193.png

mksl 03-01-2014 02:21 AM

مع العلم انا ملعبتش فى ini
ومسحت ini وعدلت عليهم من جديد برضو نفس الحوار

mksl 03-01-2014 02:31 AM

انا دخلت على ملفات Program وى ملف CustomCertificationServer.csproj اللى هيا فى المسار ده src\CustomCertificationServer بس مفهمتش حاجه هيا عندى كده
دا CustomCertificationServer.csproj

كود PHP:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{3509C8A6-4498-425F-8656-6C210548666D}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>CustomCertificationServer</RootNamespace>
    <AssemblyName>CustomCertificationServer</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\shared\asyncNetwork.cs">
      <Link>asyncNetwork.cs</Link>
    </Compile>
    <Compile Include="..\shared\Blowfish.cs">
      <Link>Blowfish.cs</Link>
    </Compile>
    <Compile Include="..\shared\Packet.cs">
      <Link>Packet.cs</Link>
    </Compile>
    <Compile Include="..\shared\PacketReader.cs">
      <Link>PacketReader.cs</Link>
    </Compile>
    <Compile Include="..\shared\PacketWriter.cs">
      <Link>PacketWriter.cs</Link>
    </Compile>
    <Compile Include="..\shared\Security.cs">
      <Link>Security.cs</Link>
    </Compile>
    <Compile Include="..\shared\srCertification.cs">
      <Link>srCertification.cs</Link>
    </Compile>
    <Compile Include="..\shared\TransferBuffer.cs">
      <Link>TransferBuffer.cs</Link>
    </Compile>
    <Compile Include="..\shared\Utility.cs">
      <Link>Utility.cs</Link>
    </Compile>
    <Compile Include="..\shared\VisitStream.cs">
      <Link>VisitStream.cs</Link>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

وده Program

كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SilkroadSecurityApi;
using asyncNetwork;
using System.Threading;
using System.IO;

class 
CertificationServerData
{
    public 
bool m_connected;
    public 
Security m_security = new Security();
    public 
byte[] m_certification_buffer;

    public 
CertificationServerData()
    {
        
m_security.GenerateSecurity(falsefalsefalse);
        
m_connected false;
    }
}

class 
CertificationServerInterface Async.IAsyncInterface
{
    public 
CertificationServerInterface()
    {
    }

    public 
bool OnConnect(Async.asyncContext context)
    {
        
CertificationServerData context_data = new CertificationServerData();

        
context_data.m_certification_buffer = (byte[])context.User;
        
context_data.m_connected true;
        
context.User context_data;

        return 
true;
    }

    public 
bool OnReceive(Async.asyncContext contextbyte[] bufferint count)
    {
        
CertificationServerData context_data = (CertificationServerData)context.User;

        try
        {
            
context_data.m_security.Recv(buffer0count);
            List<
Packetpackets context_data.m_security.TransferIncoming();
            if (
packets != null)
            {
                foreach (
Packet packet in packets)
                {
                    
byte[] payload packet.GetBytes();
                    
Console.WriteLine("[{7}][{0:X4}][{1} bytes]{2}{3}{4}{5}{6}"packet.Opcodepayload.Lengthpacket.Encrypted "[Encrypted]" ""packet.Massive "[Massive]" ""Environment.NewLineUtility.HexDump(payload), Environment.NewLinecontext.Guid);

                    if (
packet.Opcode == 0x5000// Ignore
                    
{
                    }
                    else if (
packet.Opcode == 0x9000// Ignore
                    
{
                    }
                    else if (
packet.Opcode == 0x2001)
                    {
                        
String name packet.ReadAscii();
                        
byte flag packet.ReadUInt8();

                        if (
flag == 0)
                        {
                            
// todo //
                        
}
                        else if (
flag == 1)
                        {
                            if (
name == "GlobalManager")
                            {
                                
Packet response = new Packet(0x2001);
                                
response.WriteAscii("Certification");
                                
response.WriteUInt8(1);
                                
context_data.m_security.Send(response);
                            }
                            else
                            {
                                
// todo //
                            
}
                        }
                    }
                    else if (
packet.Opcode == 0x6003)
                    {
                        
String name packet.ReadAscii();
                        
String ip packet.ReadAscii();

                        
// todo: verify data against certification info //

                        
Packet response = new Packet(0xA003falsetrue);
                        
response.WriteUInt8Array(context_data.m_certification_buffer);
                        
context_data.m_security.Send(response);
                    }
                    else if (
packet.Opcode == 0x2005)
                    {
                        
byte unk1 packet.ReadUInt8();
                        if (
unk1 == 1)
                        {
                            
byte unk2 packet.ReadUInt8();
                            
byte unk3 packet.ReadUInt8();
                            
UInt16 node_id packet.ReadUInt16(); // node id
                            
UInt32 unk5 packet.ReadUInt32();
                            
byte unk6 packet.ReadUInt8();
                        }
                        else if (
unk1 == 2)
                        {
                            
byte unk2 packet.ReadUInt8();
                            
byte unk3 packet.ReadUInt8();
                            
UInt32 link_id packet.ReadUInt32(); // link id
                            
UInt32 unk5 packet.ReadUInt32();
                            
byte unk6 packet.ReadUInt8();
                        }

                        
// todo: 00499968  |.  B9 05200000   MOV ECX, 2005                            ;  3

                        // todo: 0049A666  |.  B9 05200000   MOV ECX, 2005                            ;  4

                        
Console.Write("");
                    }
                }
            }
        }
        catch (
Exception ex)
        {
            
Console.WriteLine(ex);
            return 
false;
        }

        return 
true;
    }

    public 
void OnDisconnect(Async.asyncContext context)
    {
        
CertificationServerData context_data = (CertificationServerData)context.User;
        
context_data.m_connected false;
    }

    public 
void OnError(Async.asyncContext contextobject user)
    {
        if (
context != null && context.User != null)
        {
            
CertificationServerData context_data = (CertificationServerData)context.User;
            
context_data.m_connected false;
        }
    }

    public 
void OnTick(Async.asyncContext context)
    {
        
CertificationServerData context_data = (CertificationServerData)context.User;
        if (
context_data == null)
            return;

        if (!
context_data.m_connected)
            return;

        List<
KeyValuePair<TransferBufferPacket>> buffers context_data.m_security.TransferOutgoing();
        if (
buffers != null)
        {
            foreach (
KeyValuePair<TransferBufferPacketbuffer in buffers)
            {
                
context.Send(buffer.Key.Buffer0buffer.Key.Size);
            }
        }
    }
}

class 
Program
{
    static 
void Main(string[] args)
    {
        
srCertification certification = new srCertification();
        
byte[] certification_buffer null;

        try
        {
            
using (BinaryReader br = new BinaryReader(new FileStream(args[0], FileMode.Open)))
            {
                
BinaryReaderVisitStream brvs = new BinaryReaderVisitStream(br);
                
srCertification_Processor.read_binary(certificationbrvs);
            }

            
BinaryWriterVisitStream bwvs = new BinaryWriterVisitStream();
            
srCertification_Processor.write_binary(certificationbwvs);

            
byte[] buffer bwvs.MemoryStream.ToArray();
            
certification_buffer = new byte[buffer.Length];
            
Buffer.BlockCopy(buffer0certification_buffer0buffer.Length);
        }
        catch (
Exception ex)
        {
            
Console.WriteLine(ex);
            return;
        }

        
srCertification.srNodeType certification_node_type null;
        
srCertification.srNodeData certification_node_data null;

        foreach (var 
obj in certification.srNodeTypes)
        {
            if (
obj.name.value == "Certification Manager")
            {
                
certification_node_type obj;
                break;
            }
        }

        if (
certification_node_type == null)
        {
            
Console.WriteLine("Error: Could not locate a \"Certification Manager\" node type.");
            return;
        }

        foreach (var 
obj in certification.srNodeDatas)
        {
            if (
obj.node_type == certification_node_type.id)
            {
                
certification_node_data obj;
                break;
            }
        }

        if (
certification_node_data == null)
        {
            
Console.WriteLine("Error: Could not locate a \"Certification Manager\" node.");
            return;
        }

        
Async.asyncNetwork network = new Async.asyncNetwork();

        
CertificationServerInterface certificationServerInterface = new CertificationServerInterface();
        
network.Accept(certification_node_type.wip.valuecertification_node_data.port5certificationServerInterfacecertification_buffer);

        
Console.WriteLine("Status: Certification Server started on {0}:{1}"certification_node_type.wip.valuecertification_node_data.port);
        
Console.WriteLine("Status: Press ESC to exit...");

        while (
true)
        {
            if (
Console.KeyAvailable)
            {
                
ConsoleKeyInfo key Console.ReadKey(true);
                if (
key.Key == ConsoleKey.Escape)
                {
                    break;
                }
            }
            
network.Tick();
            
Thread.Sleep(1);
        }
    }



che_9299 03-01-2014 02:48 AM

غير port لى 8081 فى iis وى Serevr,cfg

mksl 03-01-2014 03:02 AM

اقتباس:

المشاركة الأصلية كتبت بواسطة che_9299 (المشاركة 4980255)
غير port لى 8081 فى iis وى Serevr,cfg

جربتها والله ومفيش امل برضو

mksl 03-01-2014 03:31 PM

يعنى هو مفيش حل للمشكله دى غير انى امسح السيرفر كول 3 ايام او اغير نسخه يا ناس. على العموم انا بقول ان دا من نسخة الويندوز بس لو من الويندوز ليه بتشتغل 3 ايام بس ليه مش عارف على العموم انا هحاول احل المشكله دى وهقلكم وشكراااا
بس احب اقول للمشرفين انا بتاع الجديده ^_^


:shifty: :shifty: :shifty:

che_9299 03-01-2014 03:45 PM

new windows + new server Files

che_9299 03-01-2014 03:48 PM

طب انته جربت new ini ملفات جديده لل ini ده

mksl 03-01-2014 04:12 PM

اقتباس:

المشاركة الأصلية كتبت بواسطة che_9299 (المشاركة 4980443)
new windows + new server Files

انا غيرت ملفات السيرفر بس مغيرتش النسخه


اقتباس:

المشاركة الأصلية كتبت بواسطة che_9299 (المشاركة 4980445)
طب انته جربت new ini ملفات جديده لل ini ده

اكيد غيرتها اكتر من مره طبعا

che_9299 03-01-2014 04:34 PM

تم الحل المشكله كانت فى الهماشى
##

mksl 03-01-2014 04:45 PM

اقتباس:

المشاركة الأصلية كتبت بواسطة che_9299 (المشاركة 4980475)
تم الحل المشكله كانت فى الهماشى
##

مواقتا يا زميل بعد 4 ايام هرد عليك ^_^

TYKE 03-01-2014 06:32 PM

##


الساعة الآن 06:32 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.