Jump to content
  • 0

Cached Packets Working But With Error?


tk422

Question

Greetings, Again!

 

I've been working on a custom control panel and have many of the standard SQL based commands in, but today started working on sending CacheD packets for things like changing a character name.

 

In this example i change a character named "Bob" with a char_id of 2 to the name "Salsa".

The change DID happen. I logged in and saw the new name, the SQL updated. 

 

However, i'm getting this message in CacheD status log.

 

Is this normal? Any idea how i can fix this?

 

aec2758102.png

 

Thank you all once again for your help!

 

• Update 1 - It seems like there is only this issue while changing character name. I've implemented a few others packets which all work perfectly with no errors...

Edited by Universe
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hello,

 

Is ok. I get same from my panel. :)

 

Ahh, ok. Good to know! Many <3's to you!

 

I asked the AdvExt guys and they say that when using their control panel CacheD doesn't give this error.

 

I was sent their packet manipulation scripts as documentation and am using them verbatim. I don't know how their CP doesn't do this unless they aren't changing char name though a CacheD packet.

 

I think that if the packet im sending was "wrong" in some way CacheD would simply reject it.

Is this correct?

 

Could this be an issue with a the stored procedure: lin_GetUserDataByCharName?

Link to comment
Share on other sites

  • 0

Whats your code look like?

 

I'm actually using Node.JS and Javascript, not PHP. Working on a full REST API.

 

http://pastebin.com/i2ghYYi6

 

Like i said, the packets all WORK ok. Like they do what they're supposed to without issue. it's just CacheD giving this error with this one.

 

module.exports.configz is what's kicking everything off. (I'm calling this from another file)

It generates a packet with the supplied values and then calls the submitPacket function which actually does the submission to CacheD.

 

The other packets i've made work correctly and with no errors, it's just this one.

 

- Update: Found the issue (i think), Working on how to solve it.

I'm opening a socket to CacheD and leaving it open. It looks like whatever command i'm sending is getting sent multiple times where it should be sending once and then disconnecting. Working on a fix.

Edited by tk422
Link to comment
Share on other sites

  • 0

You don't seem to close any connections - most php implementations do this and if my brain remembers that is how it's designed for in cacheD.

 

 

NINJA:

argh didn't read proper you already saw that.

I'll test if i have time myself.

Edited by mcbigmac
Link to comment
Share on other sites

  • 0

You don't seem to close any connections - most php implementations do this and if my brain remembers that is how it's designed for in cacheD.

 

 

NINJA:

argh didn't read proper you already saw that.

I'll test if i have time myself.

 

Yah this is exactly what's happening. Ii'm now closing the socket and all is well.

 

My problem now is how to read the result of what CacheD sends back when the packet has been submitted.

 

This is the original function:

	function CacheDInteractive($buf) {
		$fp = fsockopen($this->cachedip, $this->cachedport , $errno, $errstr, 5);
		$rs = '';
		if (!$fp) return $this -> fsockerror;

		$packet = pack("s", (strlen($buf)+2)).$buf;
		fwrite($fp, $packet);
		$len = unpack("v", fread($fp, 2));
		$rid = unpack("c", fread($fp, 1));
		for ($i = 0; $i < (($len[1]-4) / 4); $i++) { 
			$read = unpack("i", fread($fp, 4));
			$rs .= $read[1];
		}
		fclose($fp);
		$result = $this -> socketerrors[$rs];
		
	return($result);
	}

These two calls:

$len = unpack("v", fread($fp, 2));

$rid = unpack("c", fread($fp, 1));

+ the foor loop are proving problematic.

 

These functions don't exist in JS, so i have to find another solution to do the conversion and then to get the error code.

 

I can read the data sent back from CacheD but each time i get BwA3AQAA which equals 7. Error code 7 is "Char is currently logged in". Somethings weird because this is not the case for the char im testing operations on. THough like i said im not doing the conversion.

Edited by tk422
Link to comment
Share on other sites

  • 0

http://phpjs.org/functions/fread/

 

google is your friend.

 

Haven't been updating this post. Should have been.. :P

 

I've figured out how to read the response ok. But now the issue is converting it into the friendly error code.

    cachedSocket.on('data', function(data) {
        if (data) {
            var response = toArrayBuffer(data);
            var len = response.slice(0,2);
            var rid = response.slice(0,1);
            var rs = '';
            for (var i = 0; i < ((len[1]-4) / 4); i++) {
                var read = response.slice(0,4);
                rs += read[1];
            }
            console.log(rs);
        }
    });

rs is undefined at the end of execution and i'm not sure why.

I'm getting to the point where i'll pay anyone who can solve this issue lol.

Edited by tk422
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -61. Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+20). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 100%. » Crystal enchant scrolls chance – 50% Augmentations: » Mid life stone skill chance – 5%. » High life stone skill chance – 10%. » Top life stone skill chance – 20%. » Augments 1+1 Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations. Custom server gear : 1). Titanium Armor Lv.1 2). Epic Armor Lv.2 3). Epic Weapons-Kamikaze-Black S grade (Same Stats) 4). Demonic-Angelic Wings-Baium Hair-Custom Accessories (SameStats) 5). Custom Fighter/Mage tattoo Lv1-Lv2-Lv3 6). Shirt (STR,CON,INT +1) 7). Custom Shields Server Commands: .tvtjoin .tvtleave – Join or leave tvt event. .ctfjoin .ctfleave – Join or leave ctf event. .dmjoin .dmleave – Join of leave dm event. .online – current online players count. .repair – repairs stuck character in world. .menu – opens online menu panel. .exit – PVP zone exit in case you are bullied. .changepassword - Opens online menu then u can change ur password in game. .farm - Enable/disable autofarm Event system: » TVT event » CTF event » DM event » Tournament Event » Party Zone » Unique event shop. Olympiad game: » Retail olympiad game. » Competition period [1] week. » Olympiad start time [18:00] end [00:00] GMT+2. » New Heroes every Sunday.
    • Tomorrow grand opening lests go 🙂 
    • New season of Warfire X150 has been postponed to September 28th.
  • Topics

×
×
  • Create New...