After fiddling with this a bit, I found a drawback and I'm not sure what to do with it... XMLRPC has two particular types, base64 and dateTime.iso8601, which aren't handled very nicely by the xmlrpc extension. To encode them, you have to call xmlrpc_set_type which actually wraps them into small objects and the decoding returns objects for them.
For dateTime, I don't think it's used by the dedicated in any method or callback so nobody probably care if encoding/decoding doesn't give the same results in both functions (xmlrpc one and mine).
However, base64 is useful for tunnelling data and writing files. Encoding isn't an issue as an object is already used (I just modified it a bit so it works in both functions) but decoding is: it was usually sending back only the decoded string so this is what I'm doing in my function but the xmlrpc returns an object... Two solutions:
- my function returns an object
=> it'll break any project using the TunnelDataReceived callback and the GetValidationReplay method
- strings from the xmlrpc return are unwrapped
=> it needs to use array_walk_recursive but it's so slow (around x3 factor) it makes it even slower than my function for small requests...
I'm prefering the first one, as it's easily fixable:
- the method return can be unwrapped in the Connection class directly (so it's not even a real issue ^^)
- the callback is generally handled by a callback manager which can then do the unwrapping
But if anyone has another point of view or another solution, feel free to share it ^^
Edit: I did the first choice, feel free to test!
Dedicated Server API Client Communication
Moderator: NADEO
-
- Posts: 1026
- Joined: 15 Jun 2010, 15:46
Re: Dedicated Server API Client Communication
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
Re: Dedicated Server API Client Communication
https://github.com/NewboO/dedicated-ser ... e.php#L169
Shouldn't you read until you have 8 bytes total? Assuming you always read 8 bytes can go.. wrong, even though it's usually the case, it doesn't have to be as far as I know.
Shouldn't you read until you have 8 bytes total? Assuming you always read 8 bytes can go.. wrong, even though it's usually the case, it doesn't have to be as far as I know.
=3
-
- Posts: 1026
- Joined: 15 Jun 2010, 15:46
Re: Dedicated Server API Client Communication
Indeed! Fixed by factorizing readings and writings (though there's a single write in the whole code), which also means that changing to socket_* functions would be easier if ever done.TGYoshi wrote:Shouldn't you read until you have 8 bytes total? Assuming you always read 8 bytes can go.. wrong, even though it's usually the case, it doesn't have to be as far as I know.
As I said, GetValidationReplay wasn't a real issue and should still be giving the same result as beforekremsy wrote:But there should be a way to get all Methods working, getValidationReplay is very important for Dedimania Communication for example.

It's supposed to already be finished ^^ It just needs more tests to find bugs and maybe a bit of tweaking, so you can already try itkremsy wrote:Thank you soo much, I will try it out as soon as it is finished.

OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
-
- Posts: 1026
- Joined: 15 Jun 2010, 15:46
Re: Dedicated Server API Client Communication
What's the server name? I'll investigate to see if anything can be done in the library or if it comes from dedicated itself. Also, did you let the default read timeout or set a custom one?
Don't worry, they are declared (else the library couldn't work at all) thanks to the call to extract(). This function can make code a bit weird to read (especially when you don't know what it does ^^) but it shouldn't be a problem in this case as the variables which will be extracted are named in the unpack() call just before.kremsy wrote:And on line 74 are two undeclared variables used:size and protocolCode: Select all
if($size != 11 || $protocol != 'GBXRemote 2')
same on line 188
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
Re: Dedicated Server API Client Communication
Mybe initialyse both variables before the unpack(), to avoid warning if the code using your lib have increased the warning verbosity/level ?The_Big_Boo wrote:Don't worry, they are declared (else the library couldn't work at all) thanks to the call to extract(). This function can make code a bit weird to read (especially when you don't know what it does ^^) but it shouldn't be a problem in this case as the variables which will be extracted are named in the unpack() call just before.
@kremsy: strange to get such problem specifically with GetServerName(), i never notice such thing. You are sure that you don't have some weird char in the server name (I mean wrong utf8 codes) ? That *should not* break the connection, but finding which case produce it will help to solve. Other idea : you tried with another php version ? maybe you get an issue linked to a php bug...
Developer/maintainer of TM² Dedimania records system - TM² Fast4 server script (download , french topic)
Who is online
Users browsing this forum: No registered users and 1 guest