Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C#] Project H(S)R - 'Full' R38 Server

Status
Not open for further replies.
git bisect -m
Loyal Member
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916
No, you clearly don't understand. I meant my shockwave loader stopped working out of nowhere, like it doesn't create a connection to my server. Room entry still works. But I can't test if it works on shockwave due to my shockwave loader being broken.

You mean Shockware stopped working? Or your Schokwave client isn't working?

One thing that i didn't understood. v38 Emulator is compatible with Flash and Shockwave in same time?
I mean, you can enter in Shockwave or Flash in the same server, and see the same stuff?

If yes, that's amazing, and remembers a RuneScape feature. Since a lot of people like Old School. Creating a server with Double Functionality will be awesome. Obviously need to make some tricks to enable Shockwave in Chrome or Firefox. So i'm introducing this idea:

Habbo Browser. A C# Browser that goes directly to your server page and that works with Shockwave and Flash same time.. The popular browsers are killing Flash and already killed Shockwave (In Firefox you can still use & Opera too)...

I think will be awesome.

#ontopic
My semester it's finishing, and i still dunno if will continue with Habbo. I think i will stop with Habbo... :/



Obs.: Found this at web: https://helpx.adobe.com/shockwave/kb/enabling-shockwave-player.html
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
@saamus
The shockwave client does load, but like 90% (where before it was like 95%) and it doesn't create a connection anymore).

1. Get the shockwave dll
2. Add it to a C# project
3. Use it in winforms
4. Congratulations, you created a shockwave client.

Also, you can download the flash dll as well and use it in winforms as well. It's not hard.
 
git bisect -m
Loyal Member
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916
@saamus
The shockwave client does load, but like 90% (where before it was like 95%) and it doesn't create a connection anymore).

1. Get the shockwave dll
2. Add it to a C# project
3. Use it in winforms
4. Congratulations, you created a shockwave client.

Also, you can download the flash dll as well and use it in winforms as well. It's not hard.

I didn't said it's hard. Only said that will be good. Maybe i will do this in the free time (if i had some free time)
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
I don't understand stuff of room entry...

I always thought the correct order was:

1. Client sends packet for flat entry
2. Server sends some poop back (like open connection, AE packet, room score, event info etc.)
3. Client sends packet for furniture aliases
4. Server sends back furniture aliases
5. Client sends packet for group badges
6. Server sends back group badges
7. Server sends other packets for model etc.

What happens, after sending furniture aliases and group badges, it sends the room ad packet, I send room ad packet back, but then I don't receive anything anymore. R40 holograph emulator, Torpeedo, UberEmu, all can't help me really, they all do it the "wrong" way.

'Cuz Flash entry is a witch, I decided to make shockwave first (my shockwave is fixed).

YltAEuM - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


Still need to do a lot, such as doorbell entry, password entry, room items and whatnot. Public rooms most likely doesn't work.

cewI4JD - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
As I don't always want to work on my v38, I got a little side-project I can sometimes work on. It's more like a secondary project and it's much different from the v38:

