Beispiel #1
0
        internal void LoadRequests(User User)
        {
            //UserData
            RequestPacket[4000] = new RequestPackets(User.HabboUser.Login);
            RequestPacket[8481] = new RequestPackets(User.HabboUser.sendPacket);
            RequestPacket[3670] = new RequestPackets(User.HabboUser.HomeRoom);
            RequestPacket[2806] = new RequestPackets(User.HabboUser.UpdateLook); // 30/12/2011
            RequestPacket[2135] = new RequestPackets(User.HabboUser.Sings); // 30/12/2011
            RequestPacket[1339] = new RequestPackets(User.HabboUser.Dance); // 30/12/2011
            RequestPacket[2812] = new RequestPackets(User.HabboUser.Wave); // 30/12/2011
            RequestPacket[372] = new RequestPackets(User.HabboUser.Sit); // 30/12/2011
            RequestPacket[2812] = new RequestPackets(User.HabboUser.Idle); // 30/12/2011
            RequestPacket[2301] = new RequestPackets(User.HabboUser.ChangeMotto); // 30/12/2011
            RequestPacket[9506] = new RequestPackets(User.HabboUser.UserProfile);
            RequestPacket[3108] = new RequestPackets(User.HabboUser.Chatting);
            RequestPacket[11037] = new RequestPackets(User.HabboUser.Stream);
            RequestPacket[167] = new RequestPackets(User.HabboUser.Ping);

            //Catalog
            RequestPacket[3903] = new RequestPackets(User.HabboCatalog.InitCatalog); // 30/12/2011
            RequestPacket[1640] = new RequestPackets(User.HabboCatalog.GetPages); // 30/12/2011

            //Navigator
            RequestPacket[3760] = new RequestPackets(User.HabboNavigator.MyRooms); // 30/12/2011
            RequestPacket[3435] = new RequestPackets(User.HabboNavigator.Search); // 30/12/2011

            //Rooms
            RequestPacket[1373] = new RequestPackets(User.HabboRooms.LoadRoom); // 30/12/2011
            RequestPacket[3918] = new RequestPackets(User.HabboRooms.LoadModel); // 30/12/2011
            RequestPacket[2232] = new RequestPackets(User.HabboRooms.ThirdRequest); // 30/12/2011
            RequestPacket[697] = new RequestPackets(User.HabboRooms.FourthRequest); // 30/12/2011
        }
Beispiel #2
0
        public HabboUser(User Info)
        {
            this.User = Info;
            int UserId = 1;

            MySQL Lol = new MySQL(Init.ServerMySQL);
            Lol.Query("SELECT * FROM users_characters WHERE Id = '" + UserId + "'");
            this.UserRow = Lol.Fetch_Assoc();
        }
Beispiel #3
0
        public gameConnection(Socket _ClientSocket, int _ConnectionID)
        {
            this.ConnectedUser = new User(this);
            this.Handler = new RequestMessages(_ConnectionID);
            Handler.User = this.ConnectedUser;
            Handler.LoadRequests(this.ConnectedUser);

            this.ClientSocket = _ClientSocket;
            this._ConnectionID = _ConnectionID;

            ConnectedUser.pingOK = true;
            Callback = new AsyncCallback(ReceivedData);

            WaitForData();
            Ping();

            connectionHelper.AddConnection(this, _ConnectionID);
        }
Beispiel #4
0
        public static void addUser(int userID, User User)
        {
            if (_Users.ContainsKey(userID))
            {
                User oldUser = ((User)_Users[userID]);
                oldUser.Disconnect();
                if (_Users.ContainsKey(userID))
                    _Users.Remove(userID);
            }

            MySQL dbClient = new MySQL(Zazlak.Init.ServerMySQL);
            dbClient.Query("SELECT IP FROM users_characters WHERE username = '******' LIMIT 1");
            if (User.IP == (string)dbClient.Fetch_Assoc()["ip"])
            {
                _Users.Add(userID, User);
                //dbClient.runQuery("UPDATE users SET ticket_sso = NULL WHERE id = '" + userID + "' LIMIT 1");
                //dbClient.runQuery("UPDATE users SET logins = logins + 1 WHERE id = '" + userID + "'");
                dbClient.Query("UPDATE users_characters SET lastaccess = '" + (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds + "' WHERE id = '1'");
                dbClient.Query("UPDATE users_characters SET lastaccess = '" + (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds + "' WHERE id = '2'");
                dbClient.Query("UPDATE users_characters SET connected = 1 WHERE id = '" + userID + "'");
                Out.WriteLine(User.HabboUser.UserRow["username"] + " has connected", ConsoleColor.DarkMagenta);
            }
        }
Beispiel #5
0
 private void Crash()
 {
     ClientSocket = null;
     dataBuffer = null;
     _ConnectionID = 0;
     ConnectedUser = null;
     Handler = null;
     SocketClosed = true;
     SocketReceivedPing = false;
     Callback = null;
 }