Results 1 to 6 of 6
  1. #1
    teamfe's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0

    Clientless with K-Relay.

    SOLVED: Lib_K_Relay.GameData.GameData.Load(); was needed before using Packets...

    Hello,

    I'm trying to make a clientless application using K-Relay library in C#.
    But I'm pretty sure it's something I'm missing when using this lib, since I get:
    Code:
    An unhandled exception of type 'System.*********enceException' occurred in Lib K Relay.dll
    Additional information: Object reference not set to an instance of an object.
    And I know what this means but I'm not sure how to initialize things properly with K-Relay without making a plugin. Code:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Lib_K_Relay;
    using Lib_K_Relay.Utilities;
    using Lib_K_Relay.Interface;
    using Lib_K_Relay.Networking;
    using Lib_K_Relay.Networking.Packets;
    using Lib_K_Relay.Networking.Packets.Client;
    using Lib_K_Relay.Networking.Packets.Server;
    using Lib_K_Relay.Networking.Packets.DataObjects;
    
    namespace RotmgBot {
        class Program {
            public static void Initialize (Proxy proxy) {
                proxy.ClientConnected += OnClientConnected;
            }
            public static void OnClientConnected (Client client) {
                Console.WriteLine("A Client connected!");
            }
    
           static void Main (string[] args) {
                System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient("54.154.210.40", 2050);
                Proxy proxy = new Proxy();
                proxy.Start();
                Initialize(proxy);
                HelloPacket helloP = Packet.Create<HelloPacket>(PacketType.HELLO); //Here is where error happens. Packet.Create throws error linked above.
                helloP.BuildVersion = "27.7.X10.2";
                helloP.GameId = -2;
                helloP.GUID = "email";
                helloP.Password = "pass";
                helloP.Random1 = new Random().Next(100, 1000);
                helloP.Random2 = new Random().Next(200, 200000);
                helloP.Secret = "";
                helloP.KeyTime = -1;
                helloP.Key = new byte[0];
                helloP.MapJSON = "";
                helloP.EntryTag = "";
                helloP.GameNet = "rotmg";
                helloP.GameNetUserId = "";
                helloP.PlayPlatform = "rotmg";
                helloP.PlatformToken = "";
                helloP.Send = true;
                helloP.UserToken = "";
                Client c = new Client(proxy, tcpClient);
                c.Connect(helloP);
                Console.Read();
            }
        }
    }
    Any help would be greatly appreciated.
    Last edited by teamfe; 01-24-2017 at 12:36 AM. Reason: Solved

  2. #2
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,605
    Reputation
    386
    Thanks
    4,708
    My Mood
    Angelic
    Quote Originally Posted by teamfe View Post
    Hello,

    <...>
    Any help would be greatly appreciated.
    Try
    Code:
    HelloPacket hellop = (HelloPacket)Packet.Create(PacketType.HELLO);
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  3. #3
    teamfe's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by PKTINOS View Post

    Try
    Code:
    HelloPacket hellop = (HelloPacket)Packet.Create(PacketType.HELLO);
    Same issue, I'm pretty sure I'm just missing something because it's "Packet" class it's saying is null pretty much. :/

    - - - Updated - - -

    Solved... didn't Lib_K_Relay.GameData.GameData.Load(); before...

  4. #4
    shadowera13's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    My Mood
    Cold
    Don't forget to encrypt Pass and Email

    Code:
    private static HelloPacket CreateHello(string email, string pass)
            {
                HelloPacket hello = (HelloPacket)Packet.Create(PacketType.HELLO);
                hello.BuildVersion = "27.7.0";
                hello.GameId = -2;
                hello.GUID = RSAx.Encrypt(email);
                hello.Password = RSAx.Encrypt(pass);
                hello.Random1 = new Random().Next(0x186a0, 0xf4240);
                hello.Random2 = new Random().Next(0x30d40, 0x1312d00);
                hello.Secret = "";
                hello.KeyTime = -1;
                hello.Key = new byte[0];
                hello.MapJSON = "";
                hello.EntryTag = "";
                hello.GameNet = "rotmg";
                hello.GameNetUserId = "";
                hello.PlayPlatform = "rotmg";
                hello.PlatformToken = "";
                hello.Send = true;
                hello.UserToken = "";
                return hello;
            }

  5. #5
    teamfe's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    Yep, got a function like it pretty much. All good now.

  6. #6
    pshotsc's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Location
    On the top of the mountain called: SE Mountain
    Posts
    532
    Reputation
    10
    Thanks
    639
    My Mood
    Worried
    @059 @Ahlwong solved

Similar Threads

  1. [Help Request] Help with realm relay
    By fatkidsgowii84 in forum Realm of the Mad God Help & Requests
    Replies: 0
    Last Post: 05-12-2014, 06:16 PM
  2. Help with Realm Relay
    By derp123derp in forum Realm of the Mad God Help & Requests
    Replies: 0
    Last Post: 05-08-2014, 08:50 PM
  3. [Help Request] Help With Realm Relay.
    By LittleOven in forum Realm of the Mad God Help & Requests
    Replies: 5
    Last Post: 04-26-2014, 11:14 AM
  4. PLEASE NEED HELP WITH REALM RElAY
    By DANWARPER in forum Realm of the Mad God Help & Requests
    Replies: 18
    Last Post: 01-04-2014, 05:38 AM
  5. [Help Request] need help with realm relay
    By Hurcan in forum Realm of the Mad God Help & Requests
    Replies: 0
    Last Post: 01-04-2014, 12:50 AM