- It's written in Java
- The project name is FuseServer
- It's... v9?
- It will contain some VERY SPECIAL features (I won't spoil the fun for you... ;-))

The source code is written from scratch. A few examples of the source:

PHP:
public class UPDATE  implements IMessageHandler {

    @Override
    public void handle(GameSession session) {
        //@l@D@Y8420118001270012900121001@F@Cbla
        TMap<Integer, String> userPacket = session.getRequest().decodeUserPacket();
        
        String newFigure = userPacket.get(4);
        String newGender = userPacket.get(5);
        String newMotto = userPacket.get(6);
        
        if (newFigure == null && newGender == null && newMotto == null) // no updates, useless to continue
            return;
        
        if (newFigure != null) 
            session.getHabbo().setFigure(newFigure);
        
        if (newGender != null) 
            session.getHabbo().setGender(newGender);
        
        if (newMotto != null) 
            session.getHabbo().setMotto(newMotto);
        
        session.getHabbo().updateAppearance();
        
        session.sendMessage(USEROBJECT.compose(session.getHabbo()));
    }

}

PHP:
public class FuseCache<TKey, TValue> {
    
    private final TMap<TKey, TValue> _cache;
    private final Function<TKey, TValue> _func;
    
    public FuseCache(Function<TKey, TValue> func) {
        _cache = new THashMap<>();
        _func = func;
    }
    
    public TValue get(TKey key) {
        if (_cache.containsKey(key)) 
            return _cache.get(key);
        
        TValue value = _func.apply(key);
        _cache.put(key, value);
        return value;
    }
    
    public void set(TKey key, TValue value) {
        _cache.put(key, value);
    }

}

PHP:
public class HabboLoader {
    
    private final FuseCache<Integer, Habbo> _habbosById;
    private final FuseCache<String, Habbo> _habbosByName;
    
    public HabboLoader() {
        _habbosById = new FuseCache<>(id -> getHabboById(id));
        _habbosByName = new FuseCache<>(name -> getHabboByName(name));
    }
    
    public Habbo select(int id) {
        return _habbosById.get(id);
    }
    
    public Habbo select(String name) {
        return _habbosByName.get(name);
    }
    
    private Habbo getHabboByName(String name) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `name` = ? LIMIT 1");
            client.setString(1, name);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with Name '" + name + "', error: " + ex.getMessage());
        }
        
        return null;
    }
    
    private Habbo getHabboById(int id) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `id` = ? LIMIT 1");
            client.setInt(1, id);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with ID '" + id + "', error: " + ex.getMessage());
        }
        
        return null;
    }

}

Screenies:

gPQyvbQ - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


More isn't done. Also, please note, this doesn't mean the v38 is abandoned, it's just that working 24/7 on the same project gets kind of boring. And since there are no good easy-to-setup v9 servers (Thor isn't exactly easy to setup and misses a lot of things) I thought: why no v9? Also, camera will get coded. Camera credits goes to Nillus I use Maven blabla now I want cookies.
 

Attachments

You must be registered for see attachments list
git bisect -m
Loyal Member
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916
As I don't always want to work on my v38, I got a little side-project I can sometimes work on. It's more like a secondary project and it's much different from the v38:

- It's written in Java
- The project name is FuseServer
- It's... v9?
- It will contain some VERY SPECIAL features (I won't spoil the fun for you... ;-))

The source code is written from scratch. A few examples of the source:

PHP:
public class UPDATE  implements IMessageHandler {

    @Override
    public void handle(GameSession session) {
        //@l@D@Y8420118001270012900121001@F@Cbla
        TMap<Integer, String> userPacket = session.getRequest().decodeUserPacket();
        
        String newFigure = userPacket.get(4);
        String newGender = userPacket.get(5);
        String newMotto = userPacket.get(6);
        
        if (newFigure == null && newGender == null && newMotto == null) // no updates, useless to continue
            return;
        
        if (newFigure != null) 
            session.getHabbo().setFigure(newFigure);
        
        if (newGender != null) 
            session.getHabbo().setGender(newGender);
        
        if (newMotto != null) 
            session.getHabbo().setMotto(newMotto);
        
        session.getHabbo().updateAppearance();
        
        session.sendMessage(USEROBJECT.compose(session.getHabbo()));
    }

}

PHP:
public class FuseCache<TKey, TValue> {
    
    private final TMap<TKey, TValue> _cache;
    private final Function<TKey, TValue> _func;
    
    public FuseCache(Function<TKey, TValue> func) {
        _cache = new THashMap<>();
        _func = func;
    }
    
    public TValue get(TKey key) {
        if (_cache.containsKey(key)) 
            return _cache.get(key);
        
        TValue value = _func.apply(key);
        _cache.put(key, value);
        return value;
    }
    
    public void set(TKey key, TValue value) {
        _cache.put(key, value);
    }

}

PHP:
public class HabboLoader {
    
    private final FuseCache<Integer, Habbo> _habbosById;
    private final FuseCache<String, Habbo> _habbosByName;
    
    public HabboLoader() {
        _habbosById = new FuseCache<>(id -> getHabboById(id));
        _habbosByName = new FuseCache<>(name -> getHabboByName(name));
    }
    
    public Habbo select(int id) {
        return _habbosById.get(id);
    }
    
    public Habbo select(String name) {
        return _habbosByName.get(name);
    }
    
    private Habbo getHabboByName(String name) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `name` = ? LIMIT 1");
            client.setString(1, name);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with Name '" + name + "', error: " + ex.getMessage());
        }
        
        return null;
    }
    
    private Habbo getHabboById(int id) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `id` = ? LIMIT 1");
            client.setInt(1, id);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with ID '" + id + "', error: " + ex.getMessage());
        }
        
        return null;
    }

}

