Results 1 to 7 of 7
  1. #1
    Fightera100's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    662
    Reputation
    10
    Thanks
    1,684

    [C#] [K-Relay ]Help with /tell (textpacket)

    Hey,

    I just started learning C# actively now and need some help already.

    Currently I got this code:

    Code:
            public void sendmessage(Client client)
            {
                TextPacket textpacket = (TextPacket)Packet.Create(PacketType.TEXT);
                textpacket.Recipient = currenttrader; // defined before and prints the right name
                textpacket.Name = client.PlayerData.Name; // Pretty sure this is correct
                textpacket.ObjectId = -1; // I don't know how to get this one
                textpacket.Text = message; // message defined before
                textpacket.NumStars = 65; // What to enter here?
                textpacket.BubbleTime = 10; // all pms seem to be 10 seconds long
                textpacket.Id = 34; //copied from looking at other /tell messages
                textpacket.Send = true; // copied from looking at other /tell messages
    
                Console.WriteLine("Sending message...");
                client.SendToServer(textpacket);
                Console.WriteLine("Sent message!");
            }
    and it error if I try to execute it. I don't know how to get some of these and would be happy if someone could help.

    2. question is,

    how can I update the trade on my own client? It works but I want it to be updated on my side aswell:



    I tried sending the Tradechanged packet to the client but it doesn't seem to work.

  2. #2
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    The code you have does not send a tell to anyone. If you want to send a line of text to be shown in the client you use the code you have.

    For sending a tell to someone, do this:
    Code:
    public void sendmessage(Client client)
    {
    	PlayerTextPacket textpacket = (PlayerTextPacket)Packet.Create(PacketType.PLAYERTEXT);
    	textpacket.Text = "/tell "+currenttrader+" "+message;
    	//Don't define properties Id or Send (i.e. textpacket.Send), those are inherited from Packet class
    
    	//Console.WriteLine("Sending message..."); //not especially useful, this just tells that the code has reached this point
    	client.SendToServer(textpacket);
    	//Console.WriteLine("Sent message!");
    }
    You don't seem to understand the difference between client packets and server packets. Client packets are for sending data to server (e.g. a tell to someone) whereas server packets are used to send data to the client connected to K Relay.

    PLAYERTEXT is a client packet so you can use it to send a message to someone other than you.
    TEXT is a server packet so you can use it to send information to the client.

    _____________________________

    Quote Originally Posted by Fightera100 View Post
    how can I update the trade on my own client? It works but I want it to be updated on my side aswell

    I tried sending the Tradechanged packet to the client but it doesn't seem to work.
    The server tells what your trade partner is doing. You need to tell to the server what you're doing. Again this is related to the concept of server and client packets.

    Here's a list of trade packets:

    Client:
    ACCEPTTRADE
    CANCELTRADE
    CHANGETRADE
    REQUESTTRADE

    Server:
    TRADEACCEPTED
    TRADECHANGED
    TRADEDONE
    TRADEREQUESTED
    TRADESTART

    You don't want to use any of the server packets. Those only deliver data to your client.

    To select an item to be traded you use the CHANGETRADE packet, not TRADECHANGED.

    _____________________________

    I learned the packet structure of the game when Realm Relay was released. The release included a nice little cheat sheet of all the packets and what they contain. This was really helpful to me as it made looking for the right packet convenient.

    I've updated some of it but most of the newer packets are missing and some property names are wrong (which is not really that big of a deal). Here it is:

     
    Code:
    Realm Relay v1.1.0 Script Documentation
    designed for ROTMG v17.3+
    ________________________________________________________________
    :INDEX
    - Slot type info - SLOTTYPES
    - Object data info - OBJECTS
    - Packet data info - PACKETS
    ________________________________________________________________
    :SLOTTYPES
    
    Abilities
    4
    5
    11
    12
    13
    15
    16
    18
    19
    20
    21
    22
    23
    25
    
    Consumables
    10
    
    Weapons
    1
    2
    3
    8
    17
    24
    
    Armor
    6
    7
    14
    
    Rings
    9
    ________________________________________________________________
    :OBJECTS
    
    BitmapData
    	int width
    	int height;
    	byte[] bytes;
    	
    Entity
    	short objectType
    	Status status
    	
    Status
    	int objectId
    	Location pos
    	StatData[] data
    	
    StatData
    	int id
    	int intValue
    	string stringValue
    	
    id
    	MAX_HEALTH = 0 
    	HEALTH = 1
    	SIZE = 2
    	MAX_MANA = 3
    	MANA = 4
    	XP_GOAL = 5
    	XP = 6
    	LEVEL = 7
    	INVENTORY = [i for i in range(8, 20)]
    	ATT = 20
    	DEF = 21
    	SPD = 22
    	#23-25 missing from the client
    	VIT = 26
    	WIS = 27
    	DEX = 28
    	CONDITION = 29
    	STARS = 30
    	NAME = 31
    	TEXTURE1 = 32
    	TEXTURE2 = 33
    	MERCHANT_TYPE = 34
    	REALM_GOLD = 35
    	PRICE = 36
    	BOOL_CAN_ENTER_PORTAL = 37
    	ACCOUNT_ID = 38
    	CURRENT_FAME = 39
    	MERCHANT_CURRENCY = 40
    	OBJECT_ORIENTATION = 41
    	MERCHANT_ITEMS_LEFT = 42
    	MERCHANT_MINUTES_LEFT = 43
    	MERCHANT_DISCOUNT = 44
    	MERCHANT_RANK_REQUIRED = 45
    	HEALTH_BONUS = 46
    	MANA_BONUS = 47
    	ATT_BONUS = 48
    	DEF_BONUS = 49
    	SPD_BONUS = 50
    	VIT_BONUS = 51
    	WIS_BONUS = 52
    	DEX_BONUS = 53
    	CONTAINER_OWNER = 54
    	NAMECHANGE_RANK_REQUIRED = 55
    	BOOL_NAME_REGISTERED = 56
    	FAME = 57
    	FAME_GOAL = 58
    	GLOWING_EFFECT = 59
    	SINK_DEPTH = 60
    	ALT_TEXTURE = 61
    	GUILD = 62
    	GUILD_RANK = 63
    	BREATH = 64
    	XP_BOOSTED = 65
    	XPBOOST_TIME_LEFT = 66
    	DROPRATE_TIME_LEFT = 67
    	LOOTTIER_TIME_LEFT = 68
    	HEALTHPOT_COUNT = 69
    	MANAPOT_COUNT = 70
    	BACKPACK = [i for i in range(71, 79)]
    	BOOL_HAS_BACKPACK = 79
    	PET_SKIN_OBJECT_TYPE = 80
    	PET_ID = 81
    	PET_SKIN = 82
    	PET_TYPE = 83
    	PET_RARITY = 84
    	PET_MAX_LEVEL = 85
    	PET_UNK1 = 86 #Reserved for a pet feature, but not yet implemented (13.2)
    	FOOD_SPENT_ON_SKILL1 = 87
    	FOOD_SPENT_ON_SKILL2 = 88
    	FOOD_SPENT_ON_SKILL3 = 89
    	PET_SKILL1_LEVEL = 90
    	PET_SKILL2_LEVEL = 91
    	PET_SKILL3_LEVEL = 92
    	PET_SKILL1_TYPE = 93
    	PET_SKILL2_TYPE = 94
    	PET_SKILL3_TPYE = 95
    	
    GroundData
    	string id
    	int type
    	int maxDamage
    	int minDamage
    	boolean noWalk
    	boolean push
    	boolean sink
    	float speed
    	
    Item
    	int item
    	int slotType
    	boolean tradeable
    	boolean included
    	
    ItemData
    	string id
    	int type
    	int slotType
    	int tier
    	string petFamily
    	string rarity
    	string activate
    	boolean consumable
    	boolean soulbound
    	boolean usable
    	int bagType
    	int feedPower
    	float rateOfFire
    	int fameBonus
    	int mpCost
    	int mpEndCost
    	boolean multiPhase
    	int numProjectiles
    	ProjectileData[] projectiles
    	
    Location
    	float x
    	float y
    	float distanceSquaredTo(Location location)
    	float distanceTo(Location location)
    	
    LocationRecord
    	int time
    	float x
    	float y
    	float distanceSquaredTo(Location location)
    	float distanceTo(Location location)
    	
    ObjectData
    	string id
    	int type
    	int maxHitPoints
    	int maxSize
    	int minSize
    	int size
    	int sizeStep
    	int shadowSize
    	int color
    	float xpMult
    	float rotation
    	boolean drawOnGround
    	boolean enemy
    	boolean fullOccupy
    	boolean occupySquare
    	boolean enemyOccupySquare
    	boolean blocksSight
    	boolean noMiniMap
    	boolean stasisImmune
    	boolean protectFromGroundDamage
    	boolean protectFromSink
    	boolean connects
    	float z
    	
    Packet
    	byte id()
    	string toString()
    	
    ProjectileData
    	string objectId
    	float speed
    	int maxDamage
    	int minDamage
    	int lifetimeMS
    	
    SlotObject
    	int objectId
    	int slotId
    	int objectType
    	
    Tile
    	short x
    	short y
    	int type
    ________________________________________________________________
    :PACKETS
    - All packet objects implement the id() function
    
    !!! The following packets are CLIENT packets !!!
    
    ACCEPTTRADE
    	boolean[] myOffer
    	boolean[] yourOffer
    	
    AOEACK
    	int time
    	Location position
    	
    BUY
    	int objectId
    	
    CANCELTRADE
    	
    CHANGEGUILDRANK
    	string name
    	int guildRank
    	
    CHANGETRADE
    	boolean[] offer
    	
    CHECKCREDITS
    	
    CHOOSENAME
    	string name
    	
    CREATEGUILD
    	string name
    	
    CREATE
    	int classType
    	int skinType
    	
    EDITACCOUNTLIST
    	int accountListId
    	boolean add
    	int objectId
    	
    ENEMYHIT
    	int time
    	int bulletId
    	int targetId
    	boolean kill
    	
    ESCAPE
    
    GOTOACK
    	int time
    	
    GROUNDDAMAGE
    	int time
    	Location position
    	
    GUILDINVITE
    	string name
    	
    GUILDREMOVE
    	string name
    	
    HELLO
    	string buildVersion
    	int gameId
    	string guid
    	string password
    	string secret
    	int keyTime
    	byte[] key
    	byte[] obf0
    	string obf1
    	string obf2
    	string obf3
    	string obf4
    	string obf5
    	
    INVDROP
    	SlotObject slotObject
    	
    INVSWAP
    	int time
    	Location position
    	SlotObject slotObject1
    	SlotObject slotObject2
    	
    JOINGUILD
    	string guildName
    	
    LOAD
    	int charId
    	boolean isFromArena
    	
    MOVE
    	int tickId
    	int time
    	Location newPosition
    	LocationRecord[] records
    	
    OTHERHIT
    	int time
    	int bulletId
    	int objectId
    	int targetId
    	
    PLAYERHIT
    	int bulletId
    	int objectId
    	
    PLAYERSHOOT
    	int time
    	int bulletId
    	int containerType
    	Location startingPos
    	float angle
    	
    PLAYERTEXT
    	string text
    	
    PONG
    	int serial
    	int time
    	
    REQUESTTRADE
    	string name
    	
    RESKIN
    	int skinID
    	
    SETCONDITION
    	int conditionEffect
    	float conditionDuration
    	
    SHOOTACK
    	int time
    	
    SQUAREHIT
    	int time
    	int bulletId
    	int objectId
    	
    TELEPORT
    	int objectId
    	
    UPDATEACK
    
    USEITEM
    	int time
    	SlotObject slotObject
    	Location itemUsePos
    	int useType
    	
    USEPORTAL
    	int objectId
    	
    !!! The following packets are SERVER packets !!!
    
    ACCOUNTLIST
    	int accountListId
    	string[] accountIds
    	
    ALLYSHOOT
    	int bulletId
    	int ownerId
    	short containerId
    	float angle
    	
    AOE
    	Location pos
    	float radius
    	int damage
    	int effect
    	float duration
    	int origType
    	
    BUY
    	int result
    	string resultString
    	
    CLIENTSTAT
    	string name
    	int value
    	
    CREATE_SUCCESS
    	int objectId
    	int charId
    	
    CREATEGUILDRESULT
    	boolean success
    	string errorText
    	
    DAMAGE
    	int targetId
    	int[] effects
    	int damageAmount
    	boolean kill
    	int bulletId
    	int objectId
    	
    DEATH
    	string accountId
    	int charId
    	string killedBy
    	int obf0
    	int obf1
    
    FAILURE
    	int errorId
    	string errorDescription
    	
    FILE
    	string name
    	byte[] bytes
    	
    GLOBAL_NOTIFICATION
    	int type
    	string text
    	
    GOTO
    	int objectId
    	Location pos
    	
    INVITEDTOGUILD
    	string name
    	string guildName
    	
    INVRESULT
    	int result
    	
    MAPINFO
    	int width
    	int height
    	string name
    	string obf0
    	int obf1
    	int fp
    	int background
    	boolean allowPlayerTeleport
    	boolean showDisplays
    	string[] clientXML
    	string[] extraXML
    	
    NAMERESULT
    	boolean success
    	string errorText
    	
    NEWTICK
    	int tickId
    	int tickTime
    	Status[] statuses
    	
    NOTIFICATION
    	int objectId
    	string message
    	int color
    	
    PIC
    	BitmapData bitmapData
    	
    PING
    	int serial
    	
    PLAYSOUND
    	int ownerId
    	int soundId
    	
    QUESTOBJID
    	int objectId
    	
    RECONNECT
    	string name
    	string host
    	int port
    	int gameId
    	int keyTime
    	boolean isFromArena
    	byte[] key
    	
    SERVERPLAYERSHOOT (SHOOT2)
    	int bulletId
    	int ownerId
    	int containerId
    	Location startingPos
    	float angle
    	short damage
    	
    ENEMYSHOOT (SHOOT)
    	int bulletId
    	int ownerId
    	int bulletType
    	Location startingPos
    	float angle
    	short damage
    	int numShots
    	float angleInc
    	
    SHOW_EFFECT
    	int effectType
    	int targetObjectId
    	Location pos1
    	Location pos2
    	int color
    	
    TEXT
    	string name
    	int objectId
    	int numStars
    	int bubbleTime
    	string recipient
    	string text
    	string cleanText
    	
    TRADEACCEPTED
    	boolean[] myOffer
    	boolean[] yourOffer
    	
    TRADECHANGED
    	boolean[] offer
    	
    TRADEDONE
    	int code
    	string description
    	
    TRADEREQUESTED
    	string name
    	
    TRADESTART
    	Item[] myItems
    	string yourName
    	Item[] yourItems
    
    UPDATE
    	Tile[] tiles
    	Entity[] newObjs
    	int[] drops
    Last edited by CrazyJani; 09-24-2016 at 09:27 AM.

  3. The Following User Says Thank You to CrazyJani For This Useful Post:

    Fightera100 (09-24-2016)

  4. #3
    Fightera100's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    662
    Reputation
    10
    Thanks
    1,684
    Quote Originally Posted by CrazyJani View Post
    The code you have does not send a tell to anyone. If you want to send a line of text to be shown in the client you use the code you have.

    For sending a tell to someone, do this:
    Code:
    public void sendmessage(Client client)
    {
    	PlayerTextPacket textpacket = (PlayerTextPacket)Packet.Create(PacketType.PLAYERTEXT);
    	textpacket.Text = "/tell "+currenttrader+" "+message;
    	//Don't define properties Id or Send (i.e. textpacket.Send), those are inherited from Packet class
    
    	//Console.WriteLine("Sending message..."); //not especially useful, this just tells that the code has reached this point
    	client.SendToServer(textpacket);
    	//Console.WriteLine("Sent message!");
    }
    You don't seem to understand the difference between client packets and server packets. Client packets are for sending data to server (e.g. a tell to someone) whereas server packets are used to send data to the client connected to K Relay.

    PLAYERTEXT is a client packet so you can use it to send a message to someone other than you.
    TEXT is a server packet so you can use it to send information to the client.

    _____________________________



    The server tells what your trade partner is doing. You need to tell to the server what you're doing. Again this is related to the concept of server and client packets.

    Here's a list of trade packets:

    Client:
    ACCEPTTRADE
    CANCELTRADE
    CHANGETRADE
    REQUESTTRADE

    Server:
    TRADEACCEPTED
    TRADECHANGED
    TRADEDONE
    TRADEREQUESTED
    TRADESTART

    You don't want to use any of the server packets. Those only deliver data to your client.

    To select an item to be traded you use the CHANGETRADE packet, not TRADECHANGED.

    _____________________________

    I learned the packet structure of the game when Realm Relay was released. The release included a nice little cheat sheet of all the packets and what they contain. This was really helpful to me as it made looking for the right packet convenient.

    I've updated some of it but most of the newer packets are missing and some property names are wrong (which is not really that big of a deal). Here it is:

     
    Code:
    Realm Relay v1.1.0 Script Documentation
    designed for ROTMG v17.3+
    ________________________________________________________________
    :INDEX
    - Slot type info - SLOTTYPES
    - Object data info - OBJECTS
    - Packet data info - PACKETS
    ________________________________________________________________
    :SLOTTYPES
    
    Abilities
    4
    5
    11
    12
    13
    15
    16
    18
    19
    20
    21
    22
    23
    25
    
    Consumables
    10
    
    Weapons
    1
    2
    3
    8
    17
    24
    
    Armor
    6
    7
    14
    
    Rings
    9
    ________________________________________________________________
    :OBJECTS
    
    BitmapData
    	int width
    	int height;
    	byte[] bytes;
    	
    Entity
    	short objectType
    	Status status
    	
    Status
    	int objectId
    	Location pos
    	StatData[] data
    	
    StatData
    	int id
    	int intValue
    	string stringValue
    	
    id
    	MAX_HEALTH = 0 
    	HEALTH = 1
    	SIZE = 2
    	MAX_MANA = 3
    	MANA = 4
    	XP_GOAL = 5
    	XP = 6
    	LEVEL = 7
    	INVENTORY = [i for i in range(8, 20)]
    	ATT = 20
    	DEF = 21
    	SPD = 22
    	#23-25 missing from the client
    	VIT = 26
    	WIS = 27
    	DEX = 28
    	CONDITION = 29
    	STARS = 30
    	NAME = 31
    	TEXTURE1 = 32
    	TEXTURE2 = 33
    	MERCHANT_TYPE = 34
    	REALM_GOLD = 35
    	PRICE = 36
    	BOOL_CAN_ENTER_PORTAL = 37
    	ACCOUNT_ID = 38
    	CURRENT_FAME = 39
    	MERCHANT_CURRENCY = 40
    	OBJECT_ORIENTATION = 41
    	MERCHANT_ITEMS_LEFT = 42
    	MERCHANT_MINUTES_LEFT = 43
    	MERCHANT_DISCOUNT = 44
    	MERCHANT_RANK_REQUIRED = 45
    	HEALTH_BONUS = 46
    	MANA_BONUS = 47
    	ATT_BONUS = 48
    	DEF_BONUS = 49
    	SPD_BONUS = 50
    	VIT_BONUS = 51
    	WIS_BONUS = 52
    	DEX_BONUS = 53
    	CONTAINER_OWNER = 54
    	NAMECHANGE_RANK_REQUIRED = 55
    	BOOL_NAME_REGISTERED = 56
    	FAME = 57
    	FAME_GOAL = 58
    	GLOWING_EFFECT = 59
    	SINK_DEPTH = 60
    	ALT_TEXTURE = 61
    	GUILD = 62
    	GUILD_RANK = 63
    	BREATH = 64
    	XP_BOOSTED = 65
    	XPBOOST_TIME_LEFT = 66
    	DROPRATE_TIME_LEFT = 67
    	LOOTTIER_TIME_LEFT = 68
    	HEALTHPOT_COUNT = 69
    	MANAPOT_COUNT = 70
    	BACKPACK = [i for i in range(71, 79)]
    	BOOL_HAS_BACKPACK = 79
    	PET_SKIN_OBJECT_TYPE = 80
    	PET_ID = 81
    	PET_SKIN = 82
    	PET_TYPE = 83
    	PET_RARITY = 84
    	PET_MAX_LEVEL = 85
    	PET_UNK1 = 86 #Reserved for a pet feature, but not yet implemented (13.2)
    	FOOD_SPENT_ON_SKILL1 = 87
    	FOOD_SPENT_ON_SKILL2 = 88
    	FOOD_SPENT_ON_SKILL3 = 89
    	PET_SKILL1_LEVEL = 90
    	PET_SKILL2_LEVEL = 91
    	PET_SKILL3_LEVEL = 92
    	PET_SKILL1_TYPE = 93
    	PET_SKILL2_TYPE = 94
    	PET_SKILL3_TPYE = 95
    	
    GroundData
    	string id
    	int type
    	int maxDamage
    	int minDamage
    	boolean noWalk
    	boolean push
    	boolean sink
    	float speed
    	
    Item
    	int item
    	int slotType
    	boolean tradeable
    	boolean included
    	
    ItemData
    	string id
    	int type
    	int slotType
    	int tier
    	string petFamily
    	string rarity
    	string activate
    	boolean consumable
    	boolean soulbound
    	boolean usable
    	int bagType
    	int feedPower
    	float rateOfFire
    	int fameBonus
    	int mpCost
    	int mpEndCost
    	boolean multiPhase
    	int numProjectiles
    	ProjectileData[] projectiles
    	
    Location
    	float x
    	float y
    	float distanceSquaredTo(Location location)
    	float distanceTo(Location location)
    	
    LocationRecord
    	int time
    	float x
    	float y
    	float distanceSquaredTo(Location location)
    	float distanceTo(Location location)
    	
    ObjectData
    	string id
    	int type
    	int maxHitPoints
    	int maxSize
    	int minSize
    	int size
    	int sizeStep
    	int shadowSize
    	int color
    	float xpMult
    	float rotation
    	boolean drawOnGround
    	boolean enemy
    	boolean fullOccupy
    	boolean occupySquare
    	boolean enemyOccupySquare
    	boolean blocksSight
    	boolean noMiniMap
    	boolean stasisImmune
    	boolean protectFromGroundDamage
    	boolean protectFromSink
    	boolean connects
    	float z
    	
    Packet
    	byte id()
    	string toString()
    	
    ProjectileData
    	string objectId
    	float speed
    	int maxDamage
    	int minDamage
    	int lifetimeMS
    	
    SlotObject
    	int objectId
    	int slotId
    	int objectType
    	
    Tile
    	short x
    	short y
    	int type
    ________________________________________________________________
    :PACKETS
    - All packet objects implement the id() function
    
    !!! The following packets are CLIENT packets !!!
    
    ACCEPTTRADE
    	boolean[] myOffer
    	boolean[] yourOffer
    	
    AOEACK
    	int time
    	Location position
    	
    BUY
    	int objectId
    	
    CANCELTRADE
    	
    CHANGEGUILDRANK
    	string name
    	int guildRank
    	
    CHANGETRADE
    	boolean[] offer
    	
    CHECKCREDITS
    	
    CHOOSENAME
    	string name
    	
    CREATEGUILD
    	string name
    	
    CREATE
    	int classType
    	int skinType
    	
    EDITACCOUNTLIST
    	int accountListId
    	boolean add
    	int objectId
    	
    ENEMYHIT
    	int time
    	int bulletId
    	int targetId
    	boolean kill
    	
    ESCAPE
    
    GOTOACK
    	int time
    	
    GROUNDDAMAGE
    	int time
    	Location position
    	
    GUILDINVITE
    	string name
    	
    GUILDREMOVE
    	string name
    	
    HELLO
    	string buildVersion
    	int gameId
    	string guid
    	string password
    	string secret
    	int keyTime
    	byte[] key
    	byte[] obf0
    	string obf1
    	string obf2
    	string obf3
    	string obf4
    	string obf5
    	
    INVDROP
    	SlotObject slotObject
    	
    INVSWAP
    	int time
    	Location position
    	SlotObject slotObject1
    	SlotObject slotObject2
    	
    JOINGUILD
    	string guildName
    	
    LOAD
    	int charId
    	boolean isFromArena
    	
    MOVE
    	int tickId
    	int time
    	Location newPosition
    	LocationRecord[] records
    	
    OTHERHIT
    	int time
    	int bulletId
    	int objectId
    	int targetId
    	
    PLAYERHIT
    	int bulletId
    	int objectId
    	
    PLAYERSHOOT
    	int time
    	int bulletId
    	int containerType
    	Location startingPos
    	float angle
    	
    PLAYERTEXT
    	string text
    	
    PONG
    	int serial
    	int time
    	
    REQUESTTRADE
    	string name
    	
    RESKIN
    	int skinID
    	
    SETCONDITION
    	int conditionEffect
    	float conditionDuration
    	
    SHOOTACK
    	int time
    	
    SQUAREHIT
    	int time
    	int bulletId
    	int objectId
    	
    TELEPORT
    	int objectId
    	
    UPDATEACK
    
    USEITEM
    	int time
    	SlotObject slotObject
    	Location itemUsePos
    	int useType
    	
    USEPORTAL
    	int objectId
    	
    !!! The following packets are SERVER packets !!!
    
    ACCOUNTLIST
    	int accountListId
    	string[] accountIds
    	
    ALLYSHOOT
    	int bulletId
    	int ownerId
    	short containerId
    	float angle
    	
    AOE
    	Location pos
    	float radius
    	int damage
    	int effect
    	float duration
    	int origType
    	
    BUY
    	int result
    	string resultString
    	
    CLIENTSTAT
    	string name
    	int value
    	
    CREATE_SUCCESS
    	int objectId
    	int charId
    	
    CREATEGUILDRESULT
    	boolean success
    	string errorText
    	
    DAMAGE
    	int targetId
    	int[] effects
    	int damageAmount
    	boolean kill
    	int bulletId
    	int objectId
    	
    DEATH
    	string accountId
    	int charId
    	string killedBy
    	int obf0
    	int obf1
    
    FAILURE
    	int errorId
    	string errorDescription
    	
    FILE
    	string name
    	byte[] bytes
    	
    GLOBAL_NOTIFICATION
    	int type
    	string text
    	
    GOTO
    	int objectId
    	Location pos
    	
    INVITEDTOGUILD
    	string name
    	string guildName
    	
    INVRESULT
    	int result
    	
    MAPINFO
    	int width
    	int height
    	string name
    	string obf0
    	int obf1
    	int fp
    	int background
    	boolean allowPlayerTeleport
    	boolean showDisplays
    	string[] clientXML
    	string[] extraXML
    	
    NAMERESULT
    	boolean success
    	string errorText
    	
    NEWTICK
    	int tickId
    	int tickTime
    	Status[] statuses
    	
    NOTIFICATION
    	int objectId
    	string message
    	int color
    	
    PIC
    	BitmapData bitmapData
    	
    PING
    	int serial
    	
    PLAYSOUND
    	int ownerId
    	int soundId
    	
    QUESTOBJID
    	int objectId
    	
    RECONNECT
    	string name
    	string host
    	int port
    	int gameId
    	int keyTime
    	boolean isFromArena
    	byte[] key
    	
    SERVERPLAYERSHOOT (SHOOT2)
    	int bulletId
    	int ownerId
    	int containerId
    	Location startingPos
    	float angle
    	short damage
    	
    ENEMYSHOOT (SHOOT)
    	int bulletId
    	int ownerId
    	int bulletType
    	Location startingPos
    	float angle
    	short damage
    	int numShots
    	float angleInc
    	
    SHOW_EFFECT
    	int effectType
    	int targetObjectId
    	Location pos1
    	Location pos2
    	int color
    	
    TEXT
    	string name
    	int objectId
    	int numStars
    	int bubbleTime
    	string recipient
    	string text
    	string cleanText
    	
    TRADEACCEPTED
    	boolean[] myOffer
    	boolean[] yourOffer
    	
    TRADECHANGED
    	boolean[] offer
    	
    TRADEDONE
    	int code
    	string description
    	
    TRADEREQUESTED
    	string name
    	
    TRADESTART
    	Item[] myItems
    	string yourName
    	Item[] yourItems
    
    UPDATE
    	Tile[] tiles
    	Entity[] newObjs
    	int[] drops
    The problem for me understanding the packets is just, that I don't know which are used from the client to the server and from the server to the client. I just test them then.

    The item selecting for trading IS working(if both accept the trade is successful just like I wanted), but I don't know how to actually deselect it on my client(just for the visual). On the second picture you can see that the the left inventory is what the other user would see(that's what I want to see on my other client too).

    I know the difference between changetrade and tradechanged, I use both of them in my plugin too.
    The problem is still, that my plugin sends the packet, deselects it on the other side(left side of the second picture) but if I wouldn't print "successful" or anything like that I wouldn't know it worked. I hope you understand what I mean

    Thanks for helping. To the first question:

    PLAYERTEXT [9]
    Packet Structure:
    {
    Text => String
    Send => Boolean
    Id => Byte
    }

    Where would I put in the recipient if I only can enter one string?
    I hooked a function to the text packet and it printed everything correctly. If I tried to send a pm from my main to the proxy client it worked.

    Output:
    Code:
    TEXT(34) Packet Instance
    	Name => MYMAIN
    	ObjectId => -1
    	NumStars => 65
    	BubbleTime => 10
    	Recipient => MYMULE
    	Text => hi
    	CleanText => 
    	Send => True
    	Id => 34
    The objectid seems to be -1 if the sender is not in the same world as the recipient


    ---------------
    omg I'm dumb, sorry. I already forgot about the code you sent here after reading the next sentence >.>
    Thanks.

    Question 2 is still open, I just don't want it to be highlighted on my client anymore, when it's actually not on the other client

    Question 3: Is hookkey in krelay not available anymore? In the documentation it says how to use it but it's not even in a class

  5. #4
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    Quote Originally Posted by Fightera100 View Post
    Question 2 is still open, I just don't want it to be highlighted on my client anymore, when it's actually not on the other client
    I don't understand the question. Which one of the clients connected to K Relay?

    Are you trying to make it so that the other player selects an item and you, the K Relay user, don't see any items selected?
    Or is it that the other player never selects an item and you want to see an item selected in the client connected to K Relay?
    Or are you trying to make both clients see the same?

    What about the trade accept part? Do you want both to be able to see when the trade is accepted?

    Edit: Read the sentence a couple of times and I think what you're trying to do is that when the client that is not connected to K Relay deselects an item it gets deselected in the client connected to K Relay.

    The answer to this is that you do nothing. When an item gets deselected on the trade partners inventory, the server sends TRADECHANGED to you client changing the slot to false. No need to tamper with anything here.

    Quote Originally Posted by Fightera100 View Post
    Question 3: Is hookkey in krelay not available anymore? In the documentation it says how to use it but it's not even in a class
    My guess is that it hasn't even been implemented yet. I've tried to implement it myself but K Relay always crashes after receiving a keystroke.
    Last edited by CrazyJani; 09-24-2016 at 01:17 PM.

  6. #5
    Fightera100's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    662
    Reputation
    10
    Thanks
    1,684
    Quote Originally Posted by CrazyJani View Post
    I don't understand the question. Which one of the clients connected to K Relay?

    Are you trying to make it so that the other player selects an item and you, the K Relay user, don't see any items selected?
    Or is it that the other player never selects an item and you want to see an item selected in the client connected to K Relay?
    Or are you trying to make both clients see the same?

    What about the trade accept part? Do you want both to be able to see when the trade is accepted?

    Edit: Read the sentence a couple of times and I think what you're trying to do is that when the client that is not connected to K Relay deselects an item it gets deselected in the client connected to K Relay.

    The answer to this is that you do nothing. When an item gets deselected on the trade partners inventory, the server sends TRADECHANGED to you client changing the slot to false. No need to tamper with anything here.


    My guess is that it hasn't even been implemented yet. I've tried to implement it myself but K Relay always crashes after receiving a keystroke.
    Left client is steam client, and right client is proxy client. The proxy client deselects the item via a packet and it doesn't update on the own client, it just sends it to the server

  7. #6
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    Quote Originally Posted by Fightera100 View Post
    Left client is steam client, and right client is proxy client. The proxy client deselects the item via a packet and it doesn't update on the own client, it just sends it to the server
    I went ahead and experimented a bit with the packets which made me recall something from quite a while ago.

    Some packets such as MOVE make the client go out of sync. CHANGETRADE is one of these packets as well but unlike MOVE packets this causes no harm (MOVE packets disconnect you).

    Basically what happens is that the client makes assumptions based on the packets it has sent and one of those assumptions is that the item gets unhighlighted when a TRADECHANGED packet makes some item not to be included in the trade. This can't be prevented and there is no other packet that could fix it. You'd have to make changes to the client to allow you to fix this.

  8. The Following User Says Thank You to CrazyJani For This Useful Post:

    Fightera100 (09-24-2016)

  9. #7
    Fightera100's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    662
    Reputation
    10
    Thanks
    1,684
    Quote Originally Posted by CrazyJani View Post
    I went ahead and experimented a bit with the packets which made me recall something from quite a while ago.

    Some packets such as MOVE make the client go out of sync. CHANGETRADE is one of these packets as well but unlike MOVE packets this causes no harm (MOVE packets disconnect you).

    Basically what happens is that the client makes assumptions based on the packets it has sent and one of those assumptions is that the item gets unhighlighted when a TRADECHANGED packet makes some item not to be included in the trade. This can't be prevented and there is no other packet that could fix it. You'd have to make changes to the client to allow you to fix this.
    Thank you!

Similar Threads

  1. [Help Request] Need help with K Relay and have questions about notifiers! :(
    By ZaydeIsAmazing in forum Realm of the Mad God Help & Requests
    Replies: 5
    Last Post: 07-01-2015, 07:30 PM
  2. [Help Request] Need help with Realm Relay, Packet Parser, and Oryx Rape.
    By jakerofl in forum Realm of the Mad God Help & Requests
    Replies: 7
    Last Post: 03-08-2015, 05:37 AM
  3. [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
  4. [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
  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