SphereCommunity
Packets from server to client - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Packets from server to client (/Thread-Packets-from-server-to-client)

Pages: 1 2


Packets from server to client - Breaker - 05-24-2013 05:52 PM

What i can hook packets from server to client?


RE: Packets from server to client - Wap - 05-25-2013 12:48 AM

It is impossible by SphereScp and/or Sphere settings. Only by the external programm, may be.


RE: Packets from server to client - RanXerox - 05-25-2013 12:50 AM

I don't understand, can you give an example of what you want to do?


RE: Packets from server to client - Breaker - 05-25-2013 12:59 AM

sphere send packet for client, what i can rewrite packet before sending?

me liked that, if can create new trigger(for players only) before server send packet to client:
ON=@SendPacket
ARGN1=Packet Number
ARGN2=Length of Packet
SRC - character
l - character
LOCAL.1 - LOCAL.n = bytes of packet
RETURN 1 // Abort sending packet

really make this trigger?


RE: Packets from server to client - Rattlehead - 05-25-2013 08:17 AM

you can alter packets sent per trigger, in the case stated above you are suggesting a trigger that fires everytime a packet is sent to the client, which seems to me to be very resource consuming tbh, i cant think of any good reason why you would need to alter every packet sent

when are you wanting to intercept the packets?, you can use an existing trigger, like @click, and then use the SENDPACKET function to send the packets you wish to send

like ran asked, what exactly are you trying to do? there is really no reason to trigger every packet sent when you can use the sendpacket function in any trigger that is already implemented


RE: Packets from server to client - Breaker - 05-25-2013 10:06 PM

i want now hook packets: [0x1C] Send Speech, [0xAE] Unicode Speech message, i want make multi language support
or i want change replace sphere hardcore text for [DEFMESSAGES MESSAGES]
for example now we have
Code:
[DEFMESSAGE MESSAGES]
alchemy_dunno                "You have no clue how to make this potion."
alchemy_lack                "Hmmm, you lack %s for this potion."
alchemy_nobottles            "You have no bottles for your potion."
alchemy_not_reg                "That is not a reagent."
alchemy_pour                "pour the completed potion into a bottle"
....

i want make
Code:
[DEFMESSAGE MESSAGES_ENG] // all messages on english language
ENG_alchemy_dunno                "You have no clue how to make this potion."
ENG_alchemy_lack                "Hmmm, you lack %s for this potion."
ENG_alchemy_nobottles            "You have no bottles for your potion."
ENG_alchemy_not_reg                "That is not a reagent."
ENG_alchemy_pour                "pour the completed potion into a bottle"
....

[DEFMESSAGE MESSAGES_DEU]  // all messages on german language
DEU_alchemy_dunno                "You have no clue how to make this potion."
DEU_alchemy_lack                "Hmmm, you lack %s for this potion."
DEU_alchemy_nobottles            "You have no bottles for your potion."
DEU_alchemy_not_reg                "That is not a reagent."
DEU_alchemy_pour                "pour the completed potion into a bottle"
....

[DEFMESSAGE MESSAGES_RUS] // all messages on russian language
RUS_alchemy_dunno                "You have no clue how to make this potion."
RUS_alchemy_lack                "Hmmm, you lack %s for this potion."
RUS_alchemy_nobottles            "You have no bottles for your potion."
RUS_alchemy_not_reg                "That is not a reagent."
RUS_alchemy_pour                "pour the completed potion into a bottle"
...



RE: Packets from server to client - amonvangrell - 05-26-2013 06:19 PM

YOU COULD USE TAGS ON PLAYERS WITH THE DEFINED LANGUAGES, AND TRY THEM OUT ON SUCCESS OF THE SKILL/SPELL.


RE: Packets from server to client - Breaker - 05-28-2013 06:19 AM

it's very big work to rewrite all actions, LOS, skills, and other sphere messages, and i can get lang from SRC.ACCOUNT.LANG, not need make tags
ps: sphere not support other custom sections for [DEFMESSAGE =(


RE: Packets from server to client - darksun84 - 05-28-2013 06:42 AM

If i remember well there is the packetX handler feature(You have to put it in the sphere.ini) :

PHP Code:
Added support for packets filteringsPlease notethat you should understand
    what are you doing
You can install your handler of a packet X specifying
    PACKETx
=functionnameThis function will be called when the packet is going
    to be processed by the server
It has the following arguments set:
    
ARGN1 packet number (to allow using one function for different packets)
    
ARGS source client ip address
    LOCAL.0
-LOCAL.9 first 10 bytes of the packet for parsing contents
    
If you do return 1 in this function, the packet will NOT be processed 

I never used it by the way Blush


RE: Packets from server to client - Rattlehead - 05-28-2013 12:29 PM

afaik language is handled client side via cliloc files anyways, so most of it you cant even change unless you change it client side