Screenies:

gPQyvbQ - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


More isn't done. Also, please note, this doesn't mean the v38 is abandoned, it's just that working 24/7 on the same project gets kind of boring. And since there are no good easy-to-setup v9 servers (Thor isn't exactly easy to setup and misses a lot of things) I thought: why no v9? Also, camera will get coded. Camera credits goes to Nillus I use Maven blabla now I want cookies.

Glaceon, you're the old school king. I really appreciate your work. Keep strong!
 

Attachments

You must be registered for see attachments list
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
@saamus thank you.

I'm just waiting for a certain person whose name I'm not going to mention to come online (he/she/it will provide me with some stuff), I cannot wait till I can show you the stuff.

Development will continue later today. If anybody have some unique ideas (can also be custom features), tell me.
 
Joined
Mar 7, 2007
Messages
526
Reaction score
181
As I don't always want to work on my v38, I got a little side-project I can sometimes work on. It's more like a secondary project and it's much different from the v38:

- It's written in Java
- The project name is FuseServer
- It's... v9?
- It will contain some VERY SPECIAL features (I won't spoil the fun for you... ;-))

The source code is written from scratch. A few examples of the source:

PHP:
public class UPDATE  implements IMessageHandler {

    @Override
    public void handle(GameSession session) {
        //@l@D@Y8420118001270012900121001@F@Cbla
        TMap<Integer, String> userPacket = session.getRequest().decodeUserPacket();
        
        String newFigure = userPacket.get(4);
        String newGender = userPacket.get(5);
        String newMotto = userPacket.get(6);
        
        if (newFigure == null && newGender == null && newMotto == null) // no updates, useless to continue
            return;
        
        if (newFigure != null) 
            session.getHabbo().setFigure(newFigure);
        
        if (newGender != null) 
            session.getHabbo().setGender(newGender);
        
        if (newMotto != null) 
            session.getHabbo().setMotto(newMotto);
        
        session.getHabbo().updateAppearance();
        
        session.sendMessage(USEROBJECT.compose(session.getHabbo()));
    }

}

PHP:
public class FuseCache<TKey, TValue> {
    
    private final TMap<TKey, TValue> _cache;
    private final Function<TKey, TValue> _func;
    
    public FuseCache(Function<TKey, TValue> func) {
        _cache = new THashMap<>();
        _func = func;
    }
    
    public TValue get(TKey key) {
        if (_cache.containsKey(key)) 
            return _cache.get(key);
        
        TValue value = _func.apply(key);
        _cache.put(key, value);
        return value;
    }
    
    public void set(TKey key, TValue value) {
        _cache.put(key, value);
    }

}

PHP:
public class HabboLoader {
    
    private final FuseCache<Integer, Habbo> _habbosById;
    private final FuseCache<String, Habbo> _habbosByName;
    
    public HabboLoader() {
        _habbosById = new FuseCache<>(id -> getHabboById(id));
        _habbosByName = new FuseCache<>(name -> getHabboByName(name));
    }
    
    public Habbo select(int id) {
        return _habbosById.get(id);
    }
    
    public Habbo select(String name) {
        return _habbosByName.get(name);
    }
    
    private Habbo getHabboByName(String name) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `name` = ? LIMIT 1");
            client.setString(1, name);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with Name '" + name + "', error: " + ex.getMessage());
        }
        
        return null;
    }
    
    private Habbo getHabboById(int id) {
        try (DatabaseClient client = FuseProgram.getServer().getDatabase().getClient()) {
            client.setQuery("SELECT * FROM `habbos` WHERE `id` = ? LIMIT 1");
            client.setInt(1, id);
            
            ResultSet set = client.getResultSet();
            
            if (set.next()) {
                Habbo habbo = new Habbo(set);
                _habbosById.set(habbo.getId(), habbo);
                _habbosByName.set(habbo.getName(), habbo);
                return habbo;
            }
        } catch (Exception ex) {
            Logger.logDebug("Cannot fetch habbo with ID '" + id + "', error: " + ex.getMessage());
        }
        
        return null;
    }

}

