Beispiel #1
0
        public static void HandleTransfer(LoginConnector lc, InterPacket packet)
        {
            byte v;
            if (!packet.TryReadByte(out v))
            {
                return;
            }

            if (v == 0)
            {
                byte admin;
                int accountid;
                string username, hash, hostip;
                if (!packet.TryReadInt(out accountid) || !packet.TryReadString(out username) || !packet.TryReadString(out hash) || !packet.TryReadByte(out admin) || !packet.TryReadString(out hostip)) {
                    return;
                }
                ClientTransfer ct = new ClientTransfer(accountid, username, admin, hostip, hash);
                ClientManager.Instance.AddTransfer(ct);
            }
            else if (v == 1)
            {
                byte admin;
                int accountid;
                string username, charname, hostip;
                ushort randid;
                if (!packet.TryReadInt(out accountid) || !packet.TryReadString(out username) || !packet.TryReadString(out charname) ||
                    !packet.TryReadUShort(out randid) || !packet.TryReadByte(out admin) || !packet.TryReadString(out hostip))
                {
                    return;
                }
                ClientTransfer ct = new ClientTransfer(accountid, username, charname, randid, admin, hostip);
                ClientManager.Instance.AddTransfer(ct);
            }
        }
Beispiel #2
0
 public static bool Load(string ip, int port)
 {
     try
     {
         Instance = new LoginConnector(ip, port);
         return(true);
     }
     catch { return(false); }
 }
Beispiel #3
0
 public static bool Load(string ip, int port)
 {
     try
     {
         Instance = new LoginConnector(ip, port);
         return true;
     }
     catch { return false; }
 }
Beispiel #4
0
 public static void TryAssiging(LoginConnector lc)
 {
     using (var p = new InterPacket(InterHeader.ASSIGN))
     {
         p.WriteByte(Settings.Instance.ID);
         p.WriteStringLen(Settings.Instance.WorldName);
         p.WriteStringLen(Settings.Instance.IP);
         p.WriteUShort(Settings.Instance.Port);
         lc.SendPacket(p);
     }
 }
Beispiel #5
0
        public static void HandleTransfer(LoginConnector lc, InterPacket packet)
        {
            byte v;

            if (!packet.TryReadByte(out v))
            {
                return;
            }

            if (v == 0)
            {
                byte   admin;
                int    accountid;
                string username, hash, hostip;
                if (!packet.TryReadInt(out accountid) || !packet.TryReadString(out username) || !packet.TryReadString(out hash) || !packet.TryReadByte(out admin) || !packet.TryReadString(out hostip))
                {
                    return;
                }
                ClientTransfer ct = new ClientTransfer(accountid, username, admin, hostip, hash);
                ClientManager.Instance.AddTransfer(ct);
            }
            else if (v == 1)
            {
                byte   admin;
                int    accountid;
                string username, charname, hostip;
                ushort randid;
                if (!packet.TryReadInt(out accountid) || !packet.TryReadString(out username) || !packet.TryReadString(out charname) ||
                    !packet.TryReadUShort(out randid) || !packet.TryReadByte(out admin) || !packet.TryReadString(out hostip))
                {
                    return;
                }
                ClientTransfer ct = new ClientTransfer(accountid, username, charname, randid, admin, hostip);
                ClientManager.Instance.AddTransfer(ct);
            }
        }
Beispiel #6
0
 public static void TryAssiging(LoginConnector lc)
 {
     using (var p = new InterPacket(InterHeader.Assign))
     {
         p.WriteByte(Settings.Instance.ID);
         p.WriteStringLen(Settings.Instance.WorldName);
         p.WriteStringLen(Settings.Instance.IP);
         p.WriteUShort(Settings.Instance.Port);
         lc.SendPacket(p);
     }
 }
Beispiel #7
0
 public static void HandleAssigned(LoginConnector lc, InterPacket packet)
 {
     Log.WriteLine(LogLevel.Info, "<3 LoginServer.");
 }
Beispiel #8
0
 public static void HandleAssigned(LoginConnector lc, InterPacket packet)
 {
     Log.WriteLine(LogLevel.Info, "<3 LoginServer.");
 }