Jump to content
  • 0

Cached Packets Working But With Error?


Question

Posted (edited)

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

8 answers to this question

Recommended Posts

  • 0
Posted
  On 3/31/2014 at 3:03 AM, xeL said:

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?

  • 0
Posted (edited)
  On 3/31/2014 at 2:54 PM, mcbigmac said:

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
  • 0
Posted (edited)

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
  • 0
Posted (edited)
  On 3/31/2014 at 8:56 PM, mcbigmac said:

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
  • 0
Posted (edited)
  On 4/1/2014 at 7:43 AM, mcbigmac said:

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

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

    • Fix Visual Boundary for AutoFarm when entering a new zone. Fix Assassin Interface Automatic SoulShot usage. Fix Assassin Interface not displaying Castle/Base. Fix Achievements displaying item rewards for CommunityBoard & NPC. Fix Prevent players from purchasing their own Auctioned items. Added ''.raid'' and ''.achievement'' commands. Added support for multiple currencies on Auction Added Search feature to Auction. Added Offline Stores Added '.exit' & '.quit' command to Dungeon System so players can now exit/quit dungeons Added VIP Account System (Alternative XP, SP & Drop Rates, Unlocks Costumes) Added Loot Box System Changed DungeonsManager now displays reward list on dungeon pages. Changed GlobalShop to include pages for all currencies. HTML/XML edits
    • When I teleport to town, my current location is differ from the map. How do I fix this?    
    • A New Chapter Begins We're Rebuilding – Join Our Staff Team After many years of activity, growth, and challenges, it’s finally time for our community to restructure and move forward. We’re ready to turn a new page and evolve into something greater — but we can’t do it without the help of passionate and committed people. That’s why we’re now opening up staff applications for those who want to actively shape the future of our community. If you have the motivation, time, and patience to contribute to something meaningful, this is your chance to step in and make a real impact. What We're Looking For We’re building a fresh and dedicated team of individuals who are ready to support and grow this project. Open roles include: Moderators – to keep the forum clean, safe, and organized Gaming Moderators – to help manage gaming boards (e.g., Lineage, GTA FiveM) Content Creators – to post updates, guides, and articles Community Managers – to engage users and drive activity Technical Staff – for development, backend, and server work We’re not focusing only on Lineage anymore. Our vision is expanding to new areas — including GTA FiveM and other multiplayer games you might have expertise in. If you have a good idea, a server plan, or something new to suggest — we’re open to it. Now’s the time to bring it forward. Requirements We’re looking for individuals who have: A history of activity on the forum (preferred) Available time to contribute consistently A sense of teamwork and responsibility A genuine interest in gaming and community building If you're interested, just send a private message to me or Celestine. (or just reply here) Tell us a few things about yourself and how you’d like to contribute. Let’s bring this community back to life. Let’s rebuild something great — together.   M M G A 
  • Topics

×
×
  • Create New...