Screenies:

gPQyvbQ - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


More isn't done. Also, please note, this doesn't mean the v38 is abandoned, it's just that working 24/7 on the same project gets kind of boring. And since there are no good easy-to-setup v9 servers (Thor isn't exactly easy to setup and misses a lot of things) I thought: why no v9? Also, camera will get coded. Camera credits goes to Nillus I use Maven blabla now I want cookies.

if (newFigure == null && newGender == null && newMotto == null) // no updates, useless to continue <<<< check everything <
return;

if (
newFigure != null) // ?
session.getHabbo().setFigure(newFigure);

if (
newGender != null) // ?
session.getHabbo().setGender(newGender);

if (
newMotto != null) // ?
session.getHabbo().setMotto(newMotto);

why those null checks if you already do a check with a return? + && < so it means everything need to be null / just wondering how can the incoming packet to be null? emtpy string?

goodluck with ya side project
 

Attachments

You must be registered for see attachments list
Joined
Jun 23, 2010
Messages
2,324
Reaction score
2,195
if (newFigure == null && newGender == null && newMotto == null) // no updates, useless to continue <<<< check everything <
return;

if (
newFigure != null) // ?
session.getHabbo().setFigure(newFigure);

if (
newGender != null) // ?
session.getHabbo().setGender(newGender);

if (
newMotto != null) // ?
session.getHabbo().setMotto(newMotto);

why those null checks if you already do a check with a return? + && < so it means everything need to be null / just wondering how can the incoming packet to be null? emtpy string?

goodluck with ya side project

Obviously, not to send a update response.
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
@vista4life maybe it's time to explain it. The v9 packet for REGISTER and UPDATE are done in a weird way. Instead of the usual @DJosh@C123 like for LOGIN, they add another encoded int before the string length. Sometimes - for example if you don't change your motto or gender - this value can be missing. So lets look at this packet: //@l@D@Y8420118001270012900121001@F@Cbla

The @E encoded int is missing, because I didn't change my gender. Although, when I do, it appears. If I don't recheck and I don't change my gender, it'll turn my gender into a null value. Also, it shouldn't attempt to even update anything. If I remove the extra checks, gender can become null, we don't want that. Period. But no, I've thought about it.
 
Joined
Mar 7, 2007
Messages
526
Reaction score
181
Code:
public string GenerateClientMap(Room room)
        {
            string[] splitMap = Map.Split('|');
            StringBuilder clientMap = new StringBuilder(splitMap.Length);

            for (int y = 0; y < splitMap.Length; y++)
            {
                for (int x = 0; x < splitMap[y].Length; x++)
                {
                    string square = splitMap[y][x].ToString();

                    if (x == DoorX && y == DoorY)
                        square = ((int)DoorHeight).ToString();

                    clientMap.Append(square);
                }

                clientMap.Append((char)(13));
            }

            return clientMap.ToString();
        }
 
Last edited by a moderator:
git bisect -m
Loyal Member
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916


Video since making photos of certain things doesn't show much. Watch in YouTube to make me earn some money btw. Money is imporant! Just kidding haha.
Glaceon, that's so nice. This video gave me a lot of nostalgia. Make a video of the Habbo Beta ;) (that will give me much more nostalgia)



Like this: https://www.youtube.com/watch?v=6BZQsFZ8l4I
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Ip1mSv7 - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


Floor furni placing is not made, but wall furni placing is done. Also, there's a small bug:

nUB7v8P - [C#] Project H(S)R - 'Full' R38 Server - RaGEZONE Forums


This only happens when you enter the room for the second time.
 

Attachments

You must be registered for see attachments list
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
I will pull out a DEV release soon, 'cuz why not? I might do some stuff tomorrow morning or else next week ('cuz exams during the week drain my energy).

The General and now comes the funny part: it's ONLY on the second time. The third/fourth etc. time and the first time it doesn't do that. That gets me really curious.
 
Status
Not open for further replies.
Back
Top