Closed WinterSolstice8 closed 1 year ago
By request of Marco, I checked what happens on Linux if I prepend the string before the char(130), I edited the SendText call as follows:
SendText( HostIP, "test"$querychar$"Request="$ServerName$querychar );
0000 00 d8 61 76 50 7a 08 00 27 60 53 d9 08 00 45 00 ..avPz..'`S...E.
0010 00 20 07 1d 40 00 40 11 1d fd 0a 00 00 e3 0a 00 . ..@.@.........
0020 00 d1 0f 0a 0f 0a 00 0c e4 34 74 65 73 74 00 00 .........4test..
0030 00 00 00 00 00 00 00 00 00 00 00 00 ............
Just a reminder here to check MODE_Binary
and ReceivedBinary()
in UdpLink as well (if they aren't still fixed in the latest v469c).
TL;DR: 227j and 469c will add an IpDrv.InternetLink compatibility mode that restores the original (albeit incorrect) behavior for the execSendText and execReceiveText functions
Longer explanation: This is a nasty one. What is supposed to happen here is the following:
Now keep in mind that:
To restore compatibility with ChatLink, we will make IpDrv's SendText and ReceiveText use conversion functions that emulate 436/227i's incorrect behavior.
Unrelated: Resolving 10.0.0.209 to an UnrealScript IpAddr should immediately succeed since 10.0.0.0/24 is a private IP range. It's possible that you do not see a "Resolved 10.0.0.209" message in the log for this very reason.
Yup, it's as I suspected. I did see that certain codepages allowed some >127 characters, but that could result in inconsistent behavior which we don't want.
Will check out the resolving, it looks like it's just wrong -- it's actually sending packets to the wrong IP as compared to what's in the ini file. Probably just needs a recompile, it's an ancient mod after all.
I've pushed a fix that will be included in 469c-RC3
The fix had some pretty nasty side effects so it had to be rolled back. I'll try to fix this another way for rc4
I forgot to re-close this one. ChatLink should work as expected in the 469c release version (and in 469d). We added configurable text encoding support to IpDrv.InternetLink (and its subclasses). These are the two supported modes:
45 │ //
46 │ // OldUnreal: Text Encoding Mode.
47 │ //
48 │ // The InternetLink subclasses have several functions that send or receive ANSI text.
49 │ // Since we store all strings in some Unicode format internally, all of these functions
50 │ // require conversion between ANSI and the internal Unicode format.
51 │ //
52 │ // Unreal (<227j) and Unreal Tournament (<469c) performed this conversion by mapping
53 │ // Unicode code points up to 0xFF directly onto ANSI characters with the same byte
54 │ // representation, even if the characters represented by those bytes are not the
55 │ // same as the original Unicode character.
56 │ //
57 │ // This behavior/feature is fine for Unicode code points up to 0x7F, since those code
58 │ // points map directly onto (pretty much?) all ANSI code pages, but results in incorrect
59 │ // translations for all points between 0x7F-0xFF.
60 │ //
61 │ // Unfortunately, there seem to be a few mods that rely on the old (incorrect) behavior.
62 │ // To accomodate these mods, we use the old/incorrect encoding method
63 │ // (TEXTENC_Compatibility) by default.
64 │ //
65 │ // New mods should, however, set TextEncoding to TEXTENC_Native. In this mode, the engine
66 │ // converts unicode code points above 0x7F to UTF-8 characters.
67 │ //
68 │ var enum ETextEncoding
69 │ {
70 │ TEXTENC_Compatibility,
71 │ TEXTENC_Native
72 │ } TextEncoding;
The default value is TEXTENC_Compatibility, so this is what ChatLink will use in >469c.
Versions of UT before 469b (did not test 469a) (as well as Unreal versions 227i and before) send a packet like this:
(note the 0x82 in the data section)
UT469b, 227j, from windows:
the 0x82 is now transformed to 0x3f
469b on linux resolves the wrong host (attempting to resolve
10.0.0.209
via .ini file, spits outSuccessfully resolved host 71.166.58.138:0
). The cap also looks wrong from TCP dump (other caps are from Wireshark):so I can't get a "good" linux cap from 469b but here is 227j's cap:
It's data is nulled and has 2 extra bytes.
Repro steps:
1) Download ChatLink.zip and install to System folder 2) Modify chatlink.ini to have a ServerAddress IP to your LAN ip of choice to listen to packets 3) set up filter in wireshark for
udp.port == 3850
orport 3850
with tcpdump 4) In a game mode that lets you summon any pawn (DM doesn't seem to work)summon ChatLink.ChatLink
in game, or useServerActors=ChatLink.ChatLink
. You'll see some big output text in the log as follows if it spawned right:5) check packet, expect hex data of
82 52 65 71 75 65 73 74 3d 4f 66 66 82
in data sectionI suspect this is caused from some ANSI conversion:
In ChatLink.ChatUDP:
SendText( HostIP, querychar$"Request="$ServerName$querychar );
where querychar is set in ChatLink.ChatLink asCHR(130);