[Tutorial] Netty Based Server

08/11/2016 01:32 ItsTequila#16
Tomorrow evening I will be doing some tests on server load and aliens. Everyone who wants to come is welcome. Saturday I will add the link to the main thread so you can come and help me testing.
The test will begin at 10:00 PM GMT+2
08/12/2016 01:02 LEJYONER(DS)#17
[Only registered and activated users can see links. Click Here To Register...]

We are just Turkish people.

ΉΛDΣS_PЯO[DΣV] / LEJYONER
08/12/2016 01:57 ItsTequila#18
Tomorrow's test will be basic testings so don't expect too many features ^^


Quote:
Originally Posted by LEJYONER(DS) View Post
[Only registered and activated users can see links. Click Here To Register...]

We are just Turkish people.

ΉΛDΣS_PЯO[DΣV] / LEJYONER
Just keep the credits as they are, you are free to add but not remove =)
08/12/2016 06:57 Requi#19
I still prefer my generic reading and writing for netty stuff. Because Netty (the "encoding") isn't much more then reversing the byte array.

Source:
[Only registered and activated users can see links. Click Here To Register...] PacketParser/PacketReader
[Only registered and activated users can see links. Click Here To Register...] PacketBuilder/PacketWriter

Quote:
Code:
public static void Handle(byte[] bytes, Client client)
        {
            var read = new ByteParser(bytes);
            switch (read.CMD_ID)
            {
                case 666:
                    Out.WriteLine("Received", "666");
                    var userId = read.Int();
                    var sid = read.UTF();
                    Console.WriteLine("UserID " + userId);
                    Console.WriteLine("Session-ID " + sid);
                    new handlers.ShipInitalizationHandler(client, userId, sid);
                    break;
                case LegacyModule.ID:
                    // This will dump all the old packets.
                    Dumper.Dump(read.UTF());
                    break;
                default:
                    // This will dump all the commands that aren't defined
                    // You can define a command by adding 'case CMDID:'
                    new Dumper(read);
                    break;
            }
        }
You should create a real handler.
PoC:
Code:
Dictionary<int, Function> CommandHandler = new Dictionary<int, Function>();
CommandHandler.Add(666, HandleVersionRequest);
if(CommandHandler.KeyExists(packet.Id))
CommandHandler[packet.Id](); //or .Invoke(); not sure
else
DumpCommand(packet);
08/12/2016 08:47 LEJYONER(DS)#20
Quote:
Originally Posted by NUMANDERBUHMAN View Post
Tomorrow's test will be basic testings so don't expect too many features ^^




Just keep the credits as they are, you are free to add but not remove =)
Dont worry, we are keep credits, Thank you.
08/12/2016 10:37 Gatmann#21
Quote:
Originally Posted by LEJYONER(DS) View Post
Dont worry, we are keep credits, Thank you.
Learn english,it's spelled we are going to keep the credits.

How do you get so much success with this grammar nazi,I have no idea...:confused:
08/12/2016 13:44 manulaiko3.0#22
Quote:
Originally Posted by Gatmann View Post
Learn english,it's spelled we are going to keep the credits.

How do you get so much success with this grammar nazi,I have no idea...:confused:
Did you seriously create an account for this? Your doing something wrong in life...
08/12/2016 18:02 LEJYONER(DS)#23
Quote:
Originally Posted by manulaiko3.0 View Post
Did you seriously create an account for this? Your doing something wrong in life...
You're just a people(?) smug.
08/14/2016 12:00 mustafagrlyn#24
Hello Iam ΉΛDΣS_PЯO[DΣV],

DroneFormation.cs Code :)

Thanks..


Netty Emulator: Shock[DEV]
Edited and Updated: ΉΛDΣS_PЯO[DΣV] :D

NOTE: This emulator (NeetyBase) created by Shock and edited by ΉΛDΣS_PЯO[DΣV].


Code:
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NettyBase.Net.netty.commands
{
    class DroneFormationCommand
    {
        public static byte[] CMD(List<int> availableFormations)
        {
            ByteArray enc = new ByteArray(4479);
            enc.Integer(availableFormations.Count);
            foreach(int f in availableFormations)
            {
                enc.Integer(f);
            }
            return enc.ToByteArray();
        }
    }
}
08/14/2016 12:42 LEJYONER(DS)#25
[Only registered and activated users can see links. Click Here To Register...]

don't work?
08/14/2016 16:35 ItsTequila#26
Quote:
Originally Posted by mustafagrlyn View Post
Hello Iam ΉΛDΣS_PЯO[DΣV],

DroneFormation.cs Code :)

Thanks..


Netty Emulator: Shock[DEV]
Edited and Updated: ΉΛDΣS_PЯO[DΣV] :D

NOTE: This emulator (NeetyBase) created by Shock and edited by ΉΛDΣS_PЯO[DΣV].


Code:
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NettyBase.Net.netty.commands
{
    class DroneFormationCommand
    {
        public static byte[] CMD(List<int> availableFormations)
        {
            ByteArray enc = new ByteArray(4479);
            enc.Integer(availableFormations.Count);
            foreach(int f in availableFormations)
            {
                enc.Integer(f);
            }
            return enc.ToByteArray();
        }
    }
}
Well done! You converted the command exactly as it was meant to be =)

Quote:
Originally Posted by LEJYONER(DS) View Post
[Only registered and activated users can see links. Click Here To Register...]

don't work?
Changing hosts so it will be buggy in the next few hours.
08/14/2016 18:39 LEJYONER(DS)#27
[Only registered and activated users can see links. Click Here To Register...]

Dont work again :(
08/14/2016 19:47 ItsTequila#28
Quote:
Originally Posted by LEJYONER(DS) View Post
[Only registered and activated users can see links. Click Here To Register...]

Dont work again :(
Should be working now perfectly ;)
08/14/2016 19:57 -=Flavio=-#29
emu for testing offline?
seems to be a good job will wait so that I can test.
08/14/2016 20:20 ItsTequila#30
Quote:
Originally Posted by -=Flavio=- View Post
emu for testing offline?
seems to be a good job will wait so that I can test.
Actually [Only registered and activated users can see links. Click Here To Register...] is made for localhost testing but if you want to test with me new features I do message me on skype. I will do a testing session tonight so you're free to